wrote code to pass new tests.

This commit is contained in:
jakeg00dwin 2024-09-23 12:02:43 -07:00
parent fd6daaf02f
commit 0ca16b207b
2 changed files with 16 additions and 0 deletions

View File

@ -38,6 +38,14 @@ bool valid_load(uint16_t val)
return false;
}
bool is_below_target(uint16_t val)
{
if(val < HYSTERESIS){
return true;
}
return false;
}
void Load_HandleLoadPortA(uint8_t adc_pin, uint8_t out_pin)
{
ADC_Init(adc_pin);

View File

@ -56,5 +56,13 @@ void Load_HandleLoadPortB(uint8_t adc_pin, uint8_t out_pin);
*/
bool valid_load(uint16_t val);
/**
* @brief A helper function that checks if current load value is below target.
* @return
*/
bool is_below_target(uint16_t val);
#endif /* LOAD_H */