123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #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];
-
- switch(cmd)
- {
- case 0:
- switch_front_or_center_lsm = USED_FRONT_LSM;
- MT_Run(1000);
- break;
-
- case 1:
- switch_front_or_center_lsm = USED_CENTER_LSM;
- MT_Run(1000);
- break;
- }
-
- BLE_Host_Tx_Send(0,BLE_SWITCH_IMU,&cmd,1);
- }
- void app_switchimu_Init(void)
- {
- BLE_Client_Rx_Regist(BLE_SWITCH_IMU,cb_BLE_Client_R_SWITCH_IMU);
- }
|