From 490e377bba012afb6fd606b156276b76c24a3312 Mon Sep 17 00:00:00 2001 From: Olivier Fauchon Date: Wed, 16 Sep 2020 01:29:10 +0200 Subject: [PATCH] bluepill: Enable stm32's USART2 for the board and map it to UART1 tinygo's device --- src/machine/board_bluepill.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/machine/board_bluepill.go b/src/machine/board_bluepill.go index 60725a85..e3055eec 100644 --- a/src/machine/board_bluepill.go +++ b/src/machine/board_bluepill.go @@ -65,11 +65,15 @@ var ( Buffer: NewRingBuffer(), Bus: stm32.USART1, } - UART1 = &UART0 + UART1 = UART{ + Buffer: NewRingBuffer(), + Bus: stm32.USART2, + } ) func init() { UART0.Interrupt = interrupt.New(stm32.IRQ_USART1, UART0.handleInterrupt) + UART1.Interrupt = interrupt.New(stm32.IRQ_USART2, UART1.handleInterrupt) } // SPI pins