78 #include "task_wifi.h" |
78 #include "task_wifi.h" |
79 #include "task_sound.h" |
79 #include "task_sound.h" |
80 #include "task_http.h" |
80 #include "task_http.h" |
81 |
81 |
82 |
82 |
83 #define VERSION "0.2.2" |
83 #define VERSION "0.2.3" ///< Application version |
84 |
84 |
85 |
85 |
86 /** |
86 /** |
87 * @brief Main mode different screens |
87 * @brief Main mode different screens |
88 */ |
88 */ |
131 MAIN_AUTO_ABORT, ///< Aborted |
131 MAIN_AUTO_ABORT, ///< Aborted |
132 MAIN_MANUAL_INIT = 200, ///< Manual control init |
132 MAIN_MANUAL_INIT = 200, ///< Manual control init |
133 MAIN_MANUAL_MAIN, ///< Manual control main menu |
133 MAIN_MANUAL_MAIN, ///< Manual control main menu |
134 } MAIN_MODE; |
134 } MAIN_MODE; |
135 |
135 |
|
136 /** |
|
137 * @brief The differents stages in the mash steps. |
|
138 */ |
136 typedef enum { |
139 typedef enum { |
137 MASH_NONE = 0, ///< Initial Mash state |
140 MASH_NONE = 0, ///< Initial Mash state |
138 MASH_WAITTEMP, ///< Wait to reach temperature. |
141 MASH_WAITTEMP, ///< Wait to reach temperature. |
139 MASH_REST, ///< Mash rest |
142 MASH_REST, ///< Mash rest |
140 MASH_ADD, ///< Add mash wait |
143 MASH_ADD, ///< Add mash wait |
141 MASH_IODINE, ///< Wait iodine test |
144 MASH_IODINE, ///< Wait iodine test |
142 MASH_REMOVE, ///< Wait mash remove |
145 MASH_REMOVE, ///< Wait mash remove |
143 } MASH_TYPE; |
146 } MASH_TYPE; |
144 |
147 |
|
148 /** |
|
149 * @brief The working mode of the second heater SSR. |
|
150 */ |
145 typedef enum { |
151 typedef enum { |
146 SSR2_OFF = 0, ///< SSR2 not used. |
152 SSR2_OFF = 0, ///< SSR2 not used. |
147 SSR2_HLT_SHARE, ///< SSR2 for HLT shared with MLT |
153 SSR2_HLT_SHARE, ///< SSR2 for HLT shared with MLT |
148 SSR2_HLT_IND, ///< SSR2 for HLT independend. |
154 SSR2_HLT_IND, ///< SSR2 for HLT independend. |
149 SSR2_ON_IDLE, ///< SSR2 on when NLT is idle. |
155 SSR2_ON_IDLE, ///< SSR2 on when NLT is idle. |
175 uint16_t ts_ytop; ///< TS calibration Y top. |
181 uint16_t ts_ytop; ///< TS calibration Y top. |
176 uint16_t ts_ybottom; ///< TS calibration Y bottom. |
182 uint16_t ts_ybottom; ///< TS calibration Y bottom. |
177 int RecipeRec; ///< Current recipe record. |
183 int RecipeRec; ///< Current recipe record. |
178 char uuid[37]; ///< Sort of uuid code. |
184 char uuid[37]; ///< Sort of uuid code. |
179 char lastSSID[32]; ///< Last connected station. |
185 char lastSSID[32]; ///< Last connected station. |
180 } config; |
186 } config; ///< Config record. |
181 |
187 |
182 /** |
188 /** |
183 * @brief Write configuration to disk. |
189 * @brief Write configuration to disk. |
184 */ |
190 */ |
185 void write_config(void); |
191 void write_config(void); |
213 double PID_kP; ///< PID P setting. |
219 double PID_kP; ///< PID P setting. |
214 double PID_kI; ///< PID I setting. |
220 double PID_kI; ///< PID I setting. |
215 double PID_kD; ///< PID D setting. |
221 double PID_kD; ///< PID D setting. |
216 bool PID_POn; ///< PID compute on Measurement or Errors. |
222 bool PID_POn; ///< PID compute on Measurement or Errors. |
217 int SampleTime; ///< PID sample time in seconds. |
223 int SampleTime; ///< PID sample time in seconds. |
218 } equipment; |
224 } equipment; ///< Equipment record. |
219 |
225 |
220 /** |
226 /** |
221 * @brief Append equipments record to disk. |
227 * @brief Append equipments record to disk. |
222 */ |
228 */ |
223 void append_equipment(void); |
229 void append_equipment(void); |
249 */ |
255 */ |
250 struct strStations { |
256 struct strStations { |
251 char SSID[32]; ///< Station SSID |
257 char SSID[32]; ///< Station SSID |
252 char Password[64]; ///< Station password |
258 char Password[64]; ///< Station password |
253 bool hide; ///< Hide from AP scan. |
259 bool hide; ///< Hide from AP scan. |
254 } wifiStation; |
260 } wifiStation; ///< Station record. |
255 |
261 |
256 /** |
262 /** |
257 * @brief Add a new station record. |
263 * @brief Add a new station record. |
258 * @param SSID The SSID |
264 * @param SSID The SSID |
259 * @param Password The password for this SSID |
265 * @param Password The password for this SSID |
272 * @brief Remove station record. |
278 * @brief Remove station record. |
273 * @param SSID The SSID to remove. |
279 * @param SSID The SSID to remove. |
274 */ |
280 */ |
275 void remove_station(uint8_t *SSID); |
281 void remove_station(uint8_t *SSID); |
276 |
282 |
|
283 /** |
|
284 * @brief Blacklist station SSID |
|
285 * @param SSID The SSID to blacklist. |
|
286 * @return -1 if error, else the record number. |
|
287 */ |
277 int blacklist_station(uint8_t *SSID); |
288 int blacklist_station(uint8_t *SSID); |
278 |
289 |
279 |
290 |
280 |
291 |
281 /** |
292 /** |
292 time_t BrewStart; ///< Brew start time. |
303 time_t BrewStart; ///< Brew start time. |
293 char Logfile[64]; ///< Brew logfile. |
304 char Logfile[64]; ///< Brew logfile. |
294 bool UseHLT; ///< Use HLT during brew. |
305 bool UseHLT; ///< Use HLT during brew. |
295 bool PumpCooling; ///< Pump during cooling. |
306 bool PumpCooling; ///< Pump during cooling. |
296 uint32_t TimeBrewing; ///< Time we are brewing. |
307 uint32_t TimeBrewing; ///< Time we are brewing. |
297 } runtime; |
308 } runtime; ///< Runtime record. |
298 |
309 |
299 |
310 |
300 /** |
311 /** |
301 * @brief Write runtime information to disk. |
312 * @brief Write runtime information to disk. |
302 */ |
313 */ |
342 /** |
357 /** |
343 * @brief Current recipe |
358 * @brief Current recipe |
344 */ |
359 */ |
345 struct strRecipe { |
360 struct strRecipe { |
346 uint8_t Version; ///< Record version number. |
361 uint8_t Version; ///< Record version number. |
347 int Record; |
362 int Record; ///< Record number |
348 char Name[128]; ///< Recipe name. |
363 char Name[128]; ///< Recipe name. |
349 char Code[32]; ///< Recipe code. |
364 char Code[32]; ///< Recipe code. |
350 mashstep_t MashStep[8]; ///< Mash steps. |
365 mashstep_t MashStep[8]; ///< Mash steps. |
351 uint16_t BoilTime; ///< Boil time. |
366 uint16_t BoilTime; ///< Boil time. |
352 uint8_t Additions; ///< Number of additions. |
367 uint8_t Additions; ///< Number of additions. |
355 uint16_t Whirlpool9; ///< Zero or the Hot Whirlpool time 88..100 ° |
370 uint16_t Whirlpool9; ///< Zero or the Hot Whirlpool time 88..100 ° |
356 uint16_t Whirlpool7; ///< Zero or the Sub Isomerization Whirlpool time 71..77 ° |
371 uint16_t Whirlpool7; ///< Zero or the Sub Isomerization Whirlpool time 71..77 ° |
357 uint16_t Whirlpool6; ///< Zero or the "Tepid" Whirlpool time 60..66 ° |
372 uint16_t Whirlpool6; ///< Zero or the "Tepid" Whirlpool time 60..66 ° |
358 uint16_t Whirlpool2; ///< Zero or the Cold Whirlpool time < 30 ° |
373 uint16_t Whirlpool2; ///< Zero or the Cold Whirlpool time < 30 ° |
359 float SpargeTemp; ///< Sparge water temperature. |
374 float SpargeTemp; ///< Sparge water temperature. |
360 } recipe; |
375 } recipe; ///< Recipe record. |
361 |
376 |
362 /** |
377 /** |
363 * @brief Append a recipe record. Create file if it doesn't exist. |
378 * @brief Append a recipe record. Create file if it doesn't exist. |
364 */ |
379 */ |
365 void append_recipe(void); |
380 void append_recipe(void); |