diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2018-07-31 16:53:54 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2018-08-07 14:58:57 -0700 |
| commit | 933add6cd833bb6ba6682ad2b6eb478871415ff5 (patch) | |
| tree | 8cb5ee1feb0516c24ee270fcee5ed00d310aced8 /shared-bindings/busio/UART.c | |
| parent | 2029c4e87e3e71ada07c8be91fe6877edf4a606b (diff) | |
Support internationalisation.
Diffstat (limited to 'shared-bindings/busio/UART.c')
| -rw-r--r-- | shared-bindings/busio/UART.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 1b63d8d0e..359334e5c 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -36,6 +36,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "py/stream.h" +#include "supervisor/shared/translate.h" //| .. currentmodule:: busio @@ -94,7 +95,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, si uint8_t bits = args[ARG_bits].u_int; if (bits < 7 || bits > 9) { - mp_raise_ValueError("bits must be 7, 8 or 9"); + mp_raise_ValueError(translate("bits must be 7, 8 or 9")); } uart_parity_t parity = PARITY_NONE; @@ -106,7 +107,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, si uint8_t stop = args[ARG_stop].u_int; if (stop != 1 && stop != 2) { - mp_raise_ValueError("stop must be 1 or 2"); + mp_raise_ValueError(translate("stop must be 1 or 2")); } common_hal_busio_uart_construct(self, tx, rx, @@ -304,7 +305,7 @@ STATIC const mp_rom_map_elem_t busio_uart_locals_dict_table[] = { // Properties { MP_ROM_QSTR(MP_QSTR_baudrate), MP_ROM_PTR(&busio_uart_baudrate_obj) }, - + // Nested Enum-like Classes. { MP_ROM_QSTR(MP_QSTR_Parity), MP_ROM_PTR(&busio_uart_parity_type) }, }; |
