diff --git a/src/ADC/ADC.c b/src/ADC/ADC.c index c926891..e441bf7 100644 --- a/src/ADC/ADC.c +++ b/src/ADC/ADC.c @@ -85,10 +85,7 @@ void ADC_Disable() { RegEdit_ClearBit((void *)&ADCSRA, ADEN); } -uint16_t ADC_ReadValue_Impl(uint8_t adc_chan) { - if (IsInvalidChannel(adc_chan)) { - return UINT16_MAX; - } +uint16_t ADC_ReadValue_Impl(void) { // start conversion. RegEdit_SetBit((void *)&ADCSRA, ADSC); @@ -106,9 +103,9 @@ uint16_t ADC_ReadValue_Impl(uint8_t adc_chan) { cycles++; } - uint8_t val = ADC; + uint16_t val = ADC; return val; } // Set the default for the function pointer. -uint16_t (*ADC_ReadValue)(uint8_t adc_chan) = ADC_ReadValue_Impl; +uint16_t (*ADC_ReadValue)(void) = ADC_ReadValue_Impl; diff --git a/src/ADC/ADC.h b/src/ADC/ADC.h index 6ad30ab..bc64912 100644 --- a/src/ADC/ADC.h +++ b/src/ADC/ADC.h @@ -52,12 +52,11 @@ void ADC_Disable(); /** * @brief Reads ADC value into variable * - * @param adc_chan The bin number of the ADC pin being read. * * This function depends on the ADC already being initialized and enabled * before being called. */ -extern uint16_t (*ADC_ReadValue)(uint8_t adc_chan); +extern uint16_t (*ADC_ReadValue)(); /** * @brief Sets up the ADC