From 32ec258b6740c7a0e4cbfb0c620f0e9c4a3093c7 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Mon, 23 Sep 2024 13:44:02 -0700 Subject: [PATCH] Put the define in the `config.h` file and conditionally defined it in the `load.h` file. --- inc/config.h | 7 +++++++ src/load/load.h | 8 +++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/inc/config.h b/inc/config.h index 8e9d2c0..533d593 100644 --- a/inc/config.h +++ b/inc/config.h @@ -56,5 +56,12 @@ const uint16_t GatePulses[5] = {250, 500, 750, 1000, 1250}; const double Tau = 8250; +/** + * @brief Hysteresis value + * Anything below this value will keep or turn on the associated + * pin in thermostat mode. + */ +#define HYSTERESIS 900 + #endif //CONFIG_H diff --git a/src/load/load.h b/src/load/load.h index 37f6b6a..e473b71 100644 --- a/src/load/load.h +++ b/src/load/load.h @@ -27,12 +27,10 @@ */ #define HIGHTHRESH 1000 -/** - * @brief Hysteresis value - * Anything below this value will keep or turn on the associated - * pin. - */ + +#ifndef HYSTERESIS #define HYSTERESIS 900 +#endif /** * @brief Checks if the adc pin is inbetween LOWTHRESH and HIGHTHRESH and then