From: Nathael Pajani Date: Mon, 11 Mar 2024 15:38:12 +0000 (+0100) Subject: Add "delay" mode for mode display X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=c455edd12592a3787b2d9f79e56daabed40e7b04;p=soft%2Flpc122x%2Fscialys Add "delay" mode for mode display --- diff --git a/v10/main.c b/v10/main.c index 31f8563..5631518 100644 --- a/v10/main.c +++ b/v10/main.c @@ -66,10 +66,11 @@ uint8_t overvoltage = 0; /* Flag and counter. Used to create a delay when overvo enum modes { mode_heat = 'C', /* Normal heating */ + mode_delay = 'D', /* Delayed heating */ mode_ext_disable = 'E', /* Forced heating disabled by external input */ mode_forced = 'F', /* Auto Forced heating */ mode_manual = 'M', /* Manual Forced heating */ - mode_delayed_heat_prod = 'P', /* Pause */ + mode_delayed_heat_prod = 'P', /* Paused forced heating */ mode_temp_OK = 'T', /* Max temperature reached */ mode_overvoltage = 'V', /* Overvoltage detected */ mode_overtemp = 'H', /* Mosfet over-temperature detected */ @@ -309,6 +310,8 @@ void handle_cmd_update(uint32_t curent_tick) } } break; + case mode_delay: + /* FALTHROUGH */ case mode_temp_OK: /* FALTHROUGH */ default: @@ -493,6 +496,12 @@ void mode_update(void) msg = "Forced mode disabled by configuration\n"; } } + + /* Delayed heating ? */ + if ((mode == mode_heat) && (solar_prod_value < home_conso_value) && (command_val == 0)) { + mode = mode_delay; + } + }