WXK
2025-05-20 65f1d70842d83f92aa31d79c97e364b4b0fd9ab6
keil/include/drivers/serial_at_cmd_app.c
@@ -10,7 +10,7 @@
#include "board.h"
//#include "Spi.h"
//#include "radio.h"
#include "DBG.h"
//#define EUART_RX_BUF_SIZE 100
@@ -138,6 +138,10 @@
}
double d_value;
uint8_t shell_receive_state;
//static HIDO_UINT8 l_u8GPSBuff[512];
//static HIDO_UINT32 l_u8GPSLen = 0;
//static HIDO_UINT32 l_u8GPSRecvTick = 0;
void UsartParseDataHandler(uint8_t data)
{
    if(state5V_prase_flag&&!g_com_map[MODBUS_MODE])
@@ -146,7 +150,7 @@
        uint16_t checksum = 0;
        static uint8_t pack_datalen = 0,pack_length = 0,pack_index = 0,pack_msgtype = 0,pack_cmd = CMD_READ;
        static uint8_t index = 0;
//uint8_t shell_receive_state;
@@ -223,6 +227,16 @@
        } else if ((usart_receive_state == UsartReceiveWaitMsgType) && (data == 0x3)) {
            usart_receive_state = UsartReceiveWaitLength;
            pack_msgtype = data;
        } else if ((shell_receive_state == 0) && (data == 0x03)) {
            shell_receive_state = 1;
            uart_send(UART_ID1, data,1, NULL);
        } else if ((shell_receive_state == 1) && (data == 0x03)) {
            shell_receive_state = 2;
            uart_send(UART_ID1, data,1, NULL);
        } else if ((shell_receive_state == 2) && (data == 0x03)) {
          DBG_SetMode(DBG_MODE_SHELL);
            uart_send(UART_ID1, data,1, NULL);
            shell_receive_state=0;
        }
        else {
            usart_receive_state = UsartReceiveWaitHead0;
@@ -236,6 +250,14 @@
//   static ST_BLERecv BLE_recvive;
//        GGA_DataStruct jdrecv,wdrecv,Posstate;
        GPS_RecvFsm(data);
//        l_u8GPSBuff[l_u8GPSLen++] = data;
//        if(l_u8GPSLen >= sizeof(l_u8GPSBuff))
//        {
//            NTRIPApp_ReportGGA(l_u8GPSBuff, l_u8GPSLen);
//            l_u8GPSLen = 0;
//        }
//        l_u8GPSRecvTick = HIDO_TimerGetTick();
//        //接收数据开始分析
//        mUsart2ReceivePack[index]  =  data; //char数组传进来参数data
//        mUsart2ReceivePack_before  =  mUsart2ReceivePack_now;