File diff b61e1f4d75c5 → 574fd84a2bf8
inc/states.h
Show inline comments
 
@@ -5,34 +5,36 @@
 
#include "config.h"
 

	
 
typedef struct {
 
    float temp;
 
    uint8_t state_resume;
 
    uint8_t state;
 
    float setpoint;
 
    int32_t setpoint;
 
    uint8_t pid_enabled;
 
    uint8_t error_code;
 
    uint8_t setpoint_index;
 
} 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;
 
        int32_t temp_offset; //TODO: convert to float
 
        uint32_t ignore_error;
 
        int32_t setpoint_brew;
 
        int32_t setpoint_steam;
 
        int32_t setpoints[MAX_SETPOINTS];
 
        uint32_t control_mode;
 
        uint32_t sensor_type;
 
        uint32_t plant_type;
 
        uint32_t hysteresis;
 
        uint32_t setpoint_count;
 
        uint32_t setpoint_aux_select_enable;
 
    } val;
 

	
 
    uint16_t data[128];
 
} therm_settings_t;
 

	
 
enum tempunits {
 
@@ -43,12 +45,14 @@ enum tempunits {
 
enum state {
 
    STATE_IDLE = 0,
 

	
 
	STATE_SETSENSORTYPE,
 
    STATE_SETMODE,
 
    STATE_SETPLANTTYPE,
 
    STATE_SETSETPOINTCOUNT,
 
    STATE_SETSETPOINTAUXSELECTENABLE,
 
    STATE_SETHYSTERESIS,
 
    STATE_SETP,
 
    STATE_SETI,
 
    STATE_SETD,
 
    STATE_SETSTEPS,
 
    STATE_SETWINDUP,
 
@@ -70,12 +74,17 @@ enum control_mode {
 

	
 
enum plant_type {
 
    PLANT_HEATER = 0,
 
    PLANT_COOLER,
 
};
 

	
 
enum aux_select {
 
    AUX_DISABLE = 0,
 
    AUX_ENABLE,
 
};
 

	
 
enum GOTO_MODE {
 
	#ifdef BOOTLOADER_SHORTCUT
 
	MODE_BOOTLOADER,
 
	#endif
 
	MODE_HEAT,
 
	MODE_SETUP,