nrf5/uart: Updating uart module to use new config hal config structure members for pins. Changing board config provided pins to use const pointers from generated pins instead of pin name.

This commit is contained in:
Glenn Ruben Bakke 2017-01-26 21:59:37 +01:00
parent d87d0141b3
commit 632afd1fa8

View File

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