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.

54 lines
1.7 KiB

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. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. typedef enum {
  5. klevel1 = 0,
  6. klevel2,
  7. } level_t;
  8. typedef enum {
  9. knormal,
  10. ktimingMode,
  11. kintermittentMode,
  12. } mode_t;
  13. typedef enum {
  14. knone_active,
  15. kchange_level_input,
  16. kchange_countdonw_time_input,
  17. kchange_intermittentmode_time_input,
  18. } active_input_t;
  19. typedef enum {
  20. knoneException,
  21. kOzonePrimaryCircuitAnomaly, //臭氧一级回路异常,MOS断路,或者变压器断路,如果MOS短路,设备会直接无法启动
  22. kOzoneSecondaryCircuitAnomaly, //臭氧二级回路异常,臭氧发生棒无法击穿产生臭氧,可能是焊接问题,或者接触不良
  23. kfanIsBroken, //风扇故障
  24. } error_t;
  25. typedef struct {
  26. bool poweron;
  27. mode_t mode;
  28. level_t level;
  29. active_input_t active_input; //由human_computer_interaction_service维护
  30. uint32_t active_start_ticket; //由human_computer_interaction_service维护
  31. int countdonwnum;
  32. int countdonwnum_s;
  33. int countdonw_setting_num;
  34. uint32_t countdonw_start_ticket;
  35. // bool intermittentMode_idle;
  36. bool working;
  37. } ThisDevice_t;
  38. #define kconst_flash_auto_close_time (1500) //按键输入状态有效时间
  39. #define kconst_countdown_step_s (10) //倒计时每按一次按键,倒计时增加时间
  40. #define kconst_active_input_light_flick_interval_ms (150) //按键输入状态闪烁间隔时间
  41. #define INTERMITTENTMODE_PERIOD_S 55 //间歇工作模式的时间间隔,至少大于四倍的kconst_countdown_step_s
  42. #define KEY_PERIOD 20 //
  43. #define EXCEPTION_CHECK_PERIOD 50 //
  44. extern ThisDevice_t thisDevice;