diff options
author | Dasky <32983009+daskygit@users.noreply.github.com> | 2021-01-30 03:53:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-29 19:53:56 -0800 |
commit | d92ffd1157e3ecc4ae2dbf8548c45c8b0269f664 (patch) | |
tree | 9a1a1f9d06fe6b9b41e982d37895e19749fe53ec /drivers/avr | |
parent | 3780ab3fcd4888cba4852158e11c495fc9809306 (diff) |
Adds AT90USB162 support (#11570)
* at90usb162 support
* fix missing bracket
* Apply suggestions from code review
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'drivers/avr')
-rw-r--r-- | drivers/avr/serial.c | 6 | ||||
-rw-r--r-- | drivers/avr/spi_master.c | 2 | ||||
-rw-r--r-- | drivers/avr/spi_master.h | 2 | ||||
-rw-r--r-- | drivers/avr/uart.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/drivers/avr/serial.c b/drivers/avr/serial.c index 526a0946b2..3647bee0d3 100644 --- a/drivers/avr/serial.c +++ b/drivers/avr/serial.c @@ -20,7 +20,7 @@ #ifdef SOFT_SERIAL_PIN -# if !(defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) +# if !(defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB162__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) # error serial.c is not supported for the currently selected MCU # endif // if using ATmega32U4/2, AT90USBxxx I2C, can not use PD0 and PD1 in soft serial. @@ -52,8 +52,8 @@ # define EICRx EICRA # endif -// ATmegaxxU2 specific config -# if defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) +// ATmegaxxU2/AT90USB162 specific config +# if defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_AT90USB162__) // PD4(INT5), PD6(INT6), PD7(INT7), PC7(INT4) # if SOFT_SERIAL_PIN == D4 # define EIMSK_BIT _BV(INT5) diff --git a/drivers/avr/spi_master.c b/drivers/avr/spi_master.c index cbec9f36e1..19ca0ced44 100644 --- a/drivers/avr/spi_master.c +++ b/drivers/avr/spi_master.c @@ -20,7 +20,7 @@ #include "quantum.h" #include "timer.h" -#if defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) +#if defined(__AVR_AT90USB162__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) # define SPI_SCK_PIN B1 # define SPI_MOSI_PIN B2 # define SPI_MISO_PIN B3 diff --git a/drivers/avr/spi_master.h b/drivers/avr/spi_master.h index e36a7c21c0..9203698dd5 100644 --- a/drivers/avr/spi_master.h +++ b/drivers/avr/spi_master.h @@ -21,7 +21,7 @@ typedef int16_t spi_status_t; // Hardware SS pin is defined in the header so that user code can refer to it -#if defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) +#if defined(__AVR_AT90USB162__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) # define SPI_SS_PIN B0 #elif defined(__AVR_ATmega32A__) # define SPI_SS_PIN B4 diff --git a/drivers/avr/uart.c b/drivers/avr/uart.c index e866a9e4f8..c6abcb6fe0 100644 --- a/drivers/avr/uart.c +++ b/drivers/avr/uart.c @@ -29,7 +29,7 @@ #include "uart.h" -#if defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) +#if defined(__AVR_AT90USB162__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) # define UDRn UDR1 # define UBRRnL UBRR1L # define UCSRnA UCSR1A |