Central Heating controller using the real time clock, PHY module for internet, 1-wire interface for temperature sensors, a system log and a configuration file

Dependencies:   net 1-wire lpc1768 crypto clock web fram log

/media/uploads/andrewboyson/heating.sch

/media/uploads/andrewboyson/heating.brd

/media/uploads/andrewboyson/eagle.epf

Revision:
102:d7bc31f0ac6e
Parent:
99:84c3273dc77f
--- a/heating/radiator.c	Tue Dec 29 20:19:43 2020 +0000
+++ b/heating/radiator.c	Sat Jan 16 18:44:34 2021 +0000
@@ -49,13 +49,19 @@
     int frostTemp16ths = frostTemperature << 4;
 
     static bool tooCold = false; //This is static to ride through invalid temperature reads
+    
+    static bool nightTooCold = false;
+    static bool frostTooCold = false;
+    
     if (DS18B20IsValidValue(hallTemp16ths))
     {
-        tooCold = hallTemp16ths < frostTemp16ths;
-        if (htgWinter) tooCold |= hallTemp16ths < nightTemp16ths;
+        if (hallTemp16ths < frostTemp16ths) frostTooCold = true;
+        if (hallTemp16ths > frostTemp16ths) frostTooCold = false;
+        if (hallTemp16ths < nightTemp16ths) nightTooCold = true; //Set   at 289 (18.06) rather than 288 (18.00)
+        if (hallTemp16ths > nightTemp16ths) nightTooCold = false;//Reset at 287 (17.94). This prevent it following the flashing.
     }
     
-    outputBeforeOverride = (htgWinter && ProgramTimerOutput) || tooCold;
+    outputBeforeOverride = (htgWinter && ProgramTimerOutput) || (htgWinter && nightTooCold) || frostTooCold;
 }
 static void autoCancelOverride()
 {