From 6e5d70fa1929a6ab2b2de4d9fb0fb224d7618700 Mon Sep 17 00:00:00 2001 From: iot49 Date: Wed, 3 Jul 2019 12:02:01 -0700 Subject: [PATCH 1/2] changed type of receiver_buffer_size to uint16_t --- ports/nrf/common-hal/busio/UART.c | 2 +- shared-bindings/busio/UART.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 593914afc0..b9e9e55387 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -131,7 +131,7 @@ void uart_reset(void) { void common_hal_busio_uart_construct (busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, mp_float_t timeout, - uint8_t receiver_buffer_size) { + uint16_t receiver_buffer_size) { // Find a free UART peripheral. self->uarte = NULL; for (size_t i = 0 ; i < MP_ARRAY_SIZE(nrfx_uartes); i++) { diff --git a/shared-bindings/busio/UART.h b/shared-bindings/busio/UART.h index e171f8bb45..776a996be8 100644 --- a/shared-bindings/busio/UART.h +++ b/shared-bindings/busio/UART.h @@ -42,7 +42,7 @@ typedef enum { extern void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, mp_float_t timeout, - uint8_t receiver_buffer_size); + uint16_t receiver_buffer_size); extern void common_hal_busio_uart_deinit(busio_uart_obj_t *self); extern bool common_hal_busio_uart_deinited(busio_uart_obj_t *self); From 4c72a3991ed53889b2ecba9b3fbb742e261a8cc3 Mon Sep 17 00:00:00 2001 From: iot49 Date: Fri, 5 Jul 2019 10:01:51 -0700 Subject: [PATCH 2/2] updated samd and esp8266 ports --- ports/atmel-samd/common-hal/busio/UART.c | 2 +- ports/esp8266/common-hal/busio/UART.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 10618d1cec..b4539eb931 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -55,7 +55,7 @@ static void usart_async_rxc_callback(const struct usart_async_descriptor *const void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, mp_float_t timeout, - uint8_t receiver_buffer_size) { + uint16_t receiver_buffer_size) { Sercom* sercom = NULL; uint8_t sercom_index = 255; // Unset index uint32_t rx_pinmux = 0; diff --git a/ports/esp8266/common-hal/busio/UART.c b/ports/esp8266/common-hal/busio/UART.c index f10e3dc555..e72dce639c 100644 --- a/ports/esp8266/common-hal/busio/UART.c +++ b/ports/esp8266/common-hal/busio/UART.c @@ -40,7 +40,7 @@ extern UartDevice UartDev; void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, mp_float_t timeout, - uint8_t receiver_buffer_size) { + uint16_t receiver_buffer_size) { if (rx != mp_const_none || tx != &pin_GPIO2) { nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, translate("Only tx supported on UART1 (GPIO2)."))); }