From cfab7191b589f52c7bc86d94db061a1bba4ec676 Mon Sep 17 00:00:00 2001 From: ThinkPad-T460P Date: Thu, 3 Sep 2020 13:52:02 +0800 Subject: [PATCH] Update freertos.c --- Core/Src/freertos.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Core/Src/freertos.c b/Core/Src/freertos.c index afb4615..c94d08d 100644 --- a/Core/Src/freertos.c +++ b/Core/Src/freertos.c @@ -216,11 +216,11 @@ void StartDefaultTask(void *argument) printf("Copyright (c) Powered by www.autolabor.com.cn\n"); osDelay(100); printf("BIOS SW Version: V0.9, build: %s, %s\n",__DATE__ ,__TIME__ ); - printf("HAL Version: %d \n", HAL_GetHalVersion()); - printf("Revision ID: %d \n", HAL_GetREVID()); - printf("Device ID: %d \n", HAL_GetDEVID()); + printf("HAL Version: %lu \n", HAL_GetHalVersion()); + printf("Revision ID: %lu \n", HAL_GetREVID()); + printf("Device ID: %lu \n", HAL_GetDEVID()); 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"); /* Infinite loop */ @@ -555,8 +555,9 @@ void StartUartQueueTask(void *argument) osDelay(1); count = osMessageQueueGetCount(uartQueueHandle); if(count){ - for(uint8_t i=0;i0){ - osMessageQueuePut(uartQueueHandle,(uint8_t*)&ch,0,100); + uint32_t space = osMessageQueueGetSpace(uartQueueHandle); + if(space){ + osMessageQueuePut(uartQueueHandle,(uint8_t*)&ch,0,10); + space = osMessageQueueGetSpace(uartQueueHandle); } else{ // uint8_t front[1];//trash