STM32 Systick and Timeout in Interrupt Routines
Setup
HAL_Delay()
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) {
char str[128];
sprintf(str, "current tick: %d\n", HAL_GetTick());
HAL_UART_Transmit(&huart2, (uint8_t *)str, strlen(str), 100);
HAL_Delay(500);
sprintf(str, "after 0.5 s: %d\n", HAL_GetTick());
HAL_UART_Transmit(&huart2, (uint8_t *)str, strlen(str), 100);
}
void APP_init() {
HAL_TIM_Base_Start_IT(&htim1);
}
void APP_main() {
HAL_Delay(100);
}

Peripheral Blocking Mode Function Call

Last updated