Skip to content

Commit a1714dc

Browse files
committed
machine/lorae5: add needed definition for UART2
Signed-off-by: deadprogram <[email protected]>
1 parent 9a0c905 commit a1714dc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/machine/board_lorae5.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ var (
5656
}
5757
DefaultUART = UART0
5858

59+
// Since we treat UART1 as zero, let's also call it by the real name
60+
UART1 = UART0
61+
62+
// UART2
63+
UART2 = &_UART2
64+
_UART2 = UART{
65+
Buffer: NewRingBuffer(),
66+
Bus: stm32.USART2,
67+
TxAltFuncSelector: AF7_USART1_2,
68+
RxAltFuncSelector: AF7_USART1_2,
69+
}
70+
5971
// I2C Busses
6072
I2C1 = &I2C{
6173
Bus: stm32.I2C1,
@@ -72,4 +84,5 @@ var (
7284
func init() {
7385
// Enable UARTs Interrupts
7486
UART0.Interrupt = interrupt.New(stm32.IRQ_USART1, _UART0.handleInterrupt)
87+
UART2.Interrupt = interrupt.New(stm32.IRQ_USART2, _UART2.handleInterrupt)
7588
}

0 commit comments

Comments
 (0)