|
@@ -483,7 +483,7 @@ static void Uart_Task(void* arg)
|
|
#ifdef USING_PRINTF
|
|
#ifdef USING_PRINTF
|
|
printf("UART_STATE_WORK!\n");
|
|
printf("UART_STATE_WORK!\n");
|
|
#endif
|
|
#endif
|
|
- Uart_func();//读取函数运行
|
|
|
|
|
|
+ //Uart_func();//读取函数运行
|
|
PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_IDLE);
|
|
PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_IDLE);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -507,10 +507,47 @@ static void Uart_Task(void* arg)
|
|
static void Fota_Task(void* arg)
|
|
static void Fota_Task(void* arg)
|
|
{
|
|
{
|
|
Fota_Stuct.Fota_Data_Len=100;
|
|
Fota_Stuct.Fota_Data_Len=100;
|
|
|
|
+ uint8_t Uart_Send_buffer[6];
|
|
|
|
+ uint8_t Uart_Rece_buffer[110];
|
|
|
|
+ uint32_t file_address = 0x00000000;
|
|
|
|
+ uint8_t Uart_Send_buffer = {0x00,0x00,0x00,0x00,0x64,0x01};
|
|
|
|
+ uint32_t timeout = 0x00000000;
|
|
while (true)
|
|
while (true)
|
|
{
|
|
{
|
|
osDelay(1000);
|
|
osDelay(1000);
|
|
- }
|
|
|
|
|
|
+ USARTdrv->Send(Uart_Send_buffer,6);
|
|
|
|
+ USARTdrv->Receive(Uart_Rece_buffer,110);
|
|
|
|
+ while((isRecvTimeout == false) && (isRecvComplete == false))
|
|
|
|
+ {
|
|
|
|
+ timeout++;
|
|
|
|
+ osDelay(100);
|
|
|
|
+ if (timeout>=10)
|
|
|
|
+ {
|
|
|
|
+ timeout =0;
|
|
|
|
+ isRecvTimeout = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (isRecvComplete == true)
|
|
|
|
+ {
|
|
|
|
+ isRecvComplete == false;
|
|
|
|
+ file_address = file_address + 0x64;
|
|
|
|
+ Uart_Send_buffer[0] = file_address>>24;
|
|
|
|
+ Uart_Send_buffer[1] = file_address>>16;
|
|
|
|
+ Uart_Send_buffer[2] = file_address>>8;
|
|
|
|
+ Uart_Send_buffer[3] = file_address;
|
|
|
|
+ #ifdef USING_PRINTF
|
|
|
|
+ printf("Uart_Send_buffer:");
|
|
|
|
+ for(int i=0;i++;i<110)
|
|
|
|
+ printf("%x",Uart_Send_buffer[i]);
|
|
|
|
+ printf("\n");
|
|
|
|
+ #endif
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ isRecvTimeout == false;
|
|
|
|
+ memset(Uart_Rece_buffer,0,110);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
//Uart线程初始化
|
|
//Uart线程初始化
|
|
void Uart_Task_Init()
|
|
void Uart_Task_Init()
|