From a16edbc45ca00b3181bfe68a30a3fd7681393a7f Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 14 May 2020 18:22:07 -0400 Subject: [PATCH 01/19] First semi-functional version of extract_types.py --- tools/extract_types.py | 80 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 tools/extract_types.py diff --git a/tools/extract_types.py b/tools/extract_types.py new file mode 100644 index 0000000000..2e9b0a4965 --- /dev/null +++ b/tools/extract_types.py @@ -0,0 +1,80 @@ +import os +import sys +import astroid +import traceback + +top_level = sys.argv[1].strip("/") + +if top_level.count("/") == 1: + top_level, module = top_level.split("/") + modules = [module] +else: + modules = os.listdir(top_level) + modules = sorted(modules) + +ok = 0 +total = 0 +for module in modules: + module_path = os.path.join(top_level, module) + if not os.path.isdir(module_path): + continue + pyi_lines = [] + classes = os.listdir(module_path) + classes = [x for x in sorted(classes) if x.endswith(".c")] + if classes and classes[-1] == "__init__.c": + classes.insert(0, classes.pop()) + for class_file in classes: + class_path = os.path.join(module_path, class_file) + with open(class_path, "r") as f: + for line in f: + if line.startswith("//|"): + if line[3] == " ": + line = line[4:] + elif line[3] == "\n": + line = line[3:] + else: + continue + pyi_lines.append(line) + + raw_stubs = [x for x in sorted(classes) if x.endswith(".pyi")] + if raw_stubs and raw_stubs[-1] == "__init__.pyi": + raw_stubs.insert(0, raw_stubs.pop()) + for raw_stub in raw_stubs: + raw_stub_path = os.path.join(module_path, raw_stub) + with open(raw_stub_path, "r") as f: + pyi_lines.extend(f.readlines()) + stub_contents = "".join(pyi_lines) + + # Validate that the module is a parseable stub. + total += 1 + try: + tree = astroid.parse(stub_contents) + #print(tree.repr_tree()) + for i in tree.body: + for j in i.body: + if isinstance(j, astroid.scoped_nodes.FunctionDef): + argdict = j.args.__dict__ + a = argdict.pop('lineno') + a = argdict.pop('col_offset') + a = argdict.pop('parent') + print(argdict) + if j.returns: + returndict = j.returns.__dict__ + a = returndict.pop('lineno') + a = returndict.pop('col_offset') + a = returndict.pop('parent') + print(returndict) + print('\n') + #print(tree.body[0].body[0]) + else: + print(type(j)) + ok += 1 + except astroid.exceptions.AstroidSyntaxError as e: + e = e.__cause__ + traceback.print_exception(type(e), e, e.__traceback__) + print() + +print(f"{ok} ok out of {total}") + +if ok != total: + sys.exit(total - ok) From 9613cdd184758421fba558f3d07e58f0b5cb15d1 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 14 May 2020 18:58:28 -0400 Subject: [PATCH 02/19] First fully working version --- tools/extract_types.py | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/tools/extract_types.py b/tools/extract_types.py index 2e9b0a4965..502c69455d 100644 --- a/tools/extract_types.py +++ b/tools/extract_types.py @@ -47,34 +47,40 @@ for module in modules: # Validate that the module is a parseable stub. total += 1 + missing_parameter_type = 0 + total_1 = 0 + missing_return_type = 0 + total_2 = 0 + missing_attribute_type = 0 + total_3 = 0 try: tree = astroid.parse(stub_contents) - #print(tree.repr_tree()) for i in tree.body: for j in i.body: if isinstance(j, astroid.scoped_nodes.FunctionDef): - argdict = j.args.__dict__ - a = argdict.pop('lineno') - a = argdict.pop('col_offset') - a = argdict.pop('parent') - print(argdict) + if None in j.args.__dict__['annotations']: + missing_parameter_type += 1 + total_1 += 1 if j.returns: - returndict = j.returns.__dict__ - a = returndict.pop('lineno') - a = returndict.pop('col_offset') - a = returndict.pop('parent') - print(returndict) - print('\n') - #print(tree.body[0].body[0]) - else: - print(type(j)) + if 'Any' in j.returns.__dict__.values(): + missing_return_type += 1 + total_2 += 1 + elif isinstance(j, astroid.node_classes.AnnAssign): + if 'Any' == j.__dict__['annotation'].__dict__['name']: + missing_attribute_type += 1 + total_3 += 1 + + ok += 1 except astroid.exceptions.AstroidSyntaxError as e: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) print() -print(f"{ok} ok out of {total}") +print(f"{missing_parameter_type} of {total_1} are missing the parameter type") +print(f"{missing_return_type} of {total_2} are missing the return type") +print(f"{missing_attribute_type} of {total_3} are missing the attribute type") + if ok != total: sys.exit(total - ok) From 49cd9ac36e605d85ef393c8c009b90c418305ebe Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 15 May 2020 13:29:41 -0400 Subject: [PATCH 03/19] Made extract_types return a more useful output --- tools/extract_types.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/extract_types.py b/tools/extract_types.py index 502c69455d..f5b9e8613e 100644 --- a/tools/extract_types.py +++ b/tools/extract_types.py @@ -60,14 +60,17 @@ for module in modules: if isinstance(j, astroid.scoped_nodes.FunctionDef): if None in j.args.__dict__['annotations']: missing_parameter_type += 1 + print(f"Parameter: {j.__dict__['name']} on line {j.__dict__['lineno']}") total_1 += 1 if j.returns: if 'Any' in j.returns.__dict__.values(): - missing_return_type += 1 + print(f"Return: {j.__dict__['name']} on line {j.__dict__['lineno']}") + missing_return_type += 1 total_2 += 1 elif isinstance(j, astroid.node_classes.AnnAssign): if 'Any' == j.__dict__['annotation'].__dict__['name']: missing_attribute_type += 1 + print(f"attribute on line {j.__dict__['lineno']}") total_3 += 1 From 416da442c073397112b54c8cc10ef6acc8af3197 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 15 May 2020 13:33:20 -0400 Subject: [PATCH 04/19] Now outputs class name --- tools/extract_types.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/extract_types.py b/tools/extract_types.py index f5b9e8613e..d8de1c193b 100644 --- a/tools/extract_types.py +++ b/tools/extract_types.py @@ -56,6 +56,7 @@ for module in modules: try: tree = astroid.parse(stub_contents) for i in tree.body: + print(i.__dict__['name']) for j in i.body: if isinstance(j, astroid.scoped_nodes.FunctionDef): if None in j.args.__dict__['annotations']: @@ -72,6 +73,7 @@ for module in modules: missing_attribute_type += 1 print(f"attribute on line {j.__dict__['lineno']}") total_3 += 1 + print('\n') ok += 1 From 0e39d4398c95412edd05c7202b7051fe7bd1e2b9 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 15 May 2020 13:55:46 -0400 Subject: [PATCH 05/19] Merged extract_types into extract_pyi --- tools/extract_pyi.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 95370f7619..d6309212a0 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -53,12 +53,29 @@ for module in modules: # Validate that the module is a parseable stub. total += 1 try: - astroid.parse(stub_contents) + tree = astroid.parse(stub_contents) + for i in tree.body: + print(i.__dict__['name']) + for j in i.body: + if isinstance(j, astroid.scoped_nodes.FunctionDef): + a = '' + if None in j.args.__dict__['annotations']: + a += f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n" + if j.returns: + if 'Any' in j.returns.__dict__.values(): + a += f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}" + if a: + raise TypeError(a) + elif isinstance(j, astroid.node_classes.AnnAssign): + if 'Any' == j.__dict__['annotation'].__dict__['name']: + raise TypeError(f"missing attribute type on line {j.__dict__['lineno']}") + ok += 1 except astroid.exceptions.AstroidSyntaxError as e: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) - print() + except TypeError as err: + print(err) print(f"{ok} ok out of {total}") From acf88d7c0089c732222740a26a1d73563d016a13 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 15 May 2020 13:57:13 -0400 Subject: [PATCH 06/19] Removed extract_types.py --- tools/extract_types.py | 91 ------------------------------------------ 1 file changed, 91 deletions(-) delete mode 100644 tools/extract_types.py diff --git a/tools/extract_types.py b/tools/extract_types.py deleted file mode 100644 index d8de1c193b..0000000000 --- a/tools/extract_types.py +++ /dev/null @@ -1,91 +0,0 @@ -import os -import sys -import astroid -import traceback - -top_level = sys.argv[1].strip("/") - -if top_level.count("/") == 1: - top_level, module = top_level.split("/") - modules = [module] -else: - modules = os.listdir(top_level) - modules = sorted(modules) - -ok = 0 -total = 0 -for module in modules: - module_path = os.path.join(top_level, module) - if not os.path.isdir(module_path): - continue - pyi_lines = [] - classes = os.listdir(module_path) - classes = [x for x in sorted(classes) if x.endswith(".c")] - if classes and classes[-1] == "__init__.c": - classes.insert(0, classes.pop()) - for class_file in classes: - class_path = os.path.join(module_path, class_file) - with open(class_path, "r") as f: - for line in f: - if line.startswith("//|"): - if line[3] == " ": - line = line[4:] - elif line[3] == "\n": - line = line[3:] - else: - continue - pyi_lines.append(line) - - raw_stubs = [x for x in sorted(classes) if x.endswith(".pyi")] - if raw_stubs and raw_stubs[-1] == "__init__.pyi": - raw_stubs.insert(0, raw_stubs.pop()) - for raw_stub in raw_stubs: - raw_stub_path = os.path.join(module_path, raw_stub) - with open(raw_stub_path, "r") as f: - pyi_lines.extend(f.readlines()) - stub_contents = "".join(pyi_lines) - - # Validate that the module is a parseable stub. - total += 1 - missing_parameter_type = 0 - total_1 = 0 - missing_return_type = 0 - total_2 = 0 - missing_attribute_type = 0 - total_3 = 0 - try: - tree = astroid.parse(stub_contents) - for i in tree.body: - print(i.__dict__['name']) - for j in i.body: - if isinstance(j, astroid.scoped_nodes.FunctionDef): - if None in j.args.__dict__['annotations']: - missing_parameter_type += 1 - print(f"Parameter: {j.__dict__['name']} on line {j.__dict__['lineno']}") - total_1 += 1 - if j.returns: - if 'Any' in j.returns.__dict__.values(): - print(f"Return: {j.__dict__['name']} on line {j.__dict__['lineno']}") - missing_return_type += 1 - total_2 += 1 - elif isinstance(j, astroid.node_classes.AnnAssign): - if 'Any' == j.__dict__['annotation'].__dict__['name']: - missing_attribute_type += 1 - print(f"attribute on line {j.__dict__['lineno']}") - total_3 += 1 - print('\n') - - - ok += 1 - except astroid.exceptions.AstroidSyntaxError as e: - e = e.__cause__ - traceback.print_exception(type(e), e, e.__traceback__) - print() - -print(f"{missing_parameter_type} of {total_1} are missing the parameter type") -print(f"{missing_return_type} of {total_2} are missing the return type") -print(f"{missing_attribute_type} of {total_3} are missing the attribute type") - - -if ok != total: - sys.exit(total - ok) From cf524cb6b19dc971610452986f1ce8d1001d9d7e Mon Sep 17 00:00:00 2001 From: dherrada <=> Date: Mon, 18 May 2020 18:59:14 -0400 Subject: [PATCH 07/19] extract_pyi no longer raises a TypeError for missing types --- tools/extract_pyi.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index d6309212a0..7c664d9653 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -64,18 +64,16 @@ for module in modules: if j.returns: if 'Any' in j.returns.__dict__.values(): a += f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}" - if a: - raise TypeError(a) elif isinstance(j, astroid.node_classes.AnnAssign): if 'Any' == j.__dict__['annotation'].__dict__['name']: - raise TypeError(f"missing attribute type on line {j.__dict__['lineno']}") + a = f"missing attribute type on line {j.__dict__['lineno']}" + if a: + print(a) ok += 1 except astroid.exceptions.AstroidSyntaxError as e: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) - except TypeError as err: - print(err) print(f"{ok} ok out of {total}") From 58b07ecb43047ca252a031b7ba673ba8d4e0de4e Mon Sep 17 00:00:00 2001 From: dherrada <=> Date: Tue, 19 May 2020 14:50:47 -0400 Subject: [PATCH 08/19] Removed a --- tools/extract_pyi.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 3b30e1ac33..b61e86e4b5 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -57,17 +57,14 @@ def convert_folder(top_level, stub_directory): print(i.__dict__['name']) for j in i.body: if isinstance(j, astroid.scoped_nodes.FunctionDef): - a = '' if None in j.args.__dict__['annotations']: - a += f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n" + print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") if j.returns: if 'Any' in j.returns.__dict__.values(): - a += f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}" + print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}") elif isinstance(j, astroid.node_classes.AnnAssign): if 'Any' == j.__dict__['annotation'].__dict__['name']: - a = f"missing attribute type on line {j.__dict__['lineno']}" - if a: - print(a) + print(f"missing attribute type on line {j.__dict__['lineno']}") ok += 1 except astroid.exceptions.AstroidSyntaxError as e: From 66c09efae287de5cf099dea09288809b922c191d Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 20 May 2020 12:48:01 -0400 Subject: [PATCH 09/19] Add UART one-way instance search, fix bugs in stm32 implementation --- ports/mimxrt10xx/common-hal/busio/SPI.c | 18 +- ports/mimxrt10xx/common-hal/busio/UART.c | 218 ++++++++++++++--------- ports/mimxrt10xx/common-hal/busio/UART.h | 8 +- ports/stm/common-hal/busio/UART.c | 15 +- 4 files changed, 159 insertions(+), 100 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index 15c320140a..54c8d001db 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -91,10 +91,10 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, || (mcu_spi_sck_list[i].bank_idx != mcu_spi_miso_list[k].bank_idx)) { continue; } - //keep looking if the SPI is taken, edge case + // if SPI is taken, break (pins never have >1 periph) if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { spi_taken = true; - continue; + break; } //store pins if not self->clock = &mcu_spi_sck_list[i]; @@ -102,11 +102,11 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->miso = &mcu_spi_miso_list[k]; break; } - if (self->clock != NULL) { + if (self->clock != NULL || spi_taken) { break; // Multi-level break to pick lowest peripheral } } - if (self->clock != NULL) { + if (self->clock != NULL || spi_taken) { break; } // if just MISO, reduce search @@ -118,14 +118,13 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { spi_taken = true; - continue; + break; } self->clock = &mcu_spi_sck_list[i]; - self->mosi = NULL; self->miso = &mcu_spi_miso_list[j]; break; } - if (self->clock != NULL) { + if (self->clock != NULL || spi_taken) { break; } // if just MOSI, reduce search @@ -137,14 +136,13 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { spi_taken = true; - continue; + break; } self->clock = &mcu_spi_sck_list[i]; self->mosi = &mcu_spi_mosi_list[j]; - self->miso = NULL; break; } - if (self->clock != NULL) { + if (self->clock != NULL || spi_taken) { break; } } else { diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index fbb45eeea4..af4328c74b 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -39,7 +39,9 @@ #include "fsl_lpuart.h" -// TODO +//arrays use 0 based numbering: UART is stored at index 0 +#define MAX_UART 8 +STATIC bool reserved_uart[MAX_UART]; #define UART_CLOCK_FREQ (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U) @@ -79,109 +81,161 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { - // TODO: Allow none rx or tx - - bool have_tx = tx != NULL; - bool have_rx = rx != NULL; - if (!have_tx && !have_rx) { - mp_raise_ValueError(translate("tx and rx cannot both be None")); - } - self->baudrate = baudrate; self->character_bits = bits; self->timeout_ms = timeout * 1000; - const uint32_t rx_count = sizeof(mcu_uart_rx_list) / sizeof(mcu_periph_obj_t); - const uint32_t tx_count = sizeof(mcu_uart_tx_list) / sizeof(mcu_periph_obj_t); + bool is_onedirection = false; + if (!rx != !tx) { + is_onedirection = true; + } + bool uart_taken = false; - for (uint32_t i = 0; i < rx_count; ++i) { - if (mcu_uart_rx_list[i].pin != rx) - continue; + const uint32_t rx_count = MP_ARRAY_SIZE(mcu_uart_rx_list); + const uint32_t tx_count = MP_ARRAY_SIZE(mcu_uart_tx_list); - for (uint32_t j = 0; j < tx_count; ++j) { - if (mcu_uart_tx_list[j].pin != tx) + // RX loop handles rx only, or both rx and tx + if (rx != NULL) { + for (uint32_t i = 0; i < rx_count; ++i) { + if (mcu_uart_rx_list[i].pin != rx) { continue; - - if (mcu_uart_tx_list[j].bank_idx != mcu_uart_rx_list[i].bank_idx) + } + // If TX is on, keep looking, else stop + if (tx != NULL) { + for (uint32_t j = 0; j < tx_count; ++j) { + if (mcu_uart_tx_list[j].pin != tx || + mcu_uart_tx_list[j].bank_idx != mcu_uart_rx_list[i].bank_idx) { + continue; + } + // If UART is taken, break (pins never have >1 periph) + if (reserved_uart[mcu_uart_rx_list[i].bank_idx - 1]) { + uart_taken = true; + break; + } + self->rx = &mcu_uart_rx_list[i]; + self->tx = &mcu_uart_tx_list[j]; + break; + } + if (self->tx != NULL || uart_taken) { + break; + } + } else { + if (reserved_uart[mcu_uart_rx_list[i].bank_idx - 1]) { + uart_taken = true; + break; + } + self->rx = &mcu_uart_rx_list[i]; + } + } + } else if (tx != NULL) { + // TX only case + for (uint32_t i = 0; i < tx_count; ++i) { + if (mcu_uart_tx_list[i].pin != tx) { continue; - - self->rx_pin = &mcu_uart_rx_list[i]; - self->tx_pin = &mcu_uart_tx_list[j]; - + } + if (reserved_uart[mcu_uart_tx_list[i].bank_idx - 1]) { + uart_taken = true; + break; + } + self->tx = &mcu_uart_tx_list[i]; break; } + } else { + mp_raise_ValueError(translate("Supply at least one UART pin")); } - if(self->rx_pin == NULL || self->tx_pin == NULL) { + if (uart_taken) { + mp_raise_RuntimeError(translate("UART peripheral is already in use")); + } + + if(self->rx == NULL && self->tx == NULL) { mp_raise_RuntimeError(translate("Invalid UART pin selection")); } + if (is_onedirection && ((rts != NULL) || (cts != NULL))) { + mp_raise_RuntimeError(translate("Both RX and TX required for flow control")); + } + // Filter for sane settings for RS485 if (rs485_dir != NULL) { - if ((rts != NULL) || (cts != NULL)) { - mp_raise_ValueError(translate("Cannot specify RTS or CTS in RS485 mode")); - } - // For IMXRT the RTS pin is used for RS485 direction - rts = rs485_dir; + if ((rts != NULL) || (cts != NULL)) { + mp_raise_ValueError(translate("Cannot specify RTS or CTS in RS485 mode")); + } + // For IMXRT the RTS pin is used for RS485 direction + rts = rs485_dir; } else { - if (rs485_invert) { - mp_raise_ValueError(translate("RS485 inversion specified when not in RS485 mode")); - } + if (rs485_invert) { + mp_raise_ValueError(translate("RS485 inversion specified when not in RS485 mode")); + } } // Now check for RTS/CTS (or overloaded RS485 direction) pin(s) - const uint32_t rts_count = sizeof(mcu_uart_rts_list) / sizeof(mcu_periph_obj_t); - const uint32_t cts_count = sizeof(mcu_uart_cts_list) / sizeof(mcu_periph_obj_t); + const uint32_t rts_count = MP_ARRAY_SIZE(mcu_uart_rts_list); + const uint32_t cts_count = MP_ARRAY_SIZE(mcu_uart_cts_list); if (rts != NULL) { - for (uint32_t i=0; i < rts_count; ++i) { - if (mcu_uart_rts_list[i].bank_idx == self->rx_pin->bank_idx) { - if (mcu_uart_rts_list[i].pin == rts) { - self->rts_pin = &mcu_uart_rts_list[i]; - break; - } + for (uint32_t i=0; i < rts_count; ++i) { + if (mcu_uart_rts_list[i].bank_idx == self->rx->bank_idx) { + if (mcu_uart_rts_list[i].pin == rts) { + self->rts = &mcu_uart_rts_list[i]; + break; + } + } + } + if (self->rts == NULL){ + mp_raise_ValueError(translate("Selected RTS pin not valid")); } - } - if (self->rts_pin == NULL) - mp_raise_ValueError(translate("Selected RTS pin not valid")); } if (cts != NULL) { - for (uint32_t i=0; i < cts_count; ++i) { - if (mcu_uart_cts_list[i].bank_idx == self->rx_pin->bank_idx) { - if (mcu_uart_cts_list[i].pin == cts) { - self->cts_pin = &mcu_uart_cts_list[i]; - break; - } + for (uint32_t i=0; i < cts_count; ++i) { + if (mcu_uart_cts_list[i].bank_idx == self->rx->bank_idx) { + if (mcu_uart_cts_list[i].pin == cts) { + self->cts = &mcu_uart_cts_list[i]; + break; + } + } + } + if (self->cts == NULL){ + mp_raise_ValueError(translate("Selected CTS pin not valid")); } - } - if (self->cts_pin == NULL) - mp_raise_ValueError(translate("Selected CTS pin not valid")); } - self->uart = mcu_uart_banks[self->tx_pin->bank_idx - 1]; + if (self->rx) { + self->uart = mcu_uart_banks[self->rx->bank_idx - 1]; + } else { + self->uart = mcu_uart_banks[self->tx->bank_idx - 1]; + } - config_periph_pin(self->rx_pin); - config_periph_pin(self->tx_pin); - if (self->rts_pin) - config_periph_pin(self->rts_pin); - if (self->cts_pin) - config_periph_pin(self->cts_pin); + if (self->rx) { + config_periph_pin(self->rx); + } + if (self->tx) { + config_periph_pin(self->tx); + } + if (self->rts) { + config_periph_pin(self->rts); + } + if (self->cts) { + config_periph_pin(self->cts); + } lpuart_config_t config = { 0 }; LPUART_GetDefaultConfig(&config); config.dataBitsCount = self->character_bits == 8 ? kLPUART_EightDataBits : kLPUART_SevenDataBits; config.baudRate_Bps = self->baudrate; - config.enableTx = self->tx_pin != NULL; - config.enableRx = self->rx_pin != NULL; - config.enableRxRTS = self->rts_pin != NULL; - config.enableTxCTS = self->cts_pin != NULL; - if (self->rts_pin != NULL) - claim_pin(self->rts_pin->pin); - if (self->cts_pin != NULL) - claim_pin(self->cts_pin->pin); + config.enableTx = self->tx != NULL; + config.enableRx = self->rx != NULL; + config.enableRxRTS = self->rts != NULL; + config.enableTxCTS = self->cts != NULL; + if (self->rts != NULL) { + claim_pin(self->rts->pin); + } + if (self->cts != NULL) { + claim_pin(self->cts->pin); + } LPUART_Init(self->uart, &config, UART_CLOCK_FREQ); @@ -189,16 +243,18 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // ..unfortunately this isn't done by the driver library uint32_t modir = (self->uart->MODIR) & ~(LPUART_MODIR_TXRTSPOL_MASK | LPUART_MODIR_TXRTSE_MASK); if (rs485_dir != NULL) { - modir |= LPUART_MODIR_TXRTSE_MASK; - if (rs485_invert) - modir |= LPUART_MODIR_TXRTSPOL_MASK; + modir |= LPUART_MODIR_TXRTSE_MASK; + if (rs485_invert) { + modir |= LPUART_MODIR_TXRTSPOL_MASK; + } } self->uart->MODIR = modir; - if (self->tx_pin != NULL) - claim_pin(self->tx_pin->pin); + if (self->tx != NULL) { + claim_pin(self->tx->pin); + } - if (self->rx_pin != NULL) { + if (self->rx != NULL) { // The LPUART ring buffer wastes one byte to distinguish between full and empty. self->ringbuf = gc_alloc(receiver_buffer_size + 1, false, true /*long-lived*/); @@ -212,12 +268,12 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // the capacity is one less than the size. LPUART_TransferStartRingBuffer(self->uart, &self->handle, self->ringbuf, receiver_buffer_size + 1); - claim_pin(self->rx_pin->pin); + claim_pin(self->rx->pin); } } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { - return self->rx_pin == NULL && self->tx_pin == NULL; + return self->rx == NULL && self->tx == NULL; } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { @@ -229,16 +285,16 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { gc_free(self->ringbuf); -// reset_pin_number(self->rx_pin); -// reset_pin_number(self->tx_pin); +// reset_pin_number(self->rx); +// reset_pin_number(self->tx); - self->rx_pin = NULL; - self->tx_pin = NULL; + self->rx = NULL; + self->tx = NULL; } // Read characters. size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { - if (self->rx_pin == NULL) { + if (self->rx == NULL) { mp_raise_ValueError(translate("No RX pin")); } @@ -284,7 +340,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t // Write characters. size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, size_t len, int *errcode) { - if (self->tx_pin == NULL) { + if (self->tx == NULL) { mp_raise_ValueError(translate("No TX pin")); } @@ -320,7 +376,7 @@ void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { } bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { - if (self->tx_pin == NULL) { + if (self->tx == NULL) { return false; } diff --git a/ports/mimxrt10xx/common-hal/busio/UART.h b/ports/mimxrt10xx/common-hal/busio/UART.h index 3a326eb3a4..94a5fb02c0 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.h +++ b/ports/mimxrt10xx/common-hal/busio/UART.h @@ -45,10 +45,10 @@ typedef struct { uint32_t baudrate; uint8_t character_bits; uint32_t timeout_ms; - const mcu_periph_obj_t *rx_pin; - const mcu_periph_obj_t *tx_pin; - const mcu_periph_obj_t *cts_pin; - const mcu_periph_obj_t *rts_pin; + const mcu_periph_obj_t *rx; + const mcu_periph_obj_t *tx; + const mcu_periph_obj_t *cts; + const mcu_periph_obj_t *rts; } busio_uart_obj_t; #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_UART_H diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index c83479126a..0dc10c4e4c 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -259,7 +259,7 @@ void common_hal_busio_uart_never_reset(busio_uart_obj_t *self) { } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { - return self->tx->pin == NULL; + return (self->tx->pin == NULL && self->rx->pin == NULL); } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { @@ -272,10 +272,15 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { } } - reset_pin_number(self->tx->pin->port,self->tx->pin->number); - reset_pin_number(self->rx->pin->port,self->rx->pin->number); - self->tx = NULL; - self->rx = NULL; + if (self->tx) { + reset_pin_number(self->tx->pin->port,self->tx->pin->number); + self->tx = NULL; + } + if (self->rx) { + reset_pin_number(self->rx->pin->port,self->rx->pin->number); + self->rx = NULL; + } + ringbuf_free(&self->ringbuf); } From 42baf0061b27dc300ae9247bd44215cdf2f07a92 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 20 May 2020 13:28:17 -0400 Subject: [PATCH 10/19] translations --- locale/ID.po | 15 +++++++++++---- locale/circuitpython.pot | 15 +++++++++++---- locale/cs.po | 15 +++++++++++---- locale/de_DE.po | 15 +++++++++++---- locale/en_US.po | 15 +++++++++++---- locale/en_x_pirate.po | 15 +++++++++++---- locale/es.po | 15 +++++++++++---- locale/fil.po | 15 +++++++++++---- locale/fr.po | 15 +++++++++++---- locale/it_IT.po | 15 +++++++++++---- locale/ko.po | 15 +++++++++++---- locale/nl.po | 15 +++++++++++---- locale/pl.po | 15 +++++++++++---- locale/pt_BR.po | 15 +++++++++++---- locale/sv.po | 15 +++++++++++---- locale/zh_Latn_pinyin.po | 15 +++++++++++---- 16 files changed, 176 insertions(+), 64 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 2bbd602dfb..f7328236e1 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -372,6 +372,10 @@ msgstr "Bit clock dan word harus memiliki kesamaan pada clock unit" msgid "Bit depth must be multiple of 8." msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Kedua pin harus mendukung hardware interrut" @@ -1430,7 +1434,7 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1534,6 +1538,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3087,8 +3095,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx dan rx keduanya tidak boleh kosong" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 7e80e5c9d6..343eef9075 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -368,6 +368,10 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -1414,7 +1418,7 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1518,6 +1522,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3061,8 +3069,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 0537ca14bd..8341513e68 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -368,6 +368,10 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -1414,7 +1418,7 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1518,6 +1522,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3061,8 +3069,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 5bbfd9d403..ec9774f90f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2020-05-18 02:48+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: \n" @@ -375,6 +375,10 @@ msgstr "Bit clock y word select deben compartir una unidad de reloj" msgid "Bit depth must be multiple of 8." msgstr "Bits depth debe ser múltiplo de 8." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Ambos pines deben soportar interrupciones por hardware" @@ -1432,7 +1436,7 @@ msgstr "El tamaño de la pila debe ser de al menos 256" msgid "Stream missing readinto() or write() method." msgstr "A Stream le falta el método readinto() o write()." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1536,6 +1540,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3104,8 +3112,7 @@ msgstr "tupla/lista tiene una longitud incorrecta" msgid "tuple/list required on RHS" msgstr "tuple/lista se require en RHS" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "Ambos tx y rx no pueden ser None" diff --git a/locale/fil.po b/locale/fil.po index b05247f43a..7c58be3f7e 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -374,6 +374,10 @@ msgstr "Ang bit clock at word select dapat makibahagi sa isang clock unit" msgid "Bit depth must be multiple of 8." msgstr "Bit depth ay dapat multiple ng 8." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Ang parehong mga pin ay dapat na sumusuporta sa hardware interrupts" @@ -1437,7 +1441,7 @@ msgstr "Ang laki ng stack ay dapat na hindi bababa sa 256" msgid "Stream missing readinto() or write() method." msgstr "Stream kulang ng readinto() o write() method." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1541,6 +1545,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3117,8 +3125,7 @@ msgstr "mali ang haba ng tuple/list" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx at rx hindi pwedeng parehas na None" diff --git a/locale/fr.po b/locale/fr.po index 481b20604e..b5b0a7580b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: French \n" "Language-Team: \n" @@ -374,6 +374,10 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "La profondità di bit deve essere multipla di 8." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Entrambi i pin devono supportare gli interrupt hardware" @@ -1448,7 +1452,7 @@ msgstr "La dimensione dello stack deve essere almeno 256" msgid "Stream missing readinto() or write() method." msgstr "Metodi mancanti readinto() o write() allo stream." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1552,6 +1556,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3124,8 +3132,7 @@ msgstr "tupla/lista ha la lunghezza sbagliata" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx e rx non possono essere entrambi None" diff --git a/locale/ko.po b/locale/ko.po index 19aad3b9dc..c6e4d52b44 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -372,6 +372,10 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -1418,7 +1422,7 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1522,6 +1526,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3066,8 +3074,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index c948425dab..c6d3de032a 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2020-05-19 17:08+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" @@ -378,6 +378,10 @@ msgstr "Bit clock en word select moeten een clock eenheid delen" msgid "Bit depth must be multiple of 8." msgstr "Bit diepte moet een meervoud van 8 zijn." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Beide pinnen moeten hardware interrupts ondersteunen" @@ -1448,7 +1452,7 @@ msgstr "Stack grootte moet op zijn minst 256 zijn" msgid "Stream missing readinto() or write() method." msgstr "Stream mist readinto() of write() methode." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Geef op zijn minst 1 UART pin op" @@ -1560,6 +1564,10 @@ msgstr "UART Init Fout" msgid "UART Re-init error" msgstr "UART Re-init Fout" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART schrijf fout" @@ -3110,8 +3118,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 212bbba352..5229fd5358 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -371,6 +371,10 @@ msgstr "Zegar bitowy i wybór słowa muszą współdzielić jednostkę zegara" msgid "Bit depth must be multiple of 8." msgstr "Głębia musi być wielokrotnością 8." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Obie nóżki muszą wspierać przerwania sprzętowe" @@ -1419,7 +1423,7 @@ msgstr "Stos musi mieć co najmniej 256 bajtów" msgid "Stream missing readinto() or write() method." msgstr "Strumień nie ma metod readinto() lub write()." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1523,6 +1527,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3072,8 +3080,7 @@ msgstr "krotka/lista ma złą długość" msgid "tuple/list required on RHS" msgstr "wymagana krotka/lista po prawej stronie" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx i rx nie mogą być oba None" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 8a2c9e92ed..3658d91c62 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -371,6 +371,10 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Ambos os pinos devem suportar interrupções de hardware" @@ -1431,7 +1435,7 @@ msgstr "O tamanho da pilha deve ser pelo menos 256" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1535,6 +1539,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3085,8 +3093,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "TX e RX não podem ser ambos" diff --git a/locale/sv.po b/locale/sv.po index 25ed8009fb..e10e7bfc3c 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: LANGUAGE \n" @@ -378,6 +378,10 @@ msgstr "Bitklocka och ordval måste dela en klockenhet" msgid "Bit depth must be multiple of 8." msgstr "Bitdjupet måste vara multipel av 8." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Båda pinnarna måste stödja maskinvaruavbrott" @@ -1445,7 +1449,7 @@ msgstr "Stackstorleken måste vara minst 256" msgid "Stream missing readinto() or write() method." msgstr "Stream saknar readinto() eller write() metod." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Ange minst en UART-pinne" @@ -1557,6 +1561,10 @@ msgstr "UART Init-fel" msgid "UART Re-init error" msgstr "UART reinit-fel" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART skrivfel" @@ -3118,8 +3126,7 @@ msgstr "tupel/lista har fel längd" msgid "tuple/list required on RHS" msgstr "tupel/lista krävs för RHS" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx och rx kan inte båda vara None" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 00a131bbbc..db421973b5 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -377,6 +377,10 @@ msgstr "Bǐtè shízhōng hé dānzì xuǎnzé bìxū gòngxiǎng shízhōng dā msgid "Bit depth must be multiple of 8." msgstr "Bǐtè shēndù bìxū shì 8 bèi yǐshàng." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Liǎng gè yǐn jiǎo dōu bìxū zhīchí yìngjiàn zhōngduàn" @@ -1433,7 +1437,7 @@ msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256" msgid "Stream missing readinto() or write() method." msgstr "Liú quēshǎo readinto() huò write() fāngfǎ." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Dìngyì zhìshǎo yīgè UART yǐn jiǎo" @@ -1544,6 +1548,10 @@ msgstr "UART chūshǐhuà cuòwù" msgid "UART Re-init error" msgstr "UART chóngxīn chūshǐhuà cuòwù" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART xiě cuòwù" @@ -3102,8 +3110,7 @@ msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" msgid "tuple/list required on RHS" msgstr "RHS yāoqiú de yuán zǔ/lièbiǎo" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx hé rx bùnéng dōu shì wú" From 67cb48acbf46b8f9508a6493578e2895c2b75463 Mon Sep 17 00:00:00 2001 From: dherrada <=> Date: Thu, 21 May 2020 18:21:32 -0400 Subject: [PATCH 11/19] Added another except --- tools/extract_pyi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index b61e86e4b5..f0c45dab65 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -70,6 +70,8 @@ def convert_folder(top_level, stub_directory): except astroid.exceptions.AstroidSyntaxError as e: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) + except KeyError: + print("Function does not have a key: Name") print() return ok, total From 75b51429545af57da0f17e983014ef2951370600 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 21 May 2020 11:18:22 -0400 Subject: [PATCH 12/19] Minor style changes and translations --- locale/ID.po | 8 ++------ locale/circuitpython.pot | 8 ++------ locale/cs.po | 8 ++------ locale/de_DE.po | 8 ++------ locale/en_US.po | 8 ++------ locale/en_x_pirate.po | 8 ++------ locale/es.po | 8 ++------ locale/fil.po | 8 ++------ locale/fr.po | 8 ++------ locale/it_IT.po | 8 ++------ locale/ko.po | 8 ++------ locale/nl.po | 8 ++------ locale/pl.po | 8 ++------ locale/pt_BR.po | 8 ++------ locale/sv.po | 8 ++------ locale/zh_Latn_pinyin.po | 8 ++------ ports/mimxrt10xx/common-hal/busio/UART.c | 10 ++++------ 17 files changed, 36 insertions(+), 102 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index f7328236e1..16d7865ff9 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -816,7 +816,7 @@ msgstr "" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1538,10 +1538,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 343eef9075..4b72833a79 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -805,7 +805,7 @@ msgstr "" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1522,10 +1522,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 8341513e68..c333ca8eb7 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -805,7 +805,7 @@ msgstr "" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1522,10 +1522,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index ec9774f90f..6a630d9031 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2020-05-18 02:48+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: \n" @@ -812,7 +812,7 @@ msgstr "Group lleno" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1540,10 +1540,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 7c58be3f7e..6744a4547e 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -819,7 +819,7 @@ msgstr "Puno ang group" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1545,10 +1545,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index b5b0a7580b..19a3cd98d6 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: French \n" "Language-Team: \n" @@ -819,7 +819,7 @@ msgstr "Gruppo pieno" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1556,10 +1556,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index c6e4d52b44..b7af516670 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -809,7 +809,7 @@ msgstr "" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1526,10 +1526,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index c6d3de032a..957fa91fbd 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2020-05-19 17:08+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" @@ -823,7 +823,7 @@ msgstr "Groep is vol" msgid "Hardware busy, try alternative pins" msgstr "Hardware bezig, probeer alternatieve pinnen" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "Hardware in gebruik, probeer alternatieve pinnen" @@ -1564,10 +1564,6 @@ msgstr "UART Init Fout" msgid "UART Re-init error" msgstr "UART Re-init Fout" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART schrijf fout" diff --git a/locale/pl.po b/locale/pl.po index 5229fd5358..80a3b2012e 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -808,7 +808,7 @@ msgstr "Grupa pełna" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1527,10 +1527,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 3658d91c62..1bfb574ed3 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -814,7 +814,7 @@ msgstr "Grupo cheio" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1539,10 +1539,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index e10e7bfc3c..07652af7de 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: LANGUAGE \n" @@ -822,7 +822,7 @@ msgstr "Gruppen är full" msgid "Hardware busy, try alternative pins" msgstr "Hårdvaran är upptagen, prova alternativa pinnar" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "Hårdvaran används redan, prova alternativa pinnar" @@ -1561,10 +1561,6 @@ msgstr "UART Init-fel" msgid "UART Re-init error" msgstr "UART reinit-fel" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART skrivfel" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index db421973b5..58637394ef 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -816,7 +816,7 @@ msgstr "Fēnzǔ yǐ mǎn" msgid "Hardware busy, try alternative pins" msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "Shǐyòng de yìngjiàn, qǐng chángshì qítā yǐn jiǎo" @@ -1548,10 +1548,6 @@ msgstr "UART chūshǐhuà cuòwù" msgid "UART Re-init error" msgstr "UART chóngxīn chūshǐhuà cuòwù" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART xiě cuòwù" diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index af4328c74b..015b0188f4 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -39,7 +39,7 @@ #include "fsl_lpuart.h" -//arrays use 0 based numbering: UART is stored at index 0 +//arrays use 0 based numbering: UART1 is stored at index 0 #define MAX_UART 8 STATIC bool reserved_uart[MAX_UART]; @@ -85,10 +85,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->character_bits = bits; self->timeout_ms = timeout * 1000; - bool is_onedirection = false; - if (!rx != !tx) { - is_onedirection = true; - } + // We are transmitting one direction if one pin is NULL and the other isn't. + bool is_onedirection = (rx != NULL) != (tx != NULL); bool uart_taken = false; const uint32_t rx_count = MP_ARRAY_SIZE(mcu_uart_rx_list); @@ -145,7 +143,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } if (uart_taken) { - mp_raise_RuntimeError(translate("UART peripheral is already in use")); + mp_raise_RuntimeError(translate("Hardware in use, try alternative pins")); } if(self->rx == NULL && self->tx == NULL) { From d6c59c4de017dd0ee2ac7a185c4e21ed164e7416 Mon Sep 17 00:00:00 2001 From: arturo182 Date: Tue, 26 May 2020 22:36:30 +0200 Subject: [PATCH 13/19] mimxrt10xx: Change exception type to match other ports --- ports/mimxrt10xx/common-hal/busio/I2C.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mimxrt10xx/common-hal/busio/I2C.c b/ports/mimxrt10xx/common-hal/busio/I2C.c index 0bb7dcc6c6..cad0fef982 100644 --- a/ports/mimxrt10xx/common-hal/busio/I2C.c +++ b/ports/mimxrt10xx/common-hal/busio/I2C.c @@ -81,7 +81,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } if(self->sda_pin == NULL || self->scl_pin == NULL) { - mp_raise_RuntimeError(translate("Invalid I2C pin selection")); + mp_raise_ValueError(translate("Invalid I2C pin selection")); } else { self->i2c = mcu_i2c_banks[self->sda_pin->bank_idx - 1]; } From 4e22b9a3464bbace0d0cd6d51bf2afaf40cd5722 Mon Sep 17 00:00:00 2001 From: dherrada <=> Date: Wed, 27 May 2020 11:30:51 -0400 Subject: [PATCH 14/19] Better keyerror handling --- tools/extract_pyi.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index f0c45dab65..d749d202b3 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -54,24 +54,24 @@ def convert_folder(top_level, stub_directory): try: tree = astroid.parse(stub_contents) for i in tree.body: - print(i.__dict__['name']) - for j in i.body: - if isinstance(j, astroid.scoped_nodes.FunctionDef): - if None in j.args.__dict__['annotations']: - print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") - if j.returns: - if 'Any' in j.returns.__dict__.values(): - print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}") - elif isinstance(j, astroid.node_classes.AnnAssign): - if 'Any' == j.__dict__['annotation'].__dict__['name']: - print(f"missing attribute type on line {j.__dict__['lineno']}") + if 'name' in i.__dict__: + print(i.__dict__['name']) + for j in i.body: + if isinstance(j, astroid.scoped_nodes.FunctionDef): + if None in j.args.__dict__['annotations']: + print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") + if j.returns: + if 'Any' in j.returns.__dict__.values(): + print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}") + elif isinstance(j, astroid.node_classes.AnnAssign): + if 'name' in j.__dict__['annotation'].__dict__: + if j.__dict__['annotation'].__dict__['name'] == 'Any': + print(f"missing attribute type on line {j.__dict__['lineno']}") ok += 1 except astroid.exceptions.AstroidSyntaxError as e: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) - except KeyError: - print("Function does not have a key: Name") print() return ok, total From d06a7c467195bd3efb1cbc4aef8887160a45b6b3 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 27 May 2020 11:47:15 -0400 Subject: [PATCH 15/19] Correct HiiBot BlueFi USB_PID Donated a PID set for HiiBot BlueFi. --- ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk index ad477e534a..b6614f8b3f 100644 --- a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk +++ b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x0016 +USB_PID = 0x80B2 USB_PRODUCT = "HiiBot BlueFi" USB_MANUFACTURER = "HiiBot" From 1e914ac2b006079661558d5de0742aba1fc5b22e Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 27 May 2020 11:48:52 -0400 Subject: [PATCH 16/19] Change exception text and type --- ports/mimxrt10xx/common-hal/busio/SPI.c | 2 +- ports/mimxrt10xx/common-hal/busio/UART.c | 6 +++--- 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 54c8d001db..cede7b5bdb 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 015b0188f4..2bec667eb7 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 From 2f6e1d85d22a575a4fb93c484749608dd34d8460 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 27 May 2020 11:55:33 -0400 Subject: [PATCH 17/19] more translations --- locale/ID.po | 9 +++++---- locale/circuitpython.pot | 9 +++++---- locale/cs.po | 9 +++++---- locale/de_DE.po | 9 +++++---- locale/en_US.po | 9 +++++---- locale/en_x_pirate.po | 9 +++++---- locale/es.po | 9 +++++---- locale/fil.po | 9 +++++---- locale/fr.po | 9 +++++---- locale/it_IT.po | 9 +++++---- locale/ko.po | 9 +++++---- locale/nl.po | 9 +++++---- locale/pl.po | 9 +++++---- locale/pt_BR.po | 9 +++++---- locale/sv.po | 9 +++++---- locale/zh_Latn_pinyin.po | 9 +++++---- 16 files changed, 80 insertions(+), 64 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index f181c74262..e070d0642e 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -895,11 +895,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frekuensi PWM tidak valid" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -975,7 +975,8 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Pin-pin tidak valid" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 4fbe72000b..eeaaa0a7a9 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -884,11 +884,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -964,7 +964,8 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 7aecaa135c..b4cfed2a90 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -884,11 +884,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -964,7 +964,8 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 7ed8e9aaf1..25476a7a8f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2020-05-18 02:48+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: \n" @@ -893,11 +893,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frecuencia PWM inválida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -973,7 +973,8 @@ msgstr "Pin inválido para canal derecho" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "pines inválidos" diff --git a/locale/fil.po b/locale/fil.po index 4b1075bfef..3f0b7f97ac 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -900,11 +900,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Mali ang PWM frequency" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -980,7 +980,8 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Mali ang pins" diff --git a/locale/fr.po b/locale/fr.po index a73076e68a..aa37383af7 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2020-05-26 19:37+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language-Team: \n" @@ -900,11 +900,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frequenza PWM non valida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -982,7 +982,8 @@ msgstr "Pin non valido per il canale destro" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Pin non validi" diff --git a/locale/ko.po b/locale/ko.po index ddd4166a8e..8e4eb76a5c 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -888,11 +888,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -968,7 +968,8 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "핀이 유효하지 않습니다" diff --git a/locale/nl.po b/locale/nl.po index 581f66bcd5..5ee1b36646 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2020-05-19 17:08+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" @@ -904,11 +904,11 @@ msgstr "Ongeldige I2C pin selectie" msgid "Invalid PWM frequency" msgstr "Ongeldige PWM frequentie" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "Ongeldige SPI pin selectie" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "Ongeldige UART pin selectie" @@ -984,7 +984,8 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Ongeldige pinnen" diff --git a/locale/pl.po b/locale/pl.po index f68b062d15..cf0e0f5648 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -889,11 +889,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Zła częstotliwość PWM" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -969,7 +969,8 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Złe nóżki" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e31fc5a58d..a0c0d9638e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -893,11 +893,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frequência PWM inválida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -975,7 +975,8 @@ msgstr "Pino inválido para canal direito" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Pinos inválidos" diff --git a/locale/sv.po b/locale/sv.po index dac0428fa6..3e50a34d8f 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2020-05-20 18:32+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -903,11 +903,11 @@ msgstr "Ogiltigt val av I2C-pinne" msgid "Invalid PWM frequency" msgstr "Ogiltig PWM-frekvens" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "Ogiltigt val av SPI-pinne" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "Ogiltigt val av UART-pinne" @@ -983,7 +983,8 @@ msgstr "Ogiltig pinne för höger kanal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Ogiltiga pinnar" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 6bae33fc75..87b6787c30 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -897,11 +897,11 @@ msgstr "Wúxiào de I2C yǐn jiǎo xuǎnzé" msgid "Invalid PWM frequency" msgstr "Wúxiào de PWM pínlǜ" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "Wúxiào de SPI yǐn jiǎo xuǎnzé" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "Wúxiào de UART yǐn jiǎo xuǎnzé" @@ -977,7 +977,8 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Wúxiào de yǐn jiǎo" From 9a9cb2e7d31a57f148be45502fcc27e997b3239d Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 27 May 2020 11:59:13 -0400 Subject: [PATCH 18/19] fix submodule desync --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index 76bf96bcb0..dc5445e2f4 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 76bf96bcb0c12ba241ee4ecc175afb257e550d19 +Subproject commit dc5445e2f45cb348a44fe24fc1be4bc8b5ba5bab From 1ed4978620091179dbb082f1848bc221eb6d09bf Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 27 May 2020 10:58:21 -0700 Subject: [PATCH 19/19] Remove NONE from mode enum and doc tweaks --- shared-bindings/watchdog/WatchDogMode.c | 3 +-- shared-bindings/watchdog/WatchDogTimer.c | 14 ++++++++++++++ shared-bindings/watchdog/__init__.c | 10 +++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c index cc75a6ea44..369454c11b 100644 --- a/shared-bindings/watchdog/WatchDogMode.c +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -74,14 +74,13 @@ mp_obj_t watchdog_watchdogmode_type_to_obj(watchdog_watchdogmode_t mode) { } STATIC const mp_rom_map_elem_t watchdog_watchdogmode_locals_dict_table[] = { - {MP_ROM_QSTR(MP_QSTR_NONE), MP_ROM_PTR(&mp_const_none_obj)}, {MP_ROM_QSTR(MP_QSTR_RAISE), MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)}, {MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)}, }; STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogmode_locals_dict, watchdog_watchdogmode_locals_dict_table); STATIC void watchdog_watchdogmode_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { - qstr runmode = MP_QSTR_NONE; + qstr runmode = MP_QSTR_None; if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)) { runmode = MP_QSTR_RAISE; } diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index 5411d0bef5..52bda4c779 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -40,6 +40,20 @@ #include "supervisor/port.h" +//| class WatchDogTimer: +//| """Timer that is used to detect code lock ups and automatically reset the microcontroller +//| when one is detected. +//| +//| A lock up is detected when the watchdog hasn't been fed after a given duration. So, make +//| sure to call `feed` within the timeout. +//| """ +//| + +//| def __init__(self, ): +//| """Not currently dynamically supported. Access the sole instance through `microcontroller.watchdog`.""" +//| ... +//| + //| def feed(self): //| """Feed the watchdog timer. This must be called regularly, otherwise //| the timer will expire.""" diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index d0704b7cf7..76e6317294 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -34,18 +34,14 @@ //| //| The `watchdog` module provides support for a Watchdog Timer. This timer will reset the device //| if it hasn't been fed after a specified amount of time. This is useful to ensure the board -//| has not crashed or locked up. You can enable the watchdog timer using :class:`wdt.WDT`. -//| Note that on some platforms the watchdog timer cannot be disabled once it has been enabled. +//| has not crashed or locked up. Note that on some platforms the watchdog timer cannot be disabled +//| once it has been enabled. //| -//| The WatchDogTimer is used to restart the system when the application crashes and ends +//| The `WatchDogTimer` is used to restart the system when the application crashes and ends //| up into a non recoverable state. Once started it cannot be stopped or //| reconfigured in any way. After enabling, the application must "feed" the //| watchdog periodically to prevent it from expiring and resetting the system. //| -//| Note that this module can't be imported and used directly. The sole -//| instance of :class:`WatchDogTimer` is available at -//| :attr:`microcontroller.watchdog`. -//| //| Example usage:: //| //| from microcontroller import watchdog as w