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.
47 lines
1.2 KiB
47 lines
1.2 KiB
#pragma once
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
typedef enum {
|
|
klevel1 = 0,
|
|
klevel2,
|
|
} level_t;
|
|
|
|
typedef enum {
|
|
knormal,
|
|
ktimingMode,
|
|
kintermittentMode,
|
|
} mode_t;
|
|
|
|
typedef enum {
|
|
knone_active,
|
|
kchange_level_input,
|
|
kchange_countdonw_time_input,
|
|
kchange_intermittentmode_time_input,
|
|
} active_input_t;
|
|
|
|
typedef struct {
|
|
bool poweron;
|
|
mode_t mode;
|
|
level_t level;
|
|
//
|
|
active_input_t active_input;
|
|
uint32_t active_start_ticket;
|
|
|
|
int countdonwnum;
|
|
int countdonwnum_s;
|
|
|
|
int countdonw_setting_num;
|
|
uint32_t countdonw_start_ticket;
|
|
|
|
bool intermittentMode_idle;
|
|
|
|
} ThisDevice_t;
|
|
|
|
#define kconst_flash_auto_close_time (1500) //按键输入状态有效时间
|
|
#define kconst_countdown_step_s (10) //倒计时每按一次按键,倒计时增加时间
|
|
#define kconst_active_input_light_flick_interval_ms (150) //按键输入状态闪烁间隔时间
|
|
#define INTERMITTENTMODE_PERIOD_S 55 //间歇工作模式的时间间隔,至少大于四倍的kconst_countdown_step_s
|
|
#define KEY_PERIOD 20 //
|
|
#define EXCEPTION_CHECK_PERIOD 50 //
|
|
|
|
extern ThisDevice_t thisDevice;
|