1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #include "gd32f10x.h"
- #include "main.h"
- #include "delay.h"
- #include "fmc.h"
- #include "ota_message.h"
- #include "boot.h"
- #include "w25q32.h"
- void task_fwdgt_reload(void);
- OTA_STRUCT UpDataA; //A区更新用到的结构体
- int main(void)
- {
- Delay_Init();
- // W25Q32_Init(); //弃用w25q32改用fmc
- OTA_MESSAGE *ota_data;
- task_fwdgt_reload();
- if(load_ota_message_config_params()==0)
- {
- //ota事件产生了,进入Bootloader分支
- ota_data=get_config_params();
- BootLoader_Brance(ota_data->XmodemByte);
- }
- //没有OTA事件产生跳转A区
- else
- {
- LOAD_A(GD32_A_SADDR);
- }
-
- while(1)
- {
-
-
- }
-
- }
- void task_fwdgt_reload(void)
- {
- /* uncock fwdgt write protect*/
- fwdgt_write_enable();
- /* feed fwdgt */
- fwdgt_counter_reload();
- }
|