You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
793 B

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. #include "key.h"
  2. static T_key_structer_t *T_key_structer_s;
  3. static key_cb callback_s;
  4. void T_key_init(T_key_structer_t *T_key_structer)
  5. {
  6. T_key_structer_s = T_key_structer;
  7. }
  8. void T_key_registered_cb(key_cb cb)
  9. {
  10. callback_s = cb;
  11. }
  12. void T_key_on_event(void)
  13. {
  14. }
  15. void T_key_schedule(void)
  16. {
  17. T_key_structer_s->key_now_state = T_key_get_level();
  18. if ((T_key_structer_s->key_before_state != T_key_structer_s->key_now_state) && (T_key_structer_s->key_now_state == true))
  19. {
  20. if (callback_s())
  21. {
  22. /* 有反应板的处理 */
  23. }
  24. else
  25. {
  26. /* 没有反应板的处理(加热) */
  27. }
  28. }
  29. T_key_structer_s->key_before_state = T_key_structer_s->key_now_state;
  30. }
  31. bool T_key_get_level(void)
  32. {
  33. return false;
  34. }