zavlaha-kzk/src/app_config.h

43 lines
889 B

/**
* TODO file description
*/
#ifndef ZAVLAHA_APP_CONFIG_H
#define ZAVLAHA_APP_CONFIG_H
#include <stdint.h>
#include <stdbool.h>
#define CIRCUIT_COUNT 4
#define SCHEDULE_COUNT 4
#define MENU_AUTOEXIT_TIME_S 120
struct __attribute__((packed)) ScheduleTime {
bool enable;
uint8_t h;
uint8_t m;
};
struct __attribute__((packed)) AppConfig {
uint8_t magic_version;
uint16_t circuit_base_time_s;
uint16_t circuit_time_percent[CIRCUIT_COUNT]; // 0% can be used to disable a branch
bool scheduler_enable;
struct ScheduleTime schedules[SCHEDULE_COUNT];
bool moisture_enable;
uint16_t moisture_dry;
uint16_t moisture_wet;
uint8_t moisture_threshold_percent;
};
#define APPCONFIG_SIZE sizeof(struct AppConfig)
#define APPCONFIG_VERSION 0b11100001
extern struct AppConfig app_config;
void appconfig_load();
void appconfig_save();
#endif //ZAVLAHA_APP_CONFIG_H