| | |
| | | #include "board.h" |
| | | //#include "Spi.h" |
| | | //#include "radio.h" |
| | | |
| | | #include "DBG.h" |
| | | |
| | | |
| | | //#define EUART_RX_BUF_SIZE 100 |
| | |
| | | |
| | | } |
| | | double d_value; |
| | | uint8_t shell_receive_state; |
| | | void UsartParseDataHandler(uint8_t data) |
| | | { |
| | | if(state5V_prase_flag&&!g_com_map[MODBUS_MODE]) |
| | |
| | | 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; |
| | | |
| | | |
| | | |
| | |
| | | } 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; |