12345678910111213141516171819202122232425262728293031 |
- #ifndef __POWEROFF_SAVE_APP_H__
- #define __POWEROFF_SAVE_APP_H__
- //掉电保存地址
- #define POWEROFF_SAVE_ADDRESS ST_FLASH_SECTOR_2
- //掉电备份地址
- #define POWEROFF_BACKUP_ADDRESS ST_FLASH_SECTOR_3
- //掉电保存数据大小,由于取的是区域的大小,因此需要保证区域大小
- #define POWEROFF_SAVE_BLOCK_SIZE (1024* 1)
- //掉电保存区域大小
- #define POWEROFF_SAVE_SECTOR_SIZE (14 * 1024)
- //手动保存地址
- #define MANUAL_SAVE_ADDRESS (POWEROFF_SAVE_ADDRESS + POWEROFF_SAVE_SECTOR_SIZE)
- //手动保存大小
- #define MANUAL_SAVE_BLOCK_SIZE (1024 * 2)
- //掉电检测功能延时启动时间(秒)
- #define POWER_OFF_FUNCTION_DELAY 2
- //掉电检测功能执行间隔(us)
- #define POWER_OFF_SAMPLE_TIME 1000
- //掉电检测确定计数
- #define POWER_OFF_SAMPLE_COUNT 5
- #define POWER_ON_SAMPLE_COUNT 200
- void poweroff_app_init(void);
- void poweroff_app_run(void);
- void app_save_parameter(void);
- #endif
|