wrote code to pass new tests.
This commit is contained in:
parent
fd6daaf02f
commit
0ca16b207b
|
@ -38,6 +38,14 @@ bool valid_load(uint16_t val)
|
||||||
return false;
|
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)
|
void Load_HandleLoadPortA(uint8_t adc_pin, uint8_t out_pin)
|
||||||
{
|
{
|
||||||
ADC_Init(adc_pin);
|
ADC_Init(adc_pin);
|
||||||
|
|
|
@ -56,5 +56,13 @@ void Load_HandleLoadPortB(uint8_t adc_pin, uint8_t out_pin);
|
||||||
*/
|
*/
|
||||||
bool valid_load(uint16_t val);
|
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 */
|
#endif /* LOAD_H */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue