From 13716c9c303f8c6e14c5d5cc6b67f6c815ba38e2 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Fri, 17 Feb 2023 23:29:44 +0100 Subject: [PATCH] tweak the UART in use message on RP2040 --- locale/circuitpython.pot | 5 ++++- ports/raspberrypi/common-hal/busio/UART.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 72ee60cc0c..cafc4b9b0e 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -438,7 +438,6 @@ msgid "All SPI peripherals are in use" msgstr "" #: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "" @@ -2149,6 +2148,10 @@ msgstr "" msgid "UART init" msgstr "" +#: ports/raspberrypi/common-hal/busio/UART.c +msgid "UART peripheral in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART re-init" msgstr "" diff --git a/ports/raspberrypi/common-hal/busio/UART.c b/ports/raspberrypi/common-hal/busio/UART.c index 8c33226707..156a5e11ce 100644 --- a/ports/raspberrypi/common-hal/busio/UART.c +++ b/ports/raspberrypi/common-hal/busio/UART.c @@ -111,7 +111,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint8_t uart_id = ((((tx != NULL) ? tx->number : rx->number) + 4) / 8) % NUM_UARTS; if (uart_status[uart_id] != STATUS_FREE) { - mp_raise_RuntimeError(translate("All UART peripherals are in use")); + mp_raise_ValueError(translate("UART peripheral in use")); } // These may raise exceptions if pins are already in use. self->tx_pin = pin_init(uart_id, tx, 0);