summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <thach@tinyusb.org>2018-06-08 15:59:38 +0700
committerhathach <thach@tinyusb.org>2018-06-08 15:59:38 +0700
commit2b3436e87c41fa001f527baa19f9bb446f8b56c6 (patch)
treeb9b2705bdfbf09c70f34431aeb865048593ce139
parentc10899d13f0d25d00bacd015e1afc3d33243a9b0 (diff)
add feather nrf52 uart rts, cts support
-rw-r--r--ports/nrf/boards/feather52840/bluefruit_nrf52840_s140_6.0.0.ld2
-rw-r--r--ports/nrf/hal/hal_uart.c2
-rw-r--r--ports/nrf/supervisor/serial.c5
3 files changed, 7 insertions, 2 deletions
diff --git a/ports/nrf/boards/feather52840/bluefruit_nrf52840_s140_6.0.0.ld b/ports/nrf/boards/feather52840/bluefruit_nrf52840_s140_6.0.0.ld
index fc185a373..186509285 100644
--- a/ports/nrf/boards/feather52840/bluefruit_nrf52840_s140_6.0.0.ld
+++ b/ports/nrf/boards/feather52840/bluefruit_nrf52840_s140_6.0.0.ld
@@ -41,6 +41,6 @@ _estack = ORIGIN(RAM) + LENGTH(RAM);
/* RAM extents for the garbage collector */
_ram_end = ORIGIN(RAM) + LENGTH(RAM);
-_heap_end = 0x20007000; /* tunable */
+_heap_end = 0x20020000; /* tunable */
INCLUDE "boards/common.ld"
diff --git a/ports/nrf/hal/hal_uart.c b/ports/nrf/hal/hal_uart.c
index b0a57a2a6..810449d83 100644
--- a/ports/nrf/hal/hal_uart.c
+++ b/ports/nrf/hal/hal_uart.c
@@ -114,7 +114,7 @@ int hal_uart_available(NRF_UART_Type * p_instance)
void hal_uart_init(NRF_UART_Type * p_instance, hal_uart_init_t const * p_uart_init) {
hal_gpio_cfg_pin(p_uart_init->tx_pin->port, p_uart_init->tx_pin->pin, HAL_GPIO_MODE_OUTPUT, HAL_GPIO_PULL_DISABLED);
- hal_gpio_cfg_pin(p_uart_init->tx_pin->port, p_uart_init->rx_pin->pin, HAL_GPIO_MODE_INPUT, HAL_GPIO_PULL_DISABLED);
+ hal_gpio_cfg_pin(p_uart_init->rx_pin->port, p_uart_init->rx_pin->pin, HAL_GPIO_MODE_INPUT, HAL_GPIO_PULL_DISABLED);
hal_gpio_pin_clear(p_uart_init->tx_pin->port, p_uart_init->tx_pin->pin);
diff --git a/ports/nrf/supervisor/serial.c b/ports/nrf/supervisor/serial.c
index 51e61bce7..ce801e371 100644
--- a/ports/nrf/supervisor/serial.c
+++ b/ports/nrf/supervisor/serial.c
@@ -49,8 +49,13 @@ void serial_init(void) {
.id = 0,
.rx_pin = &MICROPY_HW_UART1_RX,
.tx_pin = &MICROPY_HW_UART1_TX,
+#if MICROPY_HW_UART1_HWFC
+ .rts_pin = &MICROPY_HW_UART1_RTS,
+ .cts_pin = &MICROPY_HW_UART1_CTS,
+#else
.rts_pin = NULL,
.cts_pin = NULL,
+#endif
.flow_control = MICROPY_HW_UART1_HWFC ? true : false,
.use_parity = false,
.baud_rate = HAL_UART_BAUD_115K2,