From 95927f05dafcfec6a2aaddf272f67cc490edf3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Tue, 20 Sep 2022 01:16:22 +0200 Subject: [PATCH] make summer mode do something, update readme --- README.md | 11 +++++++++-- main/fancontrol.c | 4 +++- main/fancontrol.h | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a69a05b..ae9ea67 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,16 @@ H_RECUP_MODE = 12, // 0=na cas, 1=na teplotu (experimentalni) H_RECUP_TIME = 13, // pokud na cas, pak toho je cas rekuperace H_RECUP_TIME_MIN = 14, // na teplotu - spodni limit H_RECUP_TIME_MAX = 15, // na teplotu - horni limit -H_RECUP_FACTOR = 16, // na teplotu - faktor, 80% = foukej dokud delta teplot neklesne o 80% +// 16 - reserved H_MIN_POWER = 17, // min povoleny vykon motoru +H_T_IN_MIN = 18, +H_T_IN_MAX = 19, +// these don't work in summer mode: +H_T_STOPDELTA_IN = 20, +H_T_STOPDELTA_OUT = 21, +H_T_STOP_SPEED = 22, + // Hardware settings (don't need to change once set correctly) H_RAMP_TIME = 30, // doba rozbehu nebo zastaveni motoru H_BLIND_TIME = 31, // doba otevreni roletky @@ -51,7 +58,7 @@ Je take zrcadleno v holding mape s ofsetem 1000 (read-only) // napr. 3 = jsou platne jen T_{IN,OUT}_INST I_T_VALIDITY = 1, -I_T_IN_INST = 2, +I_T_IN_INST = 2, // teplota x100 (C) I_T_OUT_INST = 3, I_T_INDOOR = 4, I_T_OUTDOOR = 5, diff --git a/main/fancontrol.c b/main/fancontrol.c index 6da41b7..b3ab800 100644 --- a/main/fancontrol.c +++ b/main/fancontrol.c @@ -98,9 +98,11 @@ static void timerCallback() cels_t tin = act_temp1(); cels_t tout = act_temp2(); + uint16_t old_tempSerial = gState.tempSerial; float old_tin = gState.t_actual_in; float old_tout = gState.t_actual_out; + gState.tempSerial = act_temps_serial(); gState.t_actual_in = tin; gState.t_actual_out = tout; @@ -216,7 +218,7 @@ static void timerCallback() // Max time elapsed, switch even if the condition was not reached do_switch = true; } else { - if (gState.lastTempsSerial != act_temps_serial()) { + if (!gSettings.summer_mode && gState.tempSerial != old_tempSerial) { // expecting some change in temps float speed; if (gState.real_direction == MOTOR_DIR_IN) { diff --git a/main/fancontrol.h b/main/fancontrol.h index d3ffacd..1c93e3e 100644 --- a/main/fancontrol.h +++ b/main/fancontrol.h @@ -54,7 +54,7 @@ struct FanControlState { cels_t t_inflow; cels_t t_exhaust; - uint16_t lastTempsSerial; + uint16_t tempSerial; cels_t t_actual_in; cels_t t_actual_out;