diff --git a/nrf5/uart.c b/nrf5/uart.c index a510c834a9..98370378bb 100644 --- a/nrf5/uart.c +++ b/nrf5/uart.c @@ -34,6 +34,8 @@ #include "py/stream.h" #include "py/mperrno.h" #include "py/mphal.h" +#include "pin.h" +#include "genhdr/pins.h" #include "uart.h" #include "mpconfigboard.h" @@ -215,16 +217,12 @@ STATIC mp_obj_t pyb_uart_init_helper(pyb_uart_obj_t *self, mp_uint_t n_args, con .irq_priority = 6 #endif }; - uart_init.rx_pin = MICROPY_HW_UART1_RX; - uart_init.tx_pin = MICROPY_HW_UART1_TX; - uart_init.rx_pin_port = MICROPY_HW_UART1_RX_PORT; - uart_init.tx_pin_port = MICROPY_HW_UART1_TX_PORT; + uart_init.rx_pin = &MICROPY_HW_UART1_RX; + uart_init.tx_pin = &MICROPY_HW_UART1_TX; #if MICROPY_HW_UART1_HWFC - uart_init.rts_pin = MICROPY_HW_UART1_RTS; - uart_init.cts_pin = MICROPY_HW_UART1_CTS; - uart_init.rts_pin_port = MICROPY_HW_UART1_RTS_PORT; - uart_init.cts_pin_port = MICROPY_HW_UART1_CTS_PORT; + uart_init.rts_pin = &MICROPY_HW_UART1_RTS; + uart_init.cts_pin = &MICROPY_HW_UART1_CTS; #endif nrf_uart_init(&uart_init);