Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix UART ISR vector macro for AVR #598

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions uCNC/src/hal/boards/avr/avr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ board = uno
;saves a bit of flash
build_flags = ${common_avr.build_flags} -D DISABLE_SETTINGS_MODULES -D DISABLE_MULTISTREAM_SERIAL -D DISABLE_RTC_CODE

[atmega328pb]
extends = common_avr
board = Atmega328PB
;saves a bit of flash
platform_packages=platformio/framework-arduino-avr-minicore@^3.0.0
build_flags = ${common_avr.build_flags} -D DISABLE_SETTINGS_MODULES -D DISABLE_MULTISTREAM_SERIAL -D DISABLE_RTC_CODE

[env:AVR-UNO]
extends = atmega328p
build_flags = ${atmega328p.build_flags} -D BOARD=BOARD_UNO
Expand Down
8 changes: 6 additions & 2 deletions uCNC/src/hal/mcus/avr/mcumap_avr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4332,14 +4332,18 @@ extern "C"
#define MCU_HAS_UART2
#endif

#ifndef USART0_RX_vect
#define USART0_RX_vect USART_RX_vect
#endif
#ifndef USART0_UDRE_vect
#define USART0_UDRE_vect USART_UDRE_vect
#endif

// COM registers
#ifdef MCU_HAS_UART
#ifndef UART_PORT
#define COM_RX_vect USART_RX_vect
#define COM_TX_vect USART_UDRE_vect
#define COM_RX_vect USART0_RX_vect
#define COM_TX_vect USART0_UDRE_vect
#define UART_PORT 0
#else
#define COM_RX_vect __comrxvect__(UART_PORT)
Expand Down
Loading