app_switchimu.c 683 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "app_switchimu.h"
  2. #include "usr_config.h"
  3. #include "bsp_time.h"
  4. #include "system.h"
  5. #include "hal_ble_client.h"
  6. #include "hal_ble_host.h"
  7. #include "hal_mt.h"
  8. #include "nrf_delay.h"
  9. static uint8_t switch_front_or_center_lsm = USED_FRONT_LSM;
  10. uint8_t app_switchimu_GetGameModeLsm(void)
  11. {
  12. return switch_front_or_center_lsm;
  13. }
  14. //½ÓÊÕÊÖ»úÃüÁî
  15. void cb_BLE_Client_R_SWITCH_IMU(void* handle)
  16. {
  17. BLE_Client_Rx_t* target = handle;
  18. uint8_t cmd = target->pDat[0];
  19. BLE_Host_Tx_Send(0,BLE_SWITCH_IMU,&cmd,1);
  20. nrf_delay_ms(500);
  21. NVIC_SystemReset(); //¸´Î»ÖØÆô
  22. }
  23. void app_switchimu_Init(void)
  24. {
  25. BLE_Client_Rx_Regist(BLE_SWITCH_IMU,cb_BLE_Client_R_SWITCH_IMU);
  26. }