1234567891011121314151617181920212223242526272829303132333435 |
- #include "app_switchimu.h"
- #include "usr_config.h"
- #include "bsp_time.h"
- #include "system.h"
- #include "hal_ble_client.h"
- #include "hal_ble_host.h"
- #include "hal_mt.h"
- #include "nrf_delay.h"
- #include "app_flash.h"
- #include "hal_led.h"
- //½ÓÊÕÊÖ»úÃüÁî
- void cb_BLE_Client_R_SWITCH_IMU(void* handle)
- {
- BLE_Client_Rx_t* target = handle;
- uint8_t cmd = target->pDat[0];
-
- BLE_Host_Tx_Send(0,BLE_SWITCH_IMU,&cmd,1);
- mBackup.RestartCnt =0;
- if(Flash_SaveBackup() != ZONE_OP_SUCCESS)Except_TxError(EXCEPT_Power,"app restart save backup fail");
-
- nrf_delay_ms(500);
- NVIC_SystemReset(); //¸´Î»ÖØÆô
-
- }
- void app_switchimu_Init(void)
- {
- BLE_Client_Rx_Regist(BLE_SWITCH_IMU,cb_BLE_Client_R_SWITCH_IMU);
- }
|