diff options
author | itsnoteasy <pyrosoma1@yahoo.ie> | 2020-06-10 22:23:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 22:23:11 +0100 |
commit | 7aa4cc9603b8cdb0ea3ede753eff7d07a86a18b0 (patch) | |
tree | c48255b3861208d8b85e341b68bbc827b5f06711 /drivers | |
parent | e26bc21d1452dcf04332d300a874dacc8d74862d (diff) | |
download | qmk_firmware-7aa4cc9603b8cdb0ea3ede753eff7d07a86a18b0.tar.gz |
adds support for the atmega328 (#9043)
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/avr/analog.c | 4 | ||||
-rw-r--r-- | drivers/avr/spi_master.c | 2 | ||||
-rw-r--r-- | drivers/avr/spi_master.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/avr/analog.c b/drivers/avr/analog.c index abe478b71..9b8397b93 100644 --- a/drivers/avr/analog.c +++ b/drivers/avr/analog.c @@ -38,7 +38,7 @@ int16_t analogRead(uint8_t pin) { // clang-format on if (pin >= 12) return 0; return adc_read(pgm_read_byte(pin_to_mux + pin)); -#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega328P__) +#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) if (pin >= 8) return 0; return adc_read(pin); #else @@ -85,7 +85,7 @@ uint8_t pinToMux(pin_t pin) { case A6: return _BV(MUX2) | _BV(MUX1); // ADC6 case A7: return _BV(MUX2) | _BV(MUX1) | _BV(MUX0); // ADC7 default: return _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1) | _BV(MUX0); // 0V -#elif defined(__AVR_ATmega328P__) +#elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) case C0: return 0; // ADC0 case C1: return _BV(MUX0); // ADC1 case C2: return _BV(MUX1); // ADC2 diff --git a/drivers/avr/spi_master.c b/drivers/avr/spi_master.c index 32cc55c83..f91baf70b 100644 --- a/drivers/avr/spi_master.c +++ b/drivers/avr/spi_master.c @@ -28,7 +28,7 @@ # define SPI_SCK_PIN B7 # define SPI_MOSI_PIN B5 # define SPI_MISO_PIN B6 -#elif defined(__AVR_ATmega328P__) +#elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) # define SPI_SCK_PIN B5 # define SPI_MOSI_PIN B3 # define SPI_MISO_PIN B4 diff --git a/drivers/avr/spi_master.h b/drivers/avr/spi_master.h index b69c1cbd6..e36a7c21c 100644 --- a/drivers/avr/spi_master.h +++ b/drivers/avr/spi_master.h @@ -25,7 +25,7 @@ typedef int16_t spi_status_t; # define SPI_SS_PIN B0 #elif defined(__AVR_ATmega32A__) # define SPI_SS_PIN B4 -#elif defined(__AVR_ATmega328P__) +#elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) # define SPI_SS_PIN B2 #endif |