Browse Source

machine/arduino-nano33: fix UART1 and UART2

UART2 was configured with the wrong SERCOM for the used pins (PB22 and
PB23). However, after changing the SERCOM from 3 to 5 that led to a
conflict with UART1 (used for the on-board WiFi). But the used pins are
also usable from SERCOM 3, so in the end I switched SERCOM5 and SERCOM3
around.

With this change, I was able to get examples/echo working.
pull/833/head
Ayke van Laethem 5 years ago
committed by Ron Evans
parent
commit
d37bbadb54
  1. 12
      src/machine/board_arduino_nano33_baremetal.go

12
src/machine/board_arduino_nano33_baremetal.go

@ -8,12 +8,12 @@ import "device/sam"
var (
UART1 = UART{
Buffer: NewRingBuffer(),
Bus: sam.SERCOM5_USART,
SERCOM: 5,
Bus: sam.SERCOM3_USART,
SERCOM: 3,
}
)
//go:export SERCOM5_IRQHandler
//go:export SERCOM3_IRQHandler
func handleUART1() {
defaultUART1Handler()
}
@ -22,12 +22,12 @@ func handleUART1() {
var (
UART2 = UART{
Buffer: NewRingBuffer(),
Bus: sam.SERCOM3_USART,
SERCOM: 3,
Bus: sam.SERCOM5_USART,
SERCOM: 5,
}
)
//go:export SERCOM3_IRQHandler
//go:export SERCOM5_IRQHandler
func handleUART2() {
// should reset IRQ
UART2.Receive(byte((UART2.Bus.DATA.Get() & 0xFF)))

Loading…
Cancel
Save