summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucian Copeland <hierophect@gmail.com>2020-05-27 11:48:52 -0400
committerLucian Copeland <hierophect@gmail.com>2020-05-27 11:48:52 -0400
commit1e914ac2b006079661558d5de0742aba1fc5b22e (patch)
tree0d8e9ca022f0f98c02d665698bf1df88efdc51f9
parent75b51429545af57da0f17e983014ef2951370600 (diff)
Change exception text and type
-rw-r--r--ports/mimxrt10xx/common-hal/busio/SPI.c2
-rw-r--r--ports/mimxrt10xx/common-hal/busio/UART.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c
index 54c8d001d..cede7b5bd 100644
--- a/ports/mimxrt10xx/common-hal/busio/SPI.c
+++ b/ports/mimxrt10xx/common-hal/busio/SPI.c
@@ -157,7 +157,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
if (spi_taken) {
mp_raise_ValueError(translate("Hardware busy, try alternative pins"));
} else {
- mp_raise_ValueError(translate("Invalid SPI pin selection"));
+ mp_raise_ValueError(translate("Invalid pins"));
}
}
diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c
index 015b0188f..2bec667eb 100644
--- a/ports/mimxrt10xx/common-hal/busio/UART.c
+++ b/ports/mimxrt10xx/common-hal/busio/UART.c
@@ -143,15 +143,15 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
}
if (uart_taken) {
- mp_raise_RuntimeError(translate("Hardware in use, try alternative pins"));
+ mp_raise_ValueError(translate("Hardware in use, try alternative pins"));
}
if(self->rx == NULL && self->tx == NULL) {
- mp_raise_RuntimeError(translate("Invalid UART pin selection"));
+ mp_raise_ValueError(translate("Invalid pins"));
}
if (is_onedirection && ((rts != NULL) || (cts != NULL))) {
- mp_raise_RuntimeError(translate("Both RX and TX required for flow control"));
+ mp_raise_ValueError(translate("Both RX and TX required for flow control"));
}
// Filter for sane settings for RS485