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.

46 lines
1.2 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
  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 struct {
  20. bool poweron;
  21. mode_t mode;
  22. level_t level;
  23. //
  24. active_input_t active_input;
  25. uint32_t active_start_ticket;
  26. int countdonwnum;
  27. int countdonwnum_s;
  28. int countdonw_setting_num;
  29. uint32_t countdonw_start_ticket;
  30. bool intermittentMode_idle;
  31. } ThisDevice_t;
  32. #define kconst_flash_auto_close_time (1500) //按键输入状态有效时间
  33. #define kconst_countdown_step_s (10) //倒计时每按一次按键,倒计时增加时间
  34. #define kconst_active_input_light_flick_interval_ms (150) //按键输入状态闪烁间隔时间
  35. #define INTERMITTENTMODE_PERIOD_S 55 //间歇工作模式的时间间隔,至少大于四倍的kconst_countdown_step_s
  36. #define KEY_PERIOD 20 //
  37. #define EXCEPTION_CHECK_PERIOD 50 //
  38. extern ThisDevice_t thisDevice;