Skip to content

Commit

Permalink
Merge pull request #598 from Paciente8159/fix-avr-uart-isr-vector-macro
Browse files Browse the repository at this point in the history
fix UART ISR vector macro for AVR
  • Loading branch information
Paciente8159 committed Jan 24, 2024
2 parents c9039d1 + 7773d07 commit 4953d86
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
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

0 comments on commit 4953d86

Please sign in to comment.