mirror of
https://git.beihong.wang/wangbeihong/iot-bedroom-environment-controller.git
synced 2026-04-23 16:33:04 +08:00
25 lines
913 B
C
25 lines
913 B
C
#include "app_state.h"
|
|
|
|
/* Definitions of shared application state */
|
|
SemaphoreHandle_t xSensorDataMutex = NULL;
|
|
SemaphoreHandle_t xMqttMessageMutex = NULL;
|
|
SemaphoreHandle_t xTimePeriodMutex = NULL;
|
|
SemaphoreHandle_t xControlFlagMutex = NULL;
|
|
|
|
bool servo_control_flag = false;
|
|
bool fan_control_flag = false;
|
|
bool buzzer_control_flag = false;
|
|
bool light_source_control_flag = false;
|
|
uint8_t led_brightness_value = 0;
|
|
bool led_backlight_on = false;
|
|
|
|
device_message_t g_device_message;
|
|
float g_temperature_threshold = 39.0f;
|
|
bool g_cooling_mode_enabled = false;
|
|
bool g_high_temp_alerted = false;
|
|
|
|
// 时间段配置(昼间/夜间)
|
|
time_period_config_t g_day_period = {.start_hour = 8, .start_minute = 0, .end_hour = 20, .end_minute = 0};
|
|
time_period_config_t g_night_period = {.start_hour = 20, .start_minute = 0, .end_hour = 8, .end_minute = 0};
|
|
bool g_use_time_period = false; // 是否启用时间段控制
|