Merge pull request #1989 from rce1086/master

Added conditional compilation around selection of TX pad candidates
This commit is contained in:
Scott Shawcroft 2019-07-08 14:07:04 -07:00 committed by GitHub
commit f4a64a2e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -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) {