Skip to content

Commit 490e377

Browse files
ofauchondeadprogram
authored andcommitted
bluepill: Enable stm32's USART2 for the board and map it to UART1 tinygo's device
1 parent fcedf0b commit 490e377

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/machine/board_bluepill.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,15 @@ var (
6565
Buffer: NewRingBuffer(),
6666
Bus: stm32.USART1,
6767
}
68-
UART1 = &UART0
68+
UART1 = UART{
69+
Buffer: NewRingBuffer(),
70+
Bus: stm32.USART2,
71+
}
6972
)
7073

7174
func init() {
7275
UART0.Interrupt = interrupt.New(stm32.IRQ_USART1, UART0.handleInterrupt)
76+
UART1.Interrupt = interrupt.New(stm32.IRQ_USART2, UART1.handleInterrupt)
7377
}
7478

7579
// SPI pins

0 commit comments

Comments
 (0)