From e5675efb6d688466cd045d861b63a4bf38d7119f Mon Sep 17 00:00:00 2001 From: ThinkPad Date: Mon, 27 Apr 2020 17:07:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=85=B3=E6=9C=BA=E5=8F=8Aled?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/Src/freertos.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Core/Src/freertos.c b/Core/Src/freertos.c index 529ab75..6844c54 100644 --- a/Core/Src/freertos.c +++ b/Core/Src/freertos.c @@ -179,9 +179,25 @@ void StartLedBlinkTask(void *argument) /* Infinite loop */ for(;;) { - HAL_GPIO_TogglePin(LED_RUN_GPIO_Port,LED_RUN_Pin); -// printf("1\n"); - osDelay(500); + if(NaviKit.system_runing == true) + {//整板开机状态 + HAL_GPIO_TogglePin(LED_RUN_GPIO_Port,LED_RUN_Pin); + osDelay(100); + } + else + {//整板关机状态 + if(HAL_GPIO_ReadPin(LED_RUN_GPIO_Port,LED_RUN_Pin) == GPIO_PIN_SET) + {//LED处于熄灭状态 + HAL_GPIO_WritePin(LED_RUN_GPIO_Port,LED_RUN_Pin,GPIO_PIN_RESET); + } + else + {//LED处于点亮状态 + HAL_GPIO_WritePin(LED_RUN_GPIO_Port,LED_RUN_Pin,GPIO_PIN_SET); + osDelay(2000); + } + + } + osDelay(50); } /* USER CODE END StartLedBlinkTask */ }