app_safe.c 666 B

1234567891011121314151617181920212223242526272829303132333435
  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. if(mFlash.RestartCnt > 1){
  12. char buff[40]={0};
  13. memset(buff,0,sizeof(buff));
  14. if(mFlash.isHost){
  15. sprintf(buff,"left shoes restart:%d",mFlash.RestartCnt);
  16. }else{
  17. sprintf(buff,"right shoes restart:%d",mFlash.RestartCnt);
  18. }
  19. Except_TxError(EXCEPT_Power,(const char*)buff);
  20. }
  21. }
  22. void app_safe_Init(void)
  23. {
  24. mFlash.RestartCnt++;
  25. Process_Start(10000,"app_safe_Process",app_safe_Process);
  26. }