123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- /*********************************************************************
- * INCLUDES
- */
- #include "ble_comm.h"
- #include "app_flash.h"
- #include "hal_ble_client.h"
- #include "app_safe.h"
- #include "app_flash.h"
- static void app_safe_Process(void)
- {
- static uint8_t cnt =0;
- if(mBackup.ErrStartCnt >0){
- cnt++;
- if(cnt >=6){//Ò»·ÖÖÓºóÇå¿Õ±ê־λ
- mBackup.ErrStartCnt =0;
- if(Flash_SaveBackup() != ZONE_OP_SUCCESS)Except_TxError(EXCEPT_Power,"save ErrStartCnt fail");
- DEBUG_LOG("clear mBackup.ErrorStartFlag\n");
- }
- }
-
- if(mBackup.RestartCnt > 1){
- char buff[40]={0};
- memset(buff,0,sizeof(buff));
- if(mFlash.isHost){
- sprintf(buff,"left shoes restart:%d",mBackup.RestartCnt);
- }else{
- sprintf(buff,"right shoes restart:%d",mBackup.RestartCnt);
- }
- Except_TxError(EXCEPT_Power,(const char*)buff);
- }
- }
- void app_safe_Init(void)
- {
- mBackup.RestartCnt++;
- Process_Start(10000,"app_safe_Process",app_safe_Process);
- }
-
|