#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" 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(); //复位重启 } void app_switchimu_Init(void) { BLE_Client_Rx_Regist(BLE_SWITCH_IMU,cb_BLE_Client_R_SWITCH_IMU); }