diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong/src/ch438_demo.c b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong/src/ch438_demo.c index 7a976f39e..94641eba8 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong/src/ch438_demo.c +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong/src/ch438_demo.c @@ -1,31 +1,22 @@ -/**************************************************************************** - * apps/examples/sx127x_demo/sx127x_demo.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ +/* +* Copyright (c) 2020 AIIT XUOS Lab +* XiOS is licensed under Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You may obtain a copy of Mulan PSL v2 at: +* http://license.coscl.org.cn/MulanPSL2 +* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +* See the Mulan PSL v2 for more details. +*/ /** -* @file ch438_demo.c -* @brief nuttx source code -* https://github.com/apache/incubator-nuttx-apps -* @version 10.2.0 -* @author AIIT XUOS Lab -* @date 2022-03-17 -*/ + * @file ch438_demo.c + * @brief imxrt board sd card automount + * @version 1.0 + * @author AIIT XUOS Lab + * @date 2022.04.26 + */ /**************************************************************************** * Included Files @@ -48,6 +39,7 @@ #include #include #include +#include #include "imxrt_ch438.h" @@ -57,14 +49,14 @@ void CH438Demo(void) { int i=0; - printf("ch438_main\n"); + syslog(LOG_INFO,"ch438_main\n"); Ch438InitDefault(); ch438_irq_enable(); up_mdelay(1000); while(1) { CH438UARTSend(2,"AT+BAUD=?",9); - printf("send success\n"); + syslog(LOG_INFO,"send success\n"); ImxrtCh438ReadData(NULL); up_mdelay(2000); } diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong/src/imxrt_ch438.c b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong/src/imxrt_ch438.c index 9d0fd5495..1d6031da4 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong/src/imxrt_ch438.c +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong/src/imxrt_ch438.c @@ -1,7 +1,28 @@ +/* +* Copyright (c) 2020 AIIT XUOS Lab +* XiOS is licensed under Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You may obtain a copy of Mulan PSL v2 at: +* http://license.coscl.org.cn/MulanPSL2 +* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +* See the Mulan PSL v2 for more details. +*/ + +/** + * @file imxrt_ch438.c + * @brief imxrt board sd card automount + * @version 1.0 + * @author AIIT XUOS Lab + * @date 2022.04.26 + */ + #include #include #include +#include #include #include @@ -91,12 +112,12 @@ void* ImxrtCh438ReadData(void *parameter) // abstime.tv_sec = 2; // while (1) // { - printf("sem_438 is %d\n",sem_438.semcount); + syslog(LOG_INFO, "sem_438 is %d\n",sem_438.semcount); result = sem_wait(&sem_438); if (result == OK) { gInterruptStatus = ReadCH438Data( REG_SSR_ADDR ); - printf("gInterruptStatus is %d\n", gInterruptStatus); + syslog(LOG_INFO,"gInterruptStatus is %d\n", gInterruptStatus); if(!gInterruptStatus) { @@ -122,7 +143,7 @@ void* ImxrtCh438ReadData(void *parameter) REG_MSR_ADDR = offsetadd[ext_uart_no] | REG_MSR0_ADDR; InterruptStatus = ReadCH438Data( REG_IIR_ADDR ) & 0x0f; /* 读串口的中断状态 */ - printf("InterruptStatus is %d\n", InterruptStatus); + syslog(LOG_INFO,"InterruptStatus is %d\n", InterruptStatus); switch( InterruptStatus ) { @@ -136,7 +157,7 @@ void* ImxrtCh438ReadData(void *parameter) RevLen = CH438UARTRcv(ext_uart_no, buff[ext_uart_no]); for(i=0;i