/******************************************************************************* * the includes ******************************************************************************/ #include "projcfg.h" /******************************************************************************* * the defines ******************************************************************************/ /******************************************************************************* * the typedefs ******************************************************************************/ typedef struct { uint32_t startflag; uint32_t sBootloader_Req; uint32_t reboot_times; uint32_t hardfault_data; uint32_t reverse[12]; }NO_INIT_DATA_Type; typedef struct { uint32_t startflag; uint32_t reverse1[3]; char app_name[16]; char app_version[16]; char app_builddata[16]; char app_buildtime[16]; }APPINFO_Type; /******************************************************************************* * the globals ******************************************************************************/ /******************************************************************************* * the const ******************************************************************************/ volatile NO_INIT_DATA_Type noInitData __attribute__((section(".boot_flags"))); __attribute__((section(".appinfo_sector"))) const APPINFO_Type appinfo_sector = { .startflag = 0xAA5555AA, .app_name = "LCD_APP_TEST", .app_version = "TEST_01.01.01", .app_builddata = __DATE__, .app_buildtime = __TIME__, }; /******************************************************************************* * the functions ******************************************************************************/ void projcfg_init(void) { if (noInitData.startflag != 0xAA5555AA) { noInitData.startflag = 0xAA5555AA; noInitData.reboot_times = 0; noInitData.hardfault_data = 0; } } void setBootFlag(void) { noInitData.sBootloader_Req = 0x778899AA; } void setHardFaultData(uint32_t data) { noInitData.hardfault_data = data; }