func_idle.c 744 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "include.h"
  2. #include "func.h"
  3. #include "func_idle.h"
  4. #if FUNC_IDLE_EN
  5. AT(.text.func.idle)
  6. void func_idle_process(void)
  7. {
  8. func_process();
  9. }
  10. static void func_idle_enter(void)
  11. {
  12. #if PLUGIN_FUNC_IDLE_ENTER_CHECK
  13. if (!plugin_func_idle_enter_check()) { //可以处理开机, 判断是否要停在idle模式, 等待设备插入的方案.
  14. return;
  15. }
  16. #endif
  17. led_idle();
  18. }
  19. static void func_idle_exit(void)
  20. {
  21. func_cb.last = FUNC_IDLE;
  22. }
  23. AT(.text.func.idle)
  24. void func_idle(void)
  25. {
  26. printf("%s\n", __func__);
  27. func_idle_enter();
  28. while (func_cb.sta == FUNC_IDLE) {
  29. func_idle_process();
  30. func_idle_message(msg_dequeue());
  31. func_idle_display();
  32. }
  33. func_idle_exit();
  34. }
  35. #endif