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
Diff: heating/radiator.c
- Revision:
- 6:b325de442777
- Parent:
- 5:82197a6997fd
- Child:
- 7:a62134646ac8
diff -r 82197a6997fd -r b325de442777 heating/radiator.c --- a/heating/radiator.c Fri Feb 16 19:43:06 2018 +0000 +++ b/heating/radiator.c Thu Feb 22 18:33:44 2018 +0000 @@ -7,8 +7,7 @@ #include "ds18b20.h" #include "fram.h" #include "radiator.h" - -#define HALL_PB_PIN FIO0PIN(05) // P0. 5 == p29; +#include "debounce.h" #define HALL_LED_DIR FIO0DIR(10) // P0.10 == p28; #define HALL_LED_PIN FIO0PIN(10) @@ -20,7 +19,6 @@ #define RADIATOR_PUMP_SET FIO2SET(03) #define RADIATOR_PUMP_CLR FIO2CLR(03) - static char htgMode; static int iMode; static char htgOverride; static int iOverride; static char hallRom[8]; static int iHallRom; @@ -118,11 +116,11 @@ void RadiatorMain() { //deal with pushbutton - static bool prevHallPb = false; - bool thisHallPb = HALL_PB_PIN; - bool hallPbPressed = thisHallPb && !prevHallPb; - prevHallPb = thisHallPb; - if (hallPbPressed) RadiatorChgOverride(); + static bool thisOn = false; + static bool prevOn = false; + thisOn = DebounceHallPbPressed(); + if (thisOn && !prevOn) RadiatorChgOverride(); + prevOn = thisOn; //Make the radiator output makeOutputBeforeOverride();