123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #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"
- static uint8_t switch_front_or_center_lsm = USED_FRONT_LSM;
- uint8_t app_switchimu_GetGameModeLsm(void)
- {
- return switch_front_or_center_lsm;
- }
- //½ÓÊÕÊÖ»úÃüÁî
- 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);
-
- nrf_delay_ms(500);
-
- NVIC_SystemReset(); //¸´Î»ÖØÆô
-
- mBackup.RestartCnt =0;
- if(Flash_SaveBackup() != ZONE_OP_SUCCESS)Except_TxError(EXCEPT_Power,"app restart save backup fail");
- }
- void app_switchimu_Init(void)
- {
- BLE_Client_Rx_Regist(BLE_SWITCH_IMU,cb_BLE_Client_R_SWITCH_IMU);
- }
|