8000 Added conditional compilation around selection of TX pad candidates · losingrose/circuitpython@6450720 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6450720

Browse files
committed
Added conditional compilation around selection of TX pad candidates
Original code was correct for SAMD21 New code for SAMD51 only permits pad-0 for TX
1 parent 69460b9 commit 6450720

File tree

1 file changed

+9
-1
lines changed
  • ports/atmel-samd/common-hal/busio

1 file changed

+9
-1
lines changed

ports/atmel-samd/common-hal/busio/UART.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,19 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
8888
continue;
8989
}
9090
potential_sercom = sercom_insts[sercom_index];
91-
if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 ||
91+
#ifdef SAMD21
92+
if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 ||
9293
!(tx->sercom[i].pad == 0 ||
9394
tx->sercom[i].pad == 2)) {
9495
continue;
9596
}
97+
#endif
98+
#ifdef SAMD51
99+
if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 ||
100+
!(tx->sercom[i].pad == 0)) {
101+
continue;
102+
}
103+
#endif
96104
tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D);
97105
tx_pad = tx->sercom[i].pad;
98106
if (rx == mp_const_none) {

0 commit comments

Comments
 (0)
0