From b624f32f944acdc59dcb130674c09090c5c404cb Mon Sep 17 00:00:00 2001 From: skullY Date: Fri, 30 Aug 2019 11:19:03 -0700 Subject: clang-format changes --- drivers/avr/analog.c | 53 +++++++++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 32 deletions(-) (limited to 'drivers/avr/analog.c') diff --git a/drivers/avr/analog.c b/drivers/avr/analog.c index 1ec38df75d..1a8da4261d 100644 --- a/drivers/avr/analog.c +++ b/drivers/avr/analog.c @@ -21,49 +21,38 @@ #include #include "analog.h" +static uint8_t aref = (1 << REFS0); // default to AREF = Vcc -static uint8_t aref = (1<= 12) return 0; - return adc_read(pgm_read_byte(pin_to_mux + pin)); + static const uint8_t PROGMEM pin_to_mux[] = {0x00, 0x01, 0x04, 0x05, 0x06, 0x07, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20}; + if (pin >= 12) return 0; + return adc_read(pgm_read_byte(pin_to_mux + pin)); #elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) - if (pin >= 8) return 0; - return adc_read(pin); + if (pin >= 8) return 0; + return adc_read(pin); #else - return 0; + return 0; #endif } // Mux input -int16_t adc_read(uint8_t mux) -{ +int16_t adc_read(uint8_t mux) { #if defined(__AVR_AT90USB162__) - return 0; + return 0; #else - uint8_t low; - - ADCSRA = (1<