Update freertos.c

master
ThinkPad-T460P 2020-09-03 13:52:02 +08:00
parent 178b3e001f
commit cfab7191b5
1 changed files with 10 additions and 7 deletions

View File

@ -216,11 +216,11 @@ void StartDefaultTask(void *argument)
printf("Copyright (c) Powered by www.autolabor.com.cn\n"); printf("Copyright (c) Powered by www.autolabor.com.cn\n");
osDelay(100); osDelay(100);
printf("BIOS SW Version: V0.9, build: %s, %s\n",__DATE__ ,__TIME__ ); printf("BIOS SW Version: V0.9, build: %s, %s\n",__DATE__ ,__TIME__ );
printf("HAL Version: %d \n", HAL_GetHalVersion()); printf("HAL Version: %lu \n", HAL_GetHalVersion());
printf("Revision ID: %d \n", HAL_GetREVID()); printf("Revision ID: %lu \n", HAL_GetREVID());
printf("Device ID: %d \n", HAL_GetDEVID()); printf("Device ID: %lu \n", HAL_GetDEVID());
osDelay(100); osDelay(100);
printf("Chip UID: %d%d%d \n", HAL_GetUIDw0(),HAL_GetUIDw1(),HAL_GetUIDw2); printf("Chip UID: %lu%lu%lu \n", HAL_GetUIDw0(),HAL_GetUIDw1(),HAL_GetUIDw2);
printf("----------------------------------------------\n"); printf("----------------------------------------------\n");
/* Infinite loop */ /* Infinite loop */
@ -555,8 +555,9 @@ void StartUartQueueTask(void *argument)
osDelay(1); osDelay(1);
count = osMessageQueueGetCount(uartQueueHandle); count = osMessageQueueGetCount(uartQueueHandle);
if(count){ if(count){
for(uint8_t i=0;i<count;i++){ for(uint32_t i=0;i<count;i++){
osMessageQueueGet(uartQueueHandle,&temp[i],0,10); osMessageQueueGet(uartQueueHandle,&temp[i],0,10);
uint32_t space = osMessageQueueGetSpace(uartQueueHandle);
} }
// taskENTER_CRITICAL(); // taskENTER_CRITICAL();
while(HAL_UART_GetState(&huart1) == HAL_UART_STATE_BUSY_TX){} while(HAL_UART_GetState(&huart1) == HAL_UART_STATE_BUSY_TX){}
@ -585,8 +586,10 @@ PUTCHAR_PROTOTYPE
// HAL_UART_Transmit(&huart1,(uint8_t *)&ch,1,0xffff); // HAL_UART_Transmit(&huart1,(uint8_t *)&ch,1,0xffff);
//queue space check before enqueue //queue space check before enqueue
if(osMessageQueueGetSpace(uartQueueHandle)>0){ uint32_t space = osMessageQueueGetSpace(uartQueueHandle);
osMessageQueuePut(uartQueueHandle,(uint8_t*)&ch,0,100); if(space){
osMessageQueuePut(uartQueueHandle,(uint8_t*)&ch,0,10);
space = osMessageQueueGetSpace(uartQueueHandle);
} }
else{ else{
// uint8_t front[1];//trash // uint8_t front[1];//trash