|
@@ -116,9 +116,6 @@ static void UartTask(void* arg)
|
|
|
EncryptCount++;
|
|
|
}
|
|
|
PROC_UART_STATE_SWITCH(PROCESS_UART_STATE_IDLE);
|
|
|
- #ifdef USING_PRINTF
|
|
|
- printf("[%d]PROCESS_UART_STATE_ENCRYPT Done\n",__LINE__);
|
|
|
- #endif
|
|
|
break;
|
|
|
}
|
|
|
case PROCESS_UART_STATE_IDLE:
|
|
@@ -130,7 +127,7 @@ static void UartTask(void* arg)
|
|
|
}
|
|
|
else if(Timer_count%10==0)
|
|
|
{
|
|
|
- #ifdef USING_PRINTF1
|
|
|
+ #ifdef USING_PRINTF
|
|
|
printf("[%d]Uart Timer 5s:%d\n",__LINE__,Timer_count);
|
|
|
#endif
|
|
|
if(osMessageQueueGet(UartWriteCmdHandle,&UartWriteData,0,0)==osOK)
|
|
@@ -211,6 +208,14 @@ static void UartTask(void* arg)
|
|
|
{
|
|
|
BattChrgEndFlag=FALSE;
|
|
|
}
|
|
|
+ #ifdef USING_PRINTF1
|
|
|
+ printf("\nUart_Recv_buffer: ");
|
|
|
+ for(int i=0;i<Uart_Recv_LEN;i++)
|
|
|
+ {
|
|
|
+ printf("%x ",*((UINT8 *)&UartReadMsg.Header+i));
|
|
|
+ }
|
|
|
+ printf("\n");
|
|
|
+ #endif
|
|
|
osMutexRelease(UartMutex);
|
|
|
break;
|
|
|
}
|
|
@@ -383,14 +388,14 @@ UINT8 Uart_Transmit_func(UINT8* Uart_Read_Msg,UINT8* Uart_Recv_Buffer)
|
|
|
*(Uart_Read_Msg+6) = CRC_chk_buffer;
|
|
|
*(Uart_Read_Msg+7) = CRC_chk_buffer>>8;
|
|
|
USARTdrv->Send(Uart_Read_Msg,8);
|
|
|
- // #ifdef USING_PRINTF
|
|
|
- // printf("Uart_Send_buffer: ");
|
|
|
- // for(int i=0;i<8;i++)
|
|
|
- // {
|
|
|
- // printf("%x ",*(Uart_Read_Msg+i));
|
|
|
- // }
|
|
|
- // printf("\n");
|
|
|
- // #endif
|
|
|
+ #ifdef USING_PRINTF
|
|
|
+ printf("Uart_Send_buffer: ");
|
|
|
+ for(int i=0;i<8;i++)
|
|
|
+ {
|
|
|
+ printf("%x ",*(Uart_Read_Msg+i));
|
|
|
+ }
|
|
|
+ printf("\n");
|
|
|
+ #endif
|
|
|
USARTdrv->Receive(Uart_Recv_Buffer,Data_Len);
|
|
|
while((isRecvTimeout == false) && (isRecvComplete == false))
|
|
|
{
|
|
@@ -403,13 +408,13 @@ UINT8 Uart_Transmit_func(UINT8* Uart_Read_Msg,UINT8* Uart_Recv_Buffer)
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- // #ifdef USING_PRINTF
|
|
|
- // printf("Uart_Rece_buffer1: ");
|
|
|
- // for(int i=0;i<Data_Len;i++)
|
|
|
- // {
|
|
|
- // printf("%x ",*(Uart_Recv_Buffer+i));
|
|
|
- // }
|
|
|
- // #endif
|
|
|
+ #ifdef USING_PRINTF
|
|
|
+ printf("Uart_Rece_buffer: ");
|
|
|
+ for(int i=0;i<Data_Len;i++)
|
|
|
+ {
|
|
|
+ printf("%x ",*(Uart_Recv_Buffer+i));
|
|
|
+ }
|
|
|
+ #endif
|
|
|
if (isRecvComplete == true)
|
|
|
{
|
|
|
isRecvComplete = false;
|