diff --git a/config.h b/config.h index 813422d..2f41697 100644 --- a/config.h +++ b/config.h @@ -14,31 +14,7 @@ #ifndef CONFIG_H #define CONFIG_H - -//#define __AVR_ATtiny404__ - #include -//#include - -//#define ZC_PORT_DIR &PORTA.DIR - -//*ZCP_DIR = &PORTA.DIR; - - -/** - * @brief Result type for the returned values from functions - * - */ -typedef enum ResultEnum{ - OK, - Err -}ResultEnum; - -/** - * @brief The type for Triac gate duration(micro seconds) - * - */ -typedef uint16_t DurationUs_t; /** @@ -71,18 +47,6 @@ const int GatePulsesQty = 5; */ const uint16_t GatePulses[5] = {250, 500, 750, 1000, 1250}; -/** - * @brief Low Threshold - * - */ -const uint16_t LowThresh = 527; - -/** - * @brief High Threshold - * - */ -const uint16_t HighThresh = 1000; - /** * @brief The time constant. */ diff --git a/load.c b/load.c index 2a91704..4330af5 100644 --- a/load.c +++ b/load.c @@ -1,8 +1,9 @@ +#include #include "load.h" #include "ADC.h" -#include "config.h" #include "RegEdit.h" + #define ADC_LOAD1 4 #define ADC_LOAD2 5 #define ADC_LOAD3 6 @@ -49,13 +50,13 @@ void Load_HandlePinLoads(void) RegEdit_SetNum((void *) &PORTA.OUT, porta_out_state); RegEdit_SetNum((void *) &PORTB.OUT, portb_out_state); - if(load_one < LowThresh || load_one > HighThresh){ + if(load_one < LOWTHRESH || load_one > HIGHTHRESH){ RegEdit_ClearBit((void *) &PORTA.OUT, G1); } - if(load_two < LowThresh || load_two > HighThresh){ + if(load_two < LOWTHRESH || load_two > HIGHTHRESH){ RegEdit_ClearBit((void *) &PORTB.OUT, G2); } - if(load_three < LowThresh || load_three > HighThresh){ + if(load_three < LOWTHRESH || load_three > HIGHTHRESH){ RegEdit_ClearBit((void *) &PORTB.OUT, G3); } diff --git a/load.h b/load.h index 07593e2..606977b 100644 --- a/load.h +++ b/load.h @@ -10,6 +10,19 @@ #ifndef LOAD_H #define LOAD_H +/** + * @brief Low Threshold + * + */ +#define LOWTHRESH 527 + +/** + * @brief High Threshold + * + */ +#define HIGHTHRESH 1000 + + void Load_HandlePinLoads(void); diff --git a/main.c b/main.c index acc1f3e..300e13c 100644 --- a/main.c +++ b/main.c @@ -51,7 +51,7 @@ int main(int argc, char **argv) ZCD_Poll(); TriacOut_SetupPins(); TriacOut_SetAllHigh(); - Load_HandlePinLoads(void); + Load_HandlePinLoads(); while(true){ ; //Do nothing until new Power cycle/reset occurs }