app_safe.c 571 B

123456789101112131415161718192021222324252627282930313233
  1. /*********************************************************************
  2. * INCLUDES
  3. */
  4. #include "ble_comm.h"
  5. #include "app_flash.h"
  6. #include "hal_ble_client.h"
  7. #include "app_safe.h"
  8. #include "app_flash.h"
  9. static void app_safe_Process(void)
  10. {
  11. static uint8_t cnt =0;
  12. if(mBackup.ErrorStartFlag >0){
  13. cnt++;
  14. if(cnt >=6){//一分钟后清空标志位
  15. mBackup.ErrorStartFlag =0;
  16. Flash_SaveBackup();
  17. SEGGER_RTT_printf(0,"clear mBackup.ErrorStartFlag\n");
  18. }
  19. }
  20. }
  21. void app_safe_Init(void)
  22. {
  23. Process_Start(10000,"app_safe_Process",app_safe_Process);
  24. }