mirror of
https://git.beihong.wang/wangbeihong/iot-bedroom-environment-controller.git
synced 2026-04-23 15:13:05 +08:00
49 lines
1.1 KiB
C
49 lines
1.1 KiB
C
#ifndef APP_STATE_H
|
|
#define APP_STATE_H
|
|
|
|
#include "common.h"
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/semphr.h"
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
// 时间段配置结构体
|
|
typedef struct {
|
|
uint8_t start_hour;
|
|
uint8_t start_minute;
|
|
uint8_t end_hour;
|
|
uint8_t end_minute;
|
|
} time_period_config_t;
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern SemaphoreHandle_t xSensorDataMutex;
|
|
extern SemaphoreHandle_t xMqttMessageMutex;
|
|
extern SemaphoreHandle_t xTimePeriodMutex;
|
|
extern SemaphoreHandle_t xControlFlagMutex;
|
|
|
|
extern bool servo_control_flag;
|
|
extern bool fan_control_flag;
|
|
extern bool buzzer_control_flag;
|
|
extern bool light_source_control_flag;
|
|
extern uint8_t led_brightness_value;
|
|
extern bool led_backlight_on;
|
|
|
|
extern device_message_t g_device_message;
|
|
extern float g_temperature_threshold;
|
|
extern bool g_cooling_mode_enabled;
|
|
extern bool g_high_temp_alerted;
|
|
|
|
// 时间段配置
|
|
extern time_period_config_t g_day_period;
|
|
extern time_period_config_t g_night_period;
|
|
extern bool g_use_time_period;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // APP_STATE_H
|