halUARTCfg_t uartConfig; GenericApp_TaskID = task_id; GenericApp_NwkState = DEV_INIT; GenericApp_TransID = 0;
///配置串口 uartConfig.configured = TRUE; // 2x30 don't care - see uart driver.
uartConfig.baudRate = HAL_UART_BR_9600;//GPS 波特率改为9600 uartConfig.callBackFunc = my_gps_uart_cbk;//GPS的回调函数,接收到数据后 自动可以自动调用
uartConfig.baudRate = HAL_UART_BR_115200;//系统默认波特率 uartConfig.callBackFunc = NULL;//为开启GPS功能时,这里设为NULL 防止电平串扰 导致触发回调函数
uartConfig.flowControl = FALSE; uartConfig.flowControlThreshold = 64; // 2x30 don't care - see uart driver. uartConfig.rx.maxBufSize = 128; // 2x30 don't care - see uart driver. uartConfig.tx.maxBufSize = 128; // 2x30 don't care - see uart driver. uartConfig.idleTimeout = 6; // 2x30 don't care - see uart driver. uartConfig.intEnable = TRUE; // 2x30 don't care - see uart driver.
// 开启串口0 HalUARTOpen (HAL_UART_PORT_0, &uartConfig);