typedef struct
{
unsigned char s_neixunhuan; // 1:串口发送开启内循环指令
unsigned char s_waixunhuan; // 串口发送开启外循环
unsigned char s_hunfeng; // 串口发送开启混风
//当前的模式
unsigned char no_dianji_flag; //如果本身是混风\内循环模式切换,步进电机状态是一样的不需要变化
unsigned char paifeng_change; //混风、内循环模式下,排风风机档 锁死为1档位,1:保持1档位,0:可更改档位
unsigned char curr_xunhuan;
unsigned char pre_dangwei;
unsigned char curr_dangwei;
unsigned char s_dangwei; //自动控制送风和排风档位
unsigned char bar_songfeng; //串口发送命令的标志
unsigned char bar_huifeng;
unsigned char fulizi_kai; //串口发送标志
unsigned char fulizi_guan; //串口发送标志
unsigned char chushi_kai; //除湿按钮打开的标志,1:打开,0:关闭
unsigned char chushi_kai_start; //1:除湿允许开始计时
unsigned int chushi_kai_time; //除湿按钮打开,开始计时,3分钟后以设定值+阀值为准
unsigned int chushi_kai_3min; //1:除湿按钮已打开3分钟,0:未满3分钟
unsigned char yasuoji_status_hope; //压缩机状态标志,1:允许开,0:关
unsigned char yasuoji_status_real; //压缩机状态标志,1:实际开,0:关,防止3分钟没到状态变化了
unsigned char yasuoji_open_first; //压缩机第一次开,0:可以马上开,1:必须满3分钟才能开
unsigned char yasuoji_close_start; //1:开始压缩机关闭计时,满3分钟置位yasuoji_close_3min
unsigned int yasuoji_close_time; //压缩机关闭计时
unsigned int yasuoji_close_3min; //1:压缩机关闭已满3分钟,0:未满3分钟
unsigned int yasuoji_open_time; //压缩机开启计时
unsigned int yasuoji_open_3min; //1:压缩机开启已满3分钟,0:未满3分钟
unsigned char yasuoji_open_send; //串口发打开压缩机指令
unsigned char yasuoji_close_send; //串口发关闭压缩机指令
unsigned int tempr_time; //排气温度>80,计时
unsigned char chushi_switch1; //感应开关1号
unsigned char shuibeng_send; //串口发送启动水泵命令, 1:启动命令,2:关闭命令
unsigned char shuibeng_open_start; //1:水泵开始计时,一直开3分钟后则关闭, 0:水泵关闭,停止计时
unsigned int shuibeng_time; //水泵打开计时
unsigned int shuibeng_open_3min; //1:水泵打开已满3分钟,0:未满3分钟,开机执行一次
unsigned char shuibeng_prestatus; //水泵状态,1开启,0:关闭,开启后,再来不会重复开启
unsigned char shuibeng_aftstatus;
unsigned char chushi_switch2; //感应开关2号
unsigned char switch2_off; //1:感应开关2号断开
unsigned int swtich2_off_time; //2号断开计时
unsigned char chushi_switch3; //感应开关3号
unsigned char switch3_off; //1:感应开关3号断开
unsigned int swtich3_off_time; //3号断开计时
unsigned char switch_wrong_count; //高低压超过3次,系统不可自动恢复正常
unsigned char sys_wrong; //1:系统异常
unsigned char fengfa_kai; //风阀开
unsigned char fengfa_guan; //风阀关
unsigned char fengfa_index; //风阀几
unsigned char fengfa_dangwei; //风阀档位
unsigned char lvwang_time; //滤网485发送标志
unsigned char bar_lvwang; //滤网时间
unsigned char power_close; //串口发送总电源开关的标志
unsigned char power_open;
unsigned char fengji_open; //1:发送打开风机
unsigned char fengji_close; //1:发送关闭风机
unsigned char sleep_mode_flag; //1:点睡眠, 0:点其他
unsigned int sleep_mode_time; //关机计时
unsigned char hope_store_flag; //1:10s后需保存数据
unsigned int store_time; //计时10s
}Sys_Run;
//主控板返回的值
typedef struct
{
unsigned short pm25;
unsigned short tempr;
unsigned short humity;
unsigned short hcho;
unsigned short co2;
unsigned short sf_dangwei; //送风档位
unsigned short hf_dangwei; //回风档位
unsigned short paiqi_t; //排气温度
// unsigned char humi_set; //湿度设定
// unsigned char humi_hold; //湿度阈值
}Sys_Value;
//数据发生变化,开始保存数据计时
#define START_STORE_TIME() sys_info.hope_store_flag = 1;\
sys_info.store_time = 0;
//需要掉电保存存储的数据
typedef struct
{
unsigned char store_flag; //0x55:存储过数据
unsigned char mode_flag; //1手动,2自动,3睡眠
unsigned char pre_xunhuan; //当前循环状态,1:内循环,2:外循环,3:混风
unsigned char flz_button; //负离子开关按钮
unsigned char js_button; //加湿按钮
unsigned char cs_button; //除湿按钮
unsigned char sf_dangwei; //送风机档位
unsigned char hf_dangwei; //回风机档位
unsigned char power_flag; //点关机的标志 ,0:开机,1:关机
unsigned char flz_ws; //设置界面负离子开关
unsigned char js_ws; //设置界面加湿开关
unsigned char cs_ws; //设置界面除湿开关
unsigned char fq_ws; //分区控制,1:显示,0:不显示
unsigned char nxh_ws; //内循环开关按钮
unsigned char hf_ws; //混风开关按钮
unsigned char wind; //设置3挡/6挡; 1:6挡,0:3挡
unsigned char motor; //0:单风机;1:双风机
}System_StoreData;
extern Sys_Value sys_value;
extern Sys_Run sys_info;
extern System_StoreData store_data;
extern unsigned char tty_send_end;
extern unsigned char fengfa_addr;
extern unsigned char xinfengji_addr;
extern void send_modbus_data(unsigned char address, unsigned char cmd, unsigned short reg, unsigned short data);
#define SEND_TO_TTY(address, cmd, reg, data) \
while(1){ \
if(tty_send_end == 0){ \
send_modbus_data(address, cmd, reg, data); \
vTaskDelay(200 / portTICK_PERIOD_MS); \
break; \
} \
}
typedef struct {
int x;
int y;
} pos_t;
typedef struct {
char name[10];
int slider_value;
bool switch_status;
int id;
pos_t pos;
} fengfa_attr_t;
typedef struct
{
bool ws_fulizhi_flag ;
bool ws_jiashi_flag ;
bool ws_chushi_flag ;
bool ws_hunfeng_flag ;
bool ws_neixunhuan_flag ;
bool ws_fengqu_flag;
bool wind_level_flag ; //true:6 level ,flase:3level
bool motor_num_flag ; //true:tow motor, flase:one motor
} switch_statut_t;
// typedef struct
// {
// char *fengqu = "fengqu";
// } switch_name_t;
// extern switch_statut_t g_switch_statut;
lv_task_t *task_mode_pop;
lv_task_t *task_app_pop;
extern bool g_wifi_flash;
extern char *rename_r[];
extern char *name_key[];
extern char *slider_key[];
extern char *sw_key[];
extern char g_ssid_name[30];
extern uint8_t bg_color;