func_le_bqb_rf.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #include "include.h"
  2. #include "func.h"
  3. #if FUNC_LE_BQB_RF_EN
  4. AT(.text.func.le_bqb_rf)
  5. void func_le_bqb_rf_sub_process(void)
  6. {
  7. // le_bqb_rf_app_proc();
  8. }
  9. AT(.text.func.le_bqb_rf)
  10. void func_le_bqb_rf_process(void)
  11. {
  12. func_process();
  13. func_le_bqb_rf_sub_process();
  14. #if SYS_OFF_TIME
  15. if(sys_cb.pwroff_delay == 0) {
  16. func_cb.sta = FUNC_PWROFF;
  17. return;
  18. }
  19. #endif
  20. #if SYS_SLEEP_LEVEL
  21. if(sleep_process(bt_is_sleep)) {
  22. }
  23. #endif
  24. }
  25. AT(.text.func.le_bqb_rf)
  26. void func_le_bqb_rf_init(void)
  27. {
  28. bsp_ble_init();
  29. }
  30. AT(.text.func.le_bqb_rf)
  31. void func_le_bqb_rf_enter(void)
  32. {
  33. msg_queue_clear();
  34. lowpwr_pwroff_auto_dis();
  35. ble_set_work_mode(MODE_BQB_RF_BLE);
  36. func_le_bqb_rf_init();
  37. }
  38. AT(.text.func.le_bqb_rf)
  39. void func_le_bqb_rf_exit(void)
  40. {
  41. bt_off();
  42. lowpwr_pwroff_auto_en();
  43. ble_set_work_mode(MODE_NORMAL);
  44. func_cb.last = FUNC_LE_BQB_RF;
  45. }
  46. AT(.text.func.le_bqb_rf)
  47. void func_le_bqb_rf(void)
  48. {
  49. printf("%s\n", __func__);
  50. func_le_bqb_rf_enter();
  51. while (func_cb.sta == FUNC_LE_BQB_RF) {
  52. func_le_bqb_rf_process();
  53. func_le_bqb_rf_message(msg_dequeue());
  54. }
  55. func_le_bqb_rf_exit();
  56. }
  57. #endif //FUNC_LE_BQB_RF_EN