2019-06-05 09:39 PM
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
/* USER CODE BEGIN Callback 0 */
if (htim->Instance == TIM1) {
osSignalSet(defaultTaskHandle, 0x0001);
}
/* USER CODE END Callback 0 */
if (htim->Instance == TIM4) {
HAL_IncTick();
}
/* USER CODE BEGIN Callback 1 */
void StartDefaultTask(void const * argument)
{
/* USER CODE BEGIN StartDefaultTask */
/* Infinite loop */
for(;;)
{
osSignalWait(0x0001, osWaitForever);
HAL_GPIO_TogglePin(GPIOA, USERLED2_Pin);
}
/* USER CODE END StartDefaultTask */
}
I tracked the code and found that entering the HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) function could not send a notification signal, I don't know why. If you switch to the GPIO interrupt callback function, it works fine.
/* USER CODE END Callback 1 */
}
2019-06-05 11:19 PM
Check the defaultTaskHandle handle value in non-working case with debugger and/or some test code.