diff --git a/src/load/load.c b/src/load/load.c index 1d4be76..79e1e7a 100644 --- a/src/load/load.c +++ b/src/load/load.c @@ -30,7 +30,7 @@ static bool porta_disabled[8] = {0}; static bool portb_disabled[8] = {0}; -static bool valid_load(uint16_t val) +bool valid_load(uint16_t val) { if(val > LOWTHRESH && val < HIGHTHRESH) { return true; diff --git a/src/load/load.h b/src/load/load.h index 57dc6cd..e74a75f 100644 --- a/src/load/load.h +++ b/src/load/load.h @@ -10,6 +10,7 @@ #ifndef LOAD_H #define LOAD_H +#include #include /** @@ -24,11 +25,27 @@ */ #define HIGHTHRESH 1000 +/** + * @brief Checks if the adc pin is inbetween LOWTHRESH and HIGHTHRESH and then + * sets or disables the output pin on PORTA. + * @param adc_pin the pin number that the load value is read from. + * @param out_pin The pin that is set high if the adc_pin input is valid. + */ void Load_HandleLoadPortA(uint8_t adc_pin, uint8_t out_pin); + +/** + * @brief Checks if the adc pin is inbetween LOWTHRESH and HIGHTHRESH and then + * sets or disables the output pin on PORTB. + * @param adc_pin the pin number that the load value is read from. + * @param out_pin The pin that is set high if the adc_pin input is valid. + */ void Load_HandleLoadPortB(uint8_t adc_pin, uint8_t out_pin); -void Load_HandlePinLoads(void); - +/** + * @brief A helper function that handles the valid value range. + * @return + */ +bool valid_load(uint16_t val); #endif /* LOAD_H */