func.h 994 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _FUNC_H
  2. #define _FUNC_H
  3. #include "func_bt.h"
  4. #include "func_bt_hid.h"
  5. #include "func_lowpwr.h"
  6. #include "func_aux.h"
  7. #include "func_speaker.h"
  8. //task number
  9. enum {
  10. FUNC_NULL = 0,
  11. FUNC_BT,
  12. FUNC_BTHID,
  13. FUNC_AUX,
  14. FUNC_PWROFF,
  15. FUNC_SLEEPMODE,
  16. FUNC_BT_DUT, //DUT测试模式
  17. FUNC_SPEAKER,
  18. FUNC_BT_FCC,
  19. };
  20. //task control block
  21. typedef struct {
  22. u8 sta; //cur working task number
  23. u8 last; //lask task number
  24. void (*set_vol_callback)(u8 dir); //设置音量的回调函数,用于各任务的音量事件处理。
  25. } func_cb_t;
  26. extern func_cb_t func_cb;
  27. extern const u8 func_sort_table[]; //任务切换排序table
  28. u8 get_funcs_total(void);
  29. void func_process(void);
  30. void func_message(u16 msg);
  31. void func_run(void);
  32. void func_music(void);
  33. void func_bt(void);
  34. void func_bthid(void);
  35. void func_aux(void);
  36. #endif // _FUNC_H