| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 | #include "at32f403a_407.h"#include "update.h"#include "common_config.h"#include "FreeRTOS.h"#include "task.h"#include "fr_timers.h"#include <stdio.h>#define RESET_TIM_DELAY     configTICK_RATE_HZ*3 TimerHandle_t reset_timer_handle;void cb_reset_timer(TimerHandle_t timer);//void update_create_timer(void){    reset_timer_handle = xTimerCreate("reset_timer", RESET_TIM_DELAY,                                       pdFALSE, (void *)0, cb_reset_timer);}//void update_tim_start(void){    xTimerStart(reset_timer_handle, 0); }//void update_set_flag(uint16_t val){    bpr_data_write(BPR_DATA1, val);}//void update_reset_boot_try(void){    bpr_data_write(BPR_DATA2, 0);}//void cb_reset_timer(TimerHandle_t timer){    DBG printf("Reset timer callback. Switch to IAP\r\n");    update_set_flag(1);    NVIC_SystemReset();    }
 |