avr: Use "communication interface" menu option in Kconfig

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-03-18 14:22:15 -04:00
parent 1eddc0fd90
commit c5f21aa16c
1 changed files with 14 additions and 13 deletions

View File

@ -102,28 +102,29 @@ config AVR_STACK_SIZE
config AVR_WATCHDOG config AVR_WATCHDOG
bool bool
default y default y
config USBSERIAL config USBSERIAL
bool "Use USB for communication (instead of serial)"
depends on MACH_at90usb1286 || MACH_at90usb646 || MACH_atmega32u4
default y
config SERIAL
depends on !USBSERIAL
bool bool
default y config SERIAL
bool
default y if !USBSERIAL
choice choice
depends on SERIAL prompt "Communication interface" if LOW_LEVEL_OPTIONS && (MACH_atmega2560 || MACH_atmega1280 || MACH_atmega644p || MACH_atmega1284p || MACH_at90usb1286 || MACH_at90usb646 || MACH_atmega32u4)
prompt "Serial Port" if LOW_LEVEL_OPTIONS && (MACH_atmega2560 || MACH_atmega1280 || MACH_atmega644p || MACH_atmega1284p) config AVR_USB
help bool "USB" if MACH_at90usb1286 || MACH_at90usb646 || MACH_atmega32u4
Select the serial device to use on the AVR chip. This is select USBSERIAL
almost always UART0.
config AVR_SERIAL_UART0 config AVR_SERIAL_UART0
bool "UART0" bool "UART0" if !(MACH_at90usb1286 || MACH_at90usb646 || MACH_atmega32u4)
select SERIAL
config AVR_SERIAL_UART1 config AVR_SERIAL_UART1
bool "UART1" bool "UART1"
select SERIAL
config AVR_SERIAL_UART2 config AVR_SERIAL_UART2
bool "UART2" if MACH_atmega2560 || MACH_atmega1280 bool "UART2" if MACH_atmega2560 || MACH_atmega1280
select SERIAL
config AVR_SERIAL_UART3 config AVR_SERIAL_UART3
bool "UART3" if MACH_atmega2560 || MACH_atmega1280 bool "UART3" if MACH_atmega2560 || MACH_atmega1280
select SERIAL
endchoice endchoice
config SERIAL_BAUD_U2X config SERIAL_BAUD_U2X
depends on SERIAL && !SIMULAVR depends on SERIAL && !SIMULAVR
@ -134,7 +135,7 @@ config SERIAL_PORT
int int
default 3 if AVR_SERIAL_UART3 default 3 if AVR_SERIAL_UART3
default 2 if AVR_SERIAL_UART2 default 2 if AVR_SERIAL_UART2
default 1 if MACH_at90usb1286 || MACH_at90usb646 || MACH_atmega32u4 || AVR_SERIAL_UART1 default 1 if AVR_SERIAL_UART1
default 0 default 0
config SIMULAVR config SIMULAVR