summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2019-07-08 14:07:04 -0700
committerGitHub <noreply@github.com>2019-07-08 14:07:04 -0700
commitf4a64a2e803ed64b3ccbb1c3a8dd72ae27953f1d (patch)
treeab3d0e10ae676584d7243e756c75620a1f2fb692
parent380f1d6ae6753a799176f03caada615125986274 (diff)
parent64507207da5a5b0a32cf0f8d51d6ca324b7dec21 (diff)
Merge pull request #1989 from rce1086/master
Added conditional compilation around selection of TX pad candidates
-rw-r--r--ports/atmel-samd/common-hal/busio/UART.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c
index b4539eb93..f04594842 100644
--- a/ports/atmel-samd/common-hal/busio/UART.c
+++ b/ports/atmel-samd/common-hal/busio/UART.c
@@ -88,11 +88,19 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
continue;
}
potential_sercom = sercom_insts[sercom_index];
- if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 ||
+#ifdef SAMD21
+ if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 ||
!(tx->sercom[i].pad == 0 ||
tx->sercom[i].pad == 2)) {
continue;
}
+#endif
+#ifdef SAMD51
+ if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 ||
+ !(tx->sercom[i].pad == 0)) {
+ continue;
+ }
+#endif
tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D);
tx_pad = tx->sercom[i].pad;
if (rx == mp_const_none) {