renamed `valid_load()` --> `is_valid_load()`
This commit is contained in:
parent
0ca16b207b
commit
e3b42aeba9
|
@ -30,7 +30,7 @@ static bool porta_disabled[8] = {0};
|
|||
static bool portb_disabled[8] = {0};
|
||||
|
||||
|
||||
bool valid_load(uint16_t val)
|
||||
bool is_valid_load(uint16_t val)
|
||||
{
|
||||
if(val > LOWTHRESH && val < HIGHTHRESH) {
|
||||
return true;
|
||||
|
@ -54,7 +54,7 @@ void Load_HandleLoadPortA(uint8_t adc_pin, uint8_t out_pin)
|
|||
uint16_t val = ADC_ReadValue(adc_pin);
|
||||
|
||||
ADC_Disable();
|
||||
if(valid_load(val) && !porta_disabled[adc_pin]){
|
||||
if(is_valid_load(val) && !porta_disabled[adc_pin]){
|
||||
RegEdit_SetBit((void *) &PORTA.DIR, out_pin);
|
||||
RegEdit_SetBit((void *) &PORTA.OUT, out_pin);
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ void Load_HandleLoadPortB(uint8_t adc_pin, uint8_t out_pin)
|
|||
uint16_t val = ADC_ReadValue(adc_pin);
|
||||
|
||||
ADC_Disable();
|
||||
if(valid_load(val) && !portb_disabled[adc_pin]){
|
||||
if(is_valid_load(val) && !portb_disabled[adc_pin]){
|
||||
RegEdit_SetBit((void *) &PORTB.DIR, out_pin);
|
||||
RegEdit_SetBit((void *) &PORTB.OUT, out_pin);
|
||||
}
|
||||
|
|
|
@ -52,15 +52,15 @@ void Load_HandleLoadPortB(uint8_t adc_pin, uint8_t out_pin);
|
|||
|
||||
/**
|
||||
* @brief A helper function that handles the valid value range.
|
||||
* @return
|
||||
* @return True/False value.
|
||||
*/
|
||||
bool valid_load(uint16_t val);
|
||||
bool is_valid_load(uint16_t val);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief A helper function that checks if current load value is below target.
|
||||
* @return
|
||||
* @return True/False value.
|
||||
*/
|
||||
bool is_below_target(uint16_t val);
|
||||
|
||||
|
|
Loading…
Reference in New Issue