void StartLedTask(void const * argument)
{
/* USER CODE BEGIN StartLedTask */
/* Infinite loop */
uint16_t cnt;
osEvent evt;
ledTypeDef *pLed;
for(;;)
{
osDelay(1);
evt = osMessageGet(ledQueueHandle,osWaitForever);
if(evt.status == osEventMessage)
{
pLed = (ledTypeDef *)(evt.value.p);/*将空指针转换为LED结构体指针*/
for(cnt=0;cnt<pLed->cnt;cnt++)
{
HAL_GPIO_TogglePin(LED_SYS_GPIO_Port,LED_SYS_Pin);
osDelay(pLed->time);
}
}
}
/* USER CODE END StartLedTask */
}
|