main/automation.c

changeset 1
ad2c8b13eb88
parent 0
b74b0e4902c3
child 19
49e2960d4642
equal deleted inserted replaced
0:b74b0e4902c3 1:ad2c8b13eb88
3 * @brief Automation functions. 3 * @brief Automation functions.
4 */ 4 */
5 5
6 #include "config.h" 6 #include "config.h"
7 7
8 int BoilPower = 100; 8 int BoilPower = 100; ///< Boil power 0..100%
9 int LastMashStep = 0; 9 int LastMashStep = 0; ///< Last valid mash step
10 char temp_buf[64]; 10 char temp_buf[64]; ///< Temporary buffer
11 char logline[128]; 11 char logline[128]; ///< Log line buffer
12 char strftime_buf[64]; 12 char strftime_buf[64]; ///< Time buffer
13 bool loop; 13 bool loop; ///< Loop flag
14 bool CoolBeep = false; 14 bool CoolBeep = false; ///< Did beep during cooling
15 bool Resume = false; 15 bool Resume = false; ///< Resume brew flag
16 bool pumpRest = false; 16 bool pumpRest = false; ///< Pump is resting
17 bool updateRuntime = false; 17 bool updateRuntime = false; ///< Update runtime record
18 bool NewMinute = false; 18 bool NewMinute = false; ///< We have a new minute
19 bool TempReached = false; 19 bool TempReached = false; ///< Temperature is reached
20 uint8_t MashState = MASH_NONE; 20 uint8_t MashState = MASH_NONE; ///< Mash states
21 float temp_MLT; 21 float temp_MLT; ///< MLT temperature
22 float MinMash = 38.0; 22 float MinMash = 38.0; ///< Minimum edit value
23 float MaxMash = 80.0; 23 float MaxMash = 80.0; ///< Maximum edit value
24 uint32_t power_MLT = 0; 24 uint32_t power_MLT = 0; ///< MLT power
25 uint32_t power_HLT = 0; 25 uint32_t power_HLT = 0; ///< HLT power
26 uint32_t counts = 0; 26 uint32_t counts = 0; ///< Counter for power average
27 float stageTemp = 0.0; 27 float stageTemp = 0.0; ///< Current stage temperature
28 uint16_t stageTime = 0; 28 uint16_t stageTime = 0; ///< Current stage timer
29 uint16_t TimeWhirlPool = 0; 29 uint16_t TimeWhirlPool = 0; ///< Whirlpool timer
30 uint32_t TimeLeft = 0; 30 uint32_t TimeLeft = 0; ///< Tie left in this stage
31 uint32_t TimeSpent = 0; 31 uint32_t TimeSpent = 0; ///< Tota time spent
32 uint32_t SecsCount = 0; 32 uint32_t SecsCount = 0; ///< Seconds counter
33 uint32_t pumpTime = 0; 33 uint32_t pumpTime = 0; ///< Pump running time
34 uint32_t TimeBrewing = 0; 34 uint32_t TimeBrewing = 0; ///< Brewing time elapsed
35 uint16_t Steady = 0; 35 uint16_t Steady = 0; ///< Temperature is steady
36 bool _NewMinute = false; 36 bool _NewMinute = false; ///< New minute slave flag
37 bool _UseHLT = false; 37 bool _UseHLT = false; ///< Use HLT slave flag
38 bool _Prompt = false; 38 bool _Prompt = false; ///< Prompt display flag
39 39
40 extern bool System_TimeOk; 40 extern bool System_TimeOk; ///< System time is valid
41 extern sButton Buttons[MAXBUTTONS]; 41 extern sButton Buttons[MAXBUTTONS]; ///< Buttons definitions
42 extern int Main_Screen; 42 extern int Main_Screen; ///< Current screen
43 extern DS18B20_State *ds18b20_state; 43 extern DS18B20_State *ds18b20_state; ///< DS18B20 state
44 extern DRIVER_State *driver_state; 44 extern DRIVER_State *driver_state; ///< Relays driver state
45 extern SemaphoreHandle_t xSemaphoreDS18B20; 45 extern SemaphoreHandle_t xSemaphoreDS18B20; ///< DS18B20 lock semaphore
46 extern SemaphoreHandle_t xSemaphoreDriver; 46 extern SemaphoreHandle_t xSemaphoreDriver; ///< Relays driver lock semaphore
47 extern double Output; 47 extern double Output; ///< Cakculated outpout power
48 extern time_t now; 48 extern time_t now; ///< Current time
49 extern struct tm timeinfo; 49 extern struct tm timeinfo; ///< Current time structure
50 50
51 #ifdef CONFIG_TEMP_SENSORS_SIMULATOR 51 #ifdef CONFIG_TEMP_SENSORS_SIMULATOR
52 extern float Fake_MLT; 52 extern float Fake_MLT;
53 extern float Fake_HLT; 53 extern float Fake_HLT;
54 #endif 54 #endif

mercurial