Commit 072dae6e authored by 王金亮's avatar 王金亮

fix:收到ID为21的串口数据后,开始升级

parent 664695d6
...@@ -213,6 +213,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData) ...@@ -213,6 +213,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)
{ {
if ( pData->CmdID == 0x20 ) if ( pData->CmdID == 0x20 )
{ {
//printf("0x20 is get\r\n");
if(Prot_User.State < Prot_Start) if(Prot_User.State < Prot_Start)
{ {
Prot_User.State = Prot_Start; Prot_User.State = Prot_Start;
...@@ -221,6 +222,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData) ...@@ -221,6 +222,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)
} }
else if(pData->CmdID == 0x03 ) else if(pData->CmdID == 0x03 )
{ {
//printf("0x03 is get\r\n");
if(Prot_User.State < Prot_Normal) if(Prot_User.State < Prot_Normal)
{ {
Prot_User.State = Prot_Normal; Prot_User.State = Prot_Normal;
...@@ -256,18 +258,19 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData) ...@@ -256,18 +258,19 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)
} }
} }
} }
else if((pData->CmdID & 0x3f) == 0x21 ) else if(pData->CmdID == 0x21 )
{ {
if(Prot_User.State >= Prot_Start) //printf("Wifi_OTA_Request is %d\r\n",Wifi_OTA_Request);
if(pData->Data[0] == 1)
{ {
if((pData->CmdID & 0xC0) == 0X40) // if((pData->CmdID & 0xC0) == 0X40)
{ // {
if(Wifi_OTA_Request == 0) if(Wifi_OTA_Request == 0)
{ {
Wifi_OTA_Request = 1; Wifi_OTA_Request = 1;
printf("get ota req! \r\n"); printf("get ota req! \r\n");
} }
} // }
} }
} }
else else
...@@ -337,6 +340,8 @@ void Uart_Send_Id01_Pro(void) ...@@ -337,6 +340,8 @@ void Uart_Send_Id01_Pro(void)
ID01[3] = Ble_Navi_Data.Navi_Dte[1]; ID01[3] = Ble_Navi_Data.Navi_Dte[1];
ID01[4] = Ble_Navi_Data.Navi_Dte[2]; ID01[4] = Ble_Navi_Data.Navi_Dte[2];
ID01[5] = Ble_Navi_Data.Navi_Dte[3]; ID01[5] = Ble_Navi_Data.Navi_Dte[3];
//printf("转向编码:%d\r\n",Ble_Navi_Data.Navi_Turn);
} }
Protocol_Send(0x01,ID01,6); Protocol_Send(0x01,ID01,6);
} }
...@@ -374,7 +379,7 @@ void Prot_Send_Msg_Process(void ) ...@@ -374,7 +379,7 @@ void Prot_Send_Msg_Process(void )
Uart_Send_Id01_Pro(); Uart_Send_Id01_Pro();
Uart_Send_Id02_Pro(); Uart_Send_Id02_Pro();
Prot_User.TimeDelay = 0; Prot_User.TimeDelay = 0;
// printf("send 0x01 0x02 \r\n"); //printf("send 0x01 0x02 \r\n");
} }
} }
} }
...@@ -1336,16 +1336,15 @@ CONFIG_HEAP_TRACING_OFF=y ...@@ -1336,16 +1336,15 @@ CONFIG_HEAP_TRACING_OFF=y
# #
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
CONFIG_LOG_DEFAULT_LEVEL_WARN=y # CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set CONFIG_LOG_DEFAULT_LEVEL_INFO=y
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
CONFIG_LOG_DEFAULT_LEVEL=2 CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set
# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set # CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
CONFIG_LOG_MAXIMUM_LEVEL=2 CONFIG_LOG_MAXIMUM_LEVEL=3
CONFIG_LOG_COLORS=y CONFIG_LOG_COLORS=y
CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment