12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #include "CommandsDefine.h"
- #include "delay.h"
- //#include "AnalogChannelCtrl.h"
- #include "usart.h"
- #include "timer.h"
- #include "iwdg.h"
- #include "iap.h"
- #include "stmflash.h"
- #define RUNNING_WHERE_AT_BOOT 1
- //#include "Probe.h"
- const VersionInfo OurVersionInfo /*__attribute__((at(BOOT_VERSION_FLASH_ADDR_BASE)))*/=
- {
- 0,//Version_MainNo
- 10,//Version_SubNo
- 8,//Version_ModifyNo
- 0,//Version_Revision_Number
- "20240712100925",//Version_Date
- "zhaoyong",//Version_ModifierName 16byte
- "Boot",//Version_ModelName 32byte
- "AtBoot.new UpdateSend.can read ver from app"//Version_Comment 64byte
- };
- VersionInfo* GetVersion()
- {
- return (VersionInfo*)(&OurVersionInfo);
- }
- void MainInit()
- {
- NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//设置系统中断优先级分组2
- delay_init(168); //初始化延时函数
- uart_init(115200); //初始化串口6波特率为115200
- sysIsReady =1;
- //u32 tt = USART_REC_LEN;
- //tt = tt + 1;
- //启动检测
- if(iap_check_appstate()==1)
- {
- //跳转APP1
- if(((*(vu32*)(FLASH_ADDR_APP+4))&0xFF000000)==0x08000000)// 0X08XXXXXX.
- //if(((*(vu32*)(FLASH_APP1_ADDR))&0x2FFE0000)==0x200A0000)//判断
- {
- //USART_Cmd(USART6, DISABLE);
- //iap_set_run_count();
- iap_load_app(FLASH_ADDR_APP);//执行FLASH APP代码
- }
- else
- {
- }
- }
- }
|