mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-22 06:04:03 -06:00
gpio: Fix off-by-one in declaration of ADC_MAX
The maximum value for the ADC is 1023 for 10bit samples and 4095 for 12bit samples. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
37572bc217
commit
a361b92184
2 changed files with 2 additions and 2 deletions
|
@ -258,7 +258,7 @@ static const uint8_t adc_pins[] PROGMEM = {
|
||||||
|
|
||||||
static const uint8_t ADMUX_DEFAULT = 0x40;
|
static const uint8_t ADMUX_DEFAULT = 0x40;
|
||||||
|
|
||||||
DECL_CONSTANT(ADC_MAX, 1024);
|
DECL_CONSTANT(ADC_MAX, 1023);
|
||||||
|
|
||||||
struct gpio_adc
|
struct gpio_adc
|
||||||
gpio_adc_setup(uint8_t pin)
|
gpio_adc_setup(uint8_t pin)
|
||||||
|
|
|
@ -128,7 +128,7 @@ static const uint8_t adc_pins[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ADC_FREQ_MAX 20000000
|
#define ADC_FREQ_MAX 20000000
|
||||||
DECL_CONSTANT(ADC_MAX, 4096);
|
DECL_CONSTANT(ADC_MAX, 4095);
|
||||||
|
|
||||||
struct gpio_adc
|
struct gpio_adc
|
||||||
gpio_adc_setup(uint8_t pin)
|
gpio_adc_setup(uint8_t pin)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue