Files
@ d87613e49192
Branch filter:
Location: therm/states.h - annotation
d87613e49192
1.5 KiB
text/plain
Added support for adjustable hysteresis in thermostatic mode. Also fixed missing logo rendering on initial powerup.
ff9cd320f764 ff9cd320f764 ff9cd320f764 45ee045c249f 618031ff9252 618031ff9252 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 860001bb7681 ff9cd320f764 ff9cd320f764 235f584ead39 235f584ead39 235f584ead39 235f584ead39 235f584ead39 235f584ead39 235f584ead39 235f584ead39 235f584ead39 235f584ead39 860001bb7681 235f584ead39 235f584ead39 9294a623e8e5 9294a623e8e5 d87613e49192 235f584ead39 235f584ead39 235f584ead39 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 9294a623e8e5 9294a623e8e5 9294a623e8e5 d87613e49192 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 ff9cd320f764 e28695e6887c ff9cd320f764 4ced8964c979 4ced8964c979 ff9cd320f764 4ced8964c979 618031ff9252 ff9cd320f764 ff9cd320f764 9294a623e8e5 9294a623e8e5 9294a623e8e5 9294a623e8e5 9294a623e8e5 9294a623e8e5 9294a623e8e5 9294a623e8e5 9294a623e8e5 9294a623e8e5 860001bb7681 618031ff9252 618031ff9252 618031ff9252 618031ff9252 860001bb7681 860001bb7681 860001bb7681 860001bb7681 860001bb7681 618031ff9252 45ee045c249f 45ee045c249f 618031ff9252 618031ff9252 618031ff9252 618031ff9252 618031ff9252 ff9cd320f764 | #ifndef STATES_H
#define STATES_H
#include "stm32f0xx_hal.h"
#include "config.h"
typedef struct {
int32_t temp;
uint8_t temp_frac;
uint8_t state_resume;
uint8_t state;
int32_t setpoint;
uint8_t pid_enabled;
uint8_t error_code;
} therm_status_t;
typedef union
{
struct {
uint32_t boottobrew;
uint32_t temp_units;
uint32_t windup_guard;
uint32_t k_p;
uint32_t k_i;
uint32_t k_d;
int32_t temp_offset;
uint32_t ignore_error;
int32_t setpoint_brew;
int32_t setpoint_steam;
uint32_t control_mode;
uint32_t plant_type;
uint32_t hysteresis;
} val;
uint16_t data[128];
} therm_settings_t;
enum tempunits {
TEMP_UNITS_CELSIUS = 0,
TEMP_UNITS_FAHRENHEIT,
};
enum state {
STATE_IDLE = 0,
STATE_SETMODE,
STATE_SETPLANTTYPE,
STATE_SETHYSTERESIS,
STATE_SETP,
STATE_SETI,
STATE_SETD,
STATE_SETSTEPS,
STATE_SETWINDUP,
STATE_SETBOOTTOBREW,
STATE_SETUNITS,
STATE_SETTEMPOFFSET,
STATE_PREHEAT,
STATE_MAINTAIN,
STATE_TC_ERROR,
STATE_RESET,
};
enum control_mode {
MODE_PID = 0,
MODE_THERMOSTAT,
};
enum plant_type {
PLANT_HEATER = 0,
PLANT_COOLER,
};
enum GOTO_MODE {
#ifdef BOOTLOADER_SHORTCUT
MODE_BOOTLOADER,
#endif
MODE_HEAT,
MODE_SETUP,
MODE_RESET,
MODE_SIZE,
};
enum RESET_MODE {
RESET_REBOOT = 0,
RESET_DEFAULTS,
RESET_BOOTLOADER,
RESET_EXIT,
RESET_SIZE,
};
#endif
|