#include "radio-controller.h" #include "stm32f1xx_hal.h" #include #include "mcu/arm/semihosting.h" #ifdef HAL_IWDG_MODULE_ENABLED extern IWDG_HandleTypeDef hiwdg; #endif extern TIM_HandleTypeDef htim1; void main_pre_init() { } void main_post_init() { semihosting::enable(); HAL_TIM_Base_Start(&htim1); } static uint32_t tick_next = 0; void main_loop() { // printf("hello world!"); auto now = HAL_GetTick(); if (now >= tick_next) { uint32_t cnt = __HAL_TIM_GET_COUNTER(&htim1); printf("cnt=%lu, now=%lu\n", cnt, now); tick_next += 1000; } #ifdef HAL_IWDG_MODULE_ENABLED HAL_IWDG_Refresh(&hiwdg); #endif } void it_tim1() { ; }