From 011acf41c0d5c369fabf5a45976c63b433baa546 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 May 2020 10:39:40 -0500 Subject: [PATCH 001/131] nrf: Ensure ticks enabled while playing audio --- ports/nrf/common-hal/audiobusio/I2SOut.c | 7 +++++++ ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 2fa28afac0..9db6504538 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -31,6 +31,7 @@ #include "common-hal/audiobusio/I2SOut.h" #include "shared-bindings/audiobusio/I2SOut.h" #include "shared-module/audiocore/__init__.h" +#include "supervisor/shared/tick.h" #include "py/obj.h" #include "py/runtime.h" @@ -211,6 +212,8 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, NRF_I2S->CONFIG.ALIGN = I2S_CONFIG_ALIGN_ALIGN_Left; NRF_I2S->CONFIG.FORMAT = left_justified ? I2S_CONFIG_FORMAT_FORMAT_Aligned : I2S_CONFIG_FORMAT_FORMAT_I2S; + + supervisor_enable_tick(); } bool common_hal_audiobusio_i2sout_deinited(audiobusio_i2sout_obj_t* self) { @@ -230,6 +233,7 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) { reset_pin_number(self->data_pin_number); self->data_pin_number = 0xff; instance = NULL; + supervisor_disable_tick(); } void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, @@ -340,5 +344,8 @@ void i2s_reset(void) { NRF_I2S->PSEL.LRCK = 0xFFFFFFFF; NRF_I2S->PSEL.SDOUT = 0xFFFFFFFF; NRF_I2S->PSEL.SDIN = 0xFFFFFFFF; + if (instance) { + supervisor_disable_tick(); + } instance = NULL; } diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index 89966b7da9..7fec766fb8 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -36,6 +36,7 @@ #include "shared-bindings/audiopwmio/PWMAudioOut.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/tick.h" #include "supervisor/shared/translate.h" // TODO: This should be the same size as PWMOut.c:pwms[], but there's no trivial way to accomplish that @@ -67,6 +68,7 @@ STATIC void activate_audiopwmout_obj(audiopwmio_pwmaudioout_obj_t *self) { for (size_t i=0; i < MP_ARRAY_SIZE(active_audio); i++) { if (!active_audio[i]) { active_audio[i] = self; + supervisor_enable_tick(); break; } } @@ -77,12 +79,16 @@ STATIC void deactivate_audiopwmout_obj(audiopwmio_pwmaudioout_obj_t *self) { for (size_t i=0; i < MP_ARRAY_SIZE(active_audio); i++) { if (active_audio[i] == self) { active_audio[i] = NULL; + supervisor_disable_tick(); } } } void audiopwmout_reset() { for (size_t i=0; i < MP_ARRAY_SIZE(active_audio); i++) { + if (active_audio[i]) { + supervisor_disable_tick(); + } active_audio[i] = NULL; } } From eb876e21c317e19537eeeb6937b058c17d82d582 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 May 2020 10:40:41 -0500 Subject: [PATCH 002/131] nrf: code style --- ports/nrf/common-hal/audiobusio/I2SOut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 9db6504538..34eecf8d54 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -159,7 +159,7 @@ static void i2s_buffer_fill(audiobusio_i2sout_obj_t* self) { // Find the last frame of real audio data and replicate its samples until // you have 32 bits worth, which is the fundamental unit of nRF I2S DMA - if(buffer != buffer_start) { + if (buffer != buffer_start) { if (self->bytes_per_sample == 1 && self->channel_count == 1) { // For 8-bit mono, 4 copies of the final sample are required self->hold_value = 0x01010101 * *(uint8_t*)(buffer-1); From a16edbc45ca00b3181bfe68a30a3fd7681393a7f Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 14 May 2020 18:22:07 -0400 Subject: [PATCH 003/131] 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 004/131] 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 52b3e1faba958b351dc0bb040b2eee1fabb45007 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 14 May 2020 21:03:49 -0500 Subject: [PATCH 005/131] actions: upload artifacts for stubs & docs --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4216f61392..de3aa5a9e1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,8 +66,16 @@ jobs: working-directory: tests - name: Stubs run: make stubs -j2 + - uses: actions/upload-artifact@v2 + with: + name: stubs + path: circuitpython-stubs* - name: Docs run: sphinx-build -E -W -b html . _build/html + - uses: actions/upload-artifact@v2 + with: + name: docs + path: _build/html - name: Translations run: make check-translate - name: New boards check From 49cd9ac36e605d85ef393c8c009b90c418305ebe Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 15 May 2020 13:29:41 -0400 Subject: [PATCH 006/131] 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 007/131] 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 008/131] 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 009/131] 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 010/131] 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 011/131] 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 012/131] 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 013/131] 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 014/131] 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 015/131] 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 17ef2df2cacc234e98f729ab60c3af9ec02dd08d Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 20 May 2020 20:06:36 +0800 Subject: [PATCH 016/131] nrf: ld: add ARM.exidx to output image With the WDT changes, building Circuit Python results in the following error: /opt/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: section .ARM.exidx LMA [00000000000621c8,00000000000621cf] overlaps section .data LMA [00000000000621c8,0000000000062383] This is because unwinding data is getting generated, but has nowhere to go. Re-enable this data in the linker script so it is saved. Signed-off-by: Sean Cross --- ports/nrf/boards/common.template.ld | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index 9a7df69a47..334a3506e1 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -70,7 +70,6 @@ SECTIONS _etext = .; /* define a global symbol at end of code */ } >FLASH_FIRMWARE - /* .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) @@ -82,7 +81,6 @@ SECTIONS *(.ARM.exidx*) __exidx_end = .; } >FLASH_FIRMWARE - */ /* used by the startup to initialize data */ _sidata = .; From f4719609f7af49697e4b7e0292fc520e39b26daf Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 20 May 2020 20:08:07 +0800 Subject: [PATCH 017/131] wdt: add watchdog support This adds shared bindings for a watchdog timer, based on the API provided by micropython. Signed-off-by: Sean Cross --- py/circuitpy_defns.mk | 7 +- py/circuitpy_mpconfig.h | 8 +++ py/circuitpy_mpconfig.mk | 4 ++ shared-bindings/wdt/WDT.c | 128 +++++++++++++++++++++++++++++++++ shared-bindings/wdt/WDT.h | 47 ++++++++++++ shared-bindings/wdt/__init__.c | 62 ++++++++++++++++ shared-bindings/wdt/__init__.h | 34 +++++++++ 7 files changed, 289 insertions(+), 1 deletion(-) create mode 100644 shared-bindings/wdt/WDT.c create mode 100644 shared-bindings/wdt/WDT.h create mode 100644 shared-bindings/wdt/__init__.c create mode 100644 shared-bindings/wdt/__init__.h diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 9e36f2e6a2..be04dba487 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -241,6 +241,9 @@ endif ifeq ($(CIRCUITPY_USTACK),1) SRC_PATTERNS += ustack/% endif +ifeq ($(CIRCUITPY_WDT),1) +SRC_PATTERNS += wdt/% +endif ifeq ($(CIRCUITPY_PEW),1) SRC_PATTERNS += _pew/% endif @@ -301,7 +304,9 @@ SRC_COMMON_HAL_ALL = \ rtc/RTC.c \ rtc/__init__.c \ supervisor/Runtime.c \ - supervisor/__init__.c + supervisor/__init__.c \ + wdt/__init__.c \ + wdt/WDT.c \ SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 5f2605c92f..50f1139d7a 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -630,6 +630,13 @@ extern const struct _mp_obj_module_t ustack_module; #define RE_MODULE #endif +#if CIRCUITPY_WDT +extern const struct _mp_obj_module_t wdt_module; +#define WDT_MODULE { MP_ROM_QSTR(MP_QSTR_wdt), MP_ROM_PTR(&wdt_module) }, +#else +#define WDT_MODULE +#endif + // Define certain native modules with weak links so they can be replaced with Python // implementations. This list may grow over time. #define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \ @@ -700,6 +707,7 @@ extern const struct _mp_obj_module_t ustack_module; USB_HID_MODULE \ USB_MIDI_MODULE \ USTACK_MODULE \ + WDT_MODULE \ // If weak links are enabled, just include strong links in the main list of modules, // and also include the underscore alternate names. diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 0801540bc0..1b74f45c36 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -228,6 +228,10 @@ CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB) +# watchdog hardware support +CIRCUITPY_WDT ?= 0 +CFLAGS += -DCIRCUITPY_WDT=$(CIRCUITPY_WDT) + # Enabled micropython.native decorator (experimental) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) diff --git a/shared-bindings/wdt/WDT.c b/shared-bindings/wdt/WDT.c new file mode 100644 index 0000000000..edfac897ec --- /dev/null +++ b/shared-bindings/wdt/WDT.c @@ -0,0 +1,128 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Paul Sokolovsky + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "shared-bindings/wdt/__init__.h" +#include "shared-bindings/wdt/WDT.h" + +static wdt_wdt_obj_t *wdt_singleton; + +//| class WDT: +//| """Watchdog Timer""" +//| +//| def __init__(self, ): +//| """This class represents the system's Watchdog Timer. It is a +//| singleton and will always return the same instance.""" +//| ... +//| +STATIC mp_obj_t wdt_wdt_make_new(const mp_obj_type_t *type, size_t n_args, + const mp_obj_t *pos_args, + mp_map_t *kw_args) { + enum { ARG_timeout_ms, ARG_sleep }; + static const mp_arg_t allowed_args[] = { + {MP_QSTR_timeout_ms, MP_ARG_INT | MP_ARG_REQUIRED}, + {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + + if (wdt_singleton) + return wdt_singleton; + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), + allowed_args, args); + + if (args[ARG_timeout_ms].u_int <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + + wdt_wdt_obj_t *self = m_new_obj(wdt_wdt_obj_t); + self->base.type = &wdt_wdt_type; + self->timeout = args[ARG_timeout_ms].u_int; + self->sleep = args[ARG_sleep].u_bool; + + common_hal_wdt_init(self->timeout, self->sleep); + wdt_singleton = self; + return MP_OBJ_FROM_PTR(self); +} + +//| def feed(self): +//| """Feed the watchdog timer. This must be called regularly, otherwise +//| the system will reset.""" +//| ... +//| +STATIC mp_obj_t wdt_wdt_feed(mp_obj_t self_in) { + (void)self_in; + common_hal_wdt_feed(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_feed_obj, wdt_wdt_feed); + +//| def deinit(self): +//| """Stop the watchdog timer. This may raise an error if the watchdog +//| timer cannot be disabled on this platform.""" +//| ... +//| +STATIC mp_obj_t wdt_wdt_deinit(mp_obj_t self_in) { + (void)self_in; + common_hal_wdt_disable(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_deinit_obj, wdt_wdt_deinit); + +//| timeout: int = ... +//| """The maximum number of milliseconds that can elapse between calls +//| to feed()""" +//| +STATIC mp_obj_t wdt_wdt_obj_get_timeout(mp_obj_t self_in) { + wdt_wdt_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_int(self->timeout); +} +MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_obj_get_timeout_obj, wdt_wdt_obj_get_timeout); + +const mp_obj_property_t wdt_wdt_timeout_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&wdt_wdt_obj_get_timeout_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t wdt_wdt_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&wdt_wdt_feed_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&wdt_wdt_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&wdt_wdt_timeout_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(wdt_wdt_locals_dict, wdt_wdt_locals_dict_table); + +const mp_obj_type_t wdt_wdt_type = { + { &mp_type_type }, + .name = MP_QSTR_WDT, + .make_new = wdt_wdt_make_new, + .locals_dict = (mp_obj_dict_t*)&wdt_wdt_locals_dict, +}; diff --git a/shared-bindings/wdt/WDT.h b/shared-bindings/wdt/WDT.h new file mode 100644 index 0000000000..bfd83d482c --- /dev/null +++ b/shared-bindings/wdt/WDT.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Noralf Trønnes + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H + +#include +#include + +extern void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep); +extern void common_hal_wdt_feed(void); +extern void common_hal_wdt_disable(void); + +extern const mp_obj_type_t wdt_wdt_type; + +typedef struct _wdt_wdt_obj_t { + mp_obj_base_t base; + uint32_t timeout; + bool sleep; +} wdt_wdt_obj_t; + +extern const wdt_wdt_obj_t wdt_wdt_obj; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H diff --git a/shared-bindings/wdt/__init__.c b/shared-bindings/wdt/__init__.c new file mode 100644 index 0000000000..a95fa2c539 --- /dev/null +++ b/shared-bindings/wdt/__init__.c @@ -0,0 +1,62 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Paul Sokolovsky + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/runtime.h" +#include "shared-bindings/wdt/__init__.h" +#include "shared-bindings/wdt/WDT.h" + +//| """Watchdog Timer +//| +//| The `wdt` 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 thw watchdog timer using :class:`wdt.WDT`. +//| Note that the watchdog timer cannot be disabled once it has been enabled. +//| +//| The WDT 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. +//| +//| Example usage:: +//| +//| from machine import WDT +//| wdt = WDT(timeout=2000) # enable it with a timeout of 2s +//| wdt.feed()""" +//| + +STATIC const mp_rom_map_elem_t wdt_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_wdt) }, + { MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&wdt_wdt_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(wdt_module_globals, wdt_module_globals_table); + +const mp_obj_module_t wdt_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&wdt_module_globals, +}; diff --git a/shared-bindings/wdt/__init__.h b/shared-bindings/wdt/__init__.h new file mode 100644 index 0000000000..b27452ca5d --- /dev/null +++ b/shared-bindings/wdt/__init__.h @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H + +#include +#include + + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H From abd01c5fbb3005fd30e41407c8f8b9d0dad5ef55 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 20 May 2020 20:09:28 +0800 Subject: [PATCH 018/131] nrf: add watchdog module Add common-hal bindings to allow the watchdog module to be used on nrf platforms. Signed-off-by: Sean Cross --- ports/nrf/common-hal/wdt/WDT.c | 40 +++++++++++++++++++++++++++++ ports/nrf/common-hal/wdt/__init__.c | 0 2 files changed, 40 insertions(+) create mode 100644 ports/nrf/common-hal/wdt/WDT.c create mode 100644 ports/nrf/common-hal/wdt/__init__.c diff --git a/ports/nrf/common-hal/wdt/WDT.c b/ports/nrf/common-hal/wdt/WDT.c new file mode 100644 index 0000000000..172bd33463 --- /dev/null +++ b/ports/nrf/common-hal/wdt/WDT.c @@ -0,0 +1,40 @@ +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/rtc/__init__.h" +#include "nrf_wdt.h" + +#define WDT_RELOAD_COUNT 2 + +void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep) { + unsigned int channel; + nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; + if (pause_during_sleep) { + behaviour = NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT; + } + + nrf_wdt_behaviour_set(NRF_WDT, behaviour); + + uint64_t ticks = (duration * 32768ULL) / 1000; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + nrf_wdt_reload_value_set(NRF_WDT, (uint32_t) ticks); + + for (channel = 0; channel < WDT_RELOAD_COUNT; channel++) { + nrf_wdt_reload_request_enable(NRF_WDT, channel); + } + + nrf_wdt_task_trigger(NRF_WDT, NRF_WDT_TASK_START); +} + +void common_hal_wdt_feed(void) { + unsigned int channel; + for (channel = 0; channel < WDT_RELOAD_COUNT; channel++) { + nrf_wdt_reload_request_set(NRF_WDT, (nrf_wdt_rr_register_t)(NRF_WDT_RR0 + channel)); + } +} + +void common_hal_wdt_disable(void) { + // mp_raise_ValueError(translate("Watchdog timer cannot be disabled -- board will reset shortly")); +} diff --git a/ports/nrf/common-hal/wdt/__init__.c b/ports/nrf/common-hal/wdt/__init__.c new file mode 100644 index 0000000000..e69de29bb2 From fbe1c05832b2924efee9bd650e5c0c118b5846c8 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 20 May 2020 20:10:11 +0800 Subject: [PATCH 019/131] nrf: simmel: enable wdt support This enables WDT support for Simmel. Other platforms cannot yet use WDT because it overflows their flash storage. Enable CIRCUITPY_WDT support for the nrf target. Signed-off-by: Sean Cross --- ports/nrf/boards/simmel/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 36a6fadda2..64ccccc2bf 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -24,6 +24,7 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 1 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 +CIRCUITPY_WDT = 1 # Enable micropython.native #CIRCUITPY_ENABLE_MPY_NATIVE = 1 From c23f151b6b64011a97752b85e97d1d06b70b73d4 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 20 May 2020 23:05:05 +0800 Subject: [PATCH 020/131] nrf: enable wdt for all platforms Signed-off-by: Sean Cross --- ports/nrf/mpconfigport.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index a9ad11bd44..018a955f5b 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -37,6 +37,7 @@ CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_FRAMEBUFFERIO ?= 1 CIRCUITPY_COUNTIO = 0 +CIRCUITPY_WDT ?= 1 # nRF52840-specific From 595f6387c2a4f1c919cfab80b07493820ac0051b Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 13:47:23 +0800 Subject: [PATCH 021/131] watchdog: rename module from `wdt` and move to `microcontroller` This also places it under the `microcontroller` object. Signed-off-by: Sean Cross --- ports/nrf/boards/simmel/mpconfigboard.mk | 2 +- .../nrf/common-hal/microcontroller/__init__.c | 11 +- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 197 ++++++++++++++++++ .../nrf/common-hal/watchdog/WatchDogTimer.h | 22 +- ports/nrf/common-hal/watchdog/__init__.c | 42 ++++ ports/nrf/common-hal/watchdog/__init__.h | 38 ++++ ports/nrf/common-hal/wdt/WDT.c | 40 ---- ports/nrf/mpconfigport.mk | 2 +- py/circuitpy_defns.mk | 8 +- py/circuitpy_mpconfig.h | 9 +- py/circuitpy_mpconfig.mk | 4 +- shared-bindings/microcontroller/__init__.c | 5 + shared-bindings/microcontroller/__init__.h | 5 +- .../watchdog/WatchDogTimer.c | 0 shared-bindings/watchdog/WatchDogTimer.h | 45 ++++ shared-bindings/{wdt => watchdog}/__init__.c | 38 ++-- shared-bindings/{wdt => watchdog}/__init__.h | 10 +- shared-bindings/wdt/WDT.c | 128 ------------ 18 files changed, 384 insertions(+), 222 deletions(-) create mode 100644 ports/nrf/common-hal/watchdog/WatchDogTimer.c rename shared-bindings/wdt/WDT.h => ports/nrf/common-hal/watchdog/WatchDogTimer.h (72%) create mode 100644 ports/nrf/common-hal/watchdog/__init__.c create mode 100644 ports/nrf/common-hal/watchdog/__init__.h delete mode 100644 ports/nrf/common-hal/wdt/WDT.c rename ports/nrf/common-hal/wdt/__init__.c => shared-bindings/watchdog/WatchDogTimer.c (100%) create mode 100644 shared-bindings/watchdog/WatchDogTimer.h rename shared-bindings/{wdt => watchdog}/__init__.c (59%) rename shared-bindings/{wdt => watchdog}/__init__.h (84%) delete mode 100644 shared-bindings/wdt/WDT.c diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 64ccccc2bf..2bca2492fc 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -24,7 +24,7 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 1 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 -CIRCUITPY_WDT = 1 +CIRCUITPY_WATCHDOG = 1 # Enable micropython.native #CIRCUITPY_ENABLE_MPY_NATIVE = 1 diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index 90d97f8689..1dd1cecfbf 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -106,7 +106,6 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }; #if CIRCUITPY_INTERNAL_NVM_SIZE > 0 - // The singleton nvm.ByteArray object. const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { .base = { @@ -117,6 +116,16 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { }; #endif +#if CIRCUITPY_WATCHDOG +// The singleton nvm.WatchDogTimer object. +const watchdog_obj_t common_hal_mcu_watchdog_obj = { + .base = { + .type = &watchdog_type, + }, + .watchdogtimer = (mp_obj_t)&mp_const_none_obj, +}; +#endif + STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_00), MP_ROM_PTR(&pin_P0_00) }, { MP_ROM_QSTR(MP_QSTR_P0_01), MP_ROM_PTR(&pin_P0_01) }, diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c new file mode 100644 index 0000000000..8213f91762 --- /dev/null +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -0,0 +1,197 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/runtime.h" + +#include "common-hal/watchdog/WatchDogTimer.h" +#include "nrf_wdt.h" + +#define WATCHDOG_RELOAD_COUNT 2 + +void common_hal_watchdog_init(uint32_t duration, bool pause_during_sleep) { + unsigned int channel; + nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; + if (pause_during_sleep) { + behaviour = NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT; + } + + nrf_wdt_behaviour_set(NRF_WDT, behaviour); + + uint64_t ticks = (duration * 32768ULL) / 1000; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + nrf_wdt_reload_value_set(NRF_WDT, (uint32_t) ticks); + + for (channel = 0; channel < WATCHDOG_RELOAD_COUNT; channel++) { + nrf_wdt_reload_request_enable(NRF_WDT, channel); + } + + nrf_wdt_task_trigger(NRF_WDT, NRF_WDT_TASK_START); +} + +void common_hal_watchdog_feed(void) { + unsigned int channel; + for (channel = 0; channel < WATCHDOG_RELOAD_COUNT; channel++) { + nrf_wdt_reload_request_set(NRF_WDT, (nrf_wdt_rr_register_t)(NRF_WDT_RR0 + channel)); + } +} + +void common_hal_watchdog_disable(void) { + // mp_raise_ValueError(translate("Watchdog timer cannot be disabled -- board will reset shortly")); +} + +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Paul Sokolovsky + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "shared-bindings/watchdog/__init__.h" +#include "shared-bindings/watchdog/WatchDogTimer.h" + +static watchdog_watchdogtimer_obj_t *wdt_singleton; + +//| class WDT: +//| """Watchdog Timer""" +//| +//| def __init__(self, ): +//| """This class represents the system's Watchdog Timer. It is a +//| singleton and will always return the same instance. +//| +//| """ +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_t n_args, + const mp_obj_t *pos_args, + mp_map_t *kw_args) { + enum { ARG_timeout_ms, ARG_sleep }; + static const mp_arg_t allowed_args[] = { + {MP_QSTR_timeout_ms, MP_ARG_INT | MP_ARG_REQUIRED}, + {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + + if (wdt_singleton) + return wdt_singleton; + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), + allowed_args, args); + + if (args[ARG_timeout_ms].u_int <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + + watchdog_watchdogtimer_obj_t *self = m_new_obj(watchdog_watchdogtimer_obj_t); + self->base.type = &watchdog_watchdogtimer_type; + self->timeout = args[ARG_timeout_ms].u_int; + self->sleep = args[ARG_sleep].u_bool; + + common_hal_watchdog_init(self->timeout, self->sleep); + wdt_singleton = self; + return MP_OBJ_FROM_PTR(self); +} + +//| def feed(self): +//| """Feed the watchdog timer. This must be called regularly, otherwise +//| the system will reset.""" +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { + (void)self_in; + common_hal_watchdog_feed(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watchdogtimer_feed); + +//| def deinit(self): +//| """Stop the watchdog timer. This may raise an error if the watchdog +//| timer cannot be disabled on this platform.""" +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { + (void)self_in; + common_hal_watchdog_disable(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); + +//| timeout: int = ... +//| """The maximum number of milliseconds that can elapse between calls +//| to feed()""" +//| +STATIC mp_obj_t watchdog_watchdogtimer_obj_get_timeout(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_int(self->timeout); +} +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_obj_get_timeout_obj, watchdog_watchdogtimer_obj_get_timeout); + +const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&watchdog_watchdogtimer_obj_get_timeout_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t watchdog_watchdogtimer_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&watchdog_watchdogtimer_feed_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&watchdog_watchdogtimer_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&watchdog_watchdogtimer_timeout_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogtimer_locals_dict, watchdog_watchdogtimer_locals_dict_table); + +const mp_obj_type_t watchdog_watchdogtimer_type = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogTimer, + .make_new = watchdog_watchdogtimer_make_new, + .locals_dict = (mp_obj_dict_t*)&watchdog_watchdogtimer_locals_dict, +}; diff --git a/shared-bindings/wdt/WDT.h b/ports/nrf/common-hal/watchdog/WatchDogTimer.h similarity index 72% rename from shared-bindings/wdt/WDT.h rename to ports/nrf/common-hal/watchdog/WatchDogTimer.h index bfd83d482c..ca57cf8a43 100644 --- a/shared-bindings/wdt/WDT.h +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.h @@ -24,24 +24,16 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H +#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H +#define MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H -#include -#include +#include "py/obj.h" +#include "shared-bindings/watchdog/WatchDogTimer.h" -extern void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep); -extern void common_hal_wdt_feed(void); -extern void common_hal_wdt_disable(void); - -extern const mp_obj_type_t wdt_wdt_type; - -typedef struct _wdt_wdt_obj_t { +typedef struct _watchdog_watchdogtimer_obj_t { mp_obj_base_t base; uint32_t timeout; bool sleep; -} wdt_wdt_obj_t; +} watchdog_watchdogtimer_obj_t; -extern const wdt_wdt_obj_t wdt_wdt_obj; - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H +#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/nrf/common-hal/watchdog/__init__.c b/ports/nrf/common-hal/watchdog/__init__.c new file mode 100644 index 0000000000..4013d1317d --- /dev/null +++ b/ports/nrf/common-hal/watchdog/__init__.c @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "common-hal/watchdog/__init__.h" +#include "common-hal/watchdog/WatchDogTimer.h" + +STATIC const mp_rom_map_elem_t watchdog_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_WatchDogTimer), MP_ROM_PTR(&watchdog_watchdogtimer_type) }, +}; +STATIC MP_DEFINE_CONST_DICT(watchdog_locals_dict, watchdog_locals_dict_table); + +const mp_obj_type_t watchdog_type = { + { &mp_type_type }, + .name = MP_QSTR_watchdog, + // .make_new = watchdog_watchdogtimer_make_new, + .locals_dict = (mp_obj_dict_t*)&watchdog_locals_dict, +}; + diff --git a/ports/nrf/common-hal/watchdog/__init__.h b/ports/nrf/common-hal/watchdog/__init__.h new file mode 100644 index 0000000000..fbfb98eff5 --- /dev/null +++ b/ports/nrf/common-hal/watchdog/__init__.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Noralf Trønnes + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H +#define MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H + +#include "py/obj.h" +#include "shared-bindings/watchdog/__init__.h" + +typedef struct _watchdog_obj_t { + mp_obj_base_t base; + mp_rom_obj_t *watchdogtimer; +} watchdog_obj_t; + +#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H diff --git a/ports/nrf/common-hal/wdt/WDT.c b/ports/nrf/common-hal/wdt/WDT.c deleted file mode 100644 index 172bd33463..0000000000 --- a/ports/nrf/common-hal/wdt/WDT.c +++ /dev/null @@ -1,40 +0,0 @@ -#include "py/obj.h" -#include "py/runtime.h" - -#include "shared-bindings/rtc/__init__.h" -#include "nrf_wdt.h" - -#define WDT_RELOAD_COUNT 2 - -void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep) { - unsigned int channel; - nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; - if (pause_during_sleep) { - behaviour = NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT; - } - - nrf_wdt_behaviour_set(NRF_WDT, behaviour); - - uint64_t ticks = (duration * 32768ULL) / 1000; - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - nrf_wdt_reload_value_set(NRF_WDT, (uint32_t) ticks); - - for (channel = 0; channel < WDT_RELOAD_COUNT; channel++) { - nrf_wdt_reload_request_enable(NRF_WDT, channel); - } - - nrf_wdt_task_trigger(NRF_WDT, NRF_WDT_TASK_START); -} - -void common_hal_wdt_feed(void) { - unsigned int channel; - for (channel = 0; channel < WDT_RELOAD_COUNT; channel++) { - nrf_wdt_reload_request_set(NRF_WDT, (nrf_wdt_rr_register_t)(NRF_WDT_RR0 + channel)); - } -} - -void common_hal_wdt_disable(void) { - // mp_raise_ValueError(translate("Watchdog timer cannot be disabled -- board will reset shortly")); -} diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 018a955f5b..d65df1eb89 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -37,7 +37,7 @@ CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_FRAMEBUFFERIO ?= 1 CIRCUITPY_COUNTIO = 0 -CIRCUITPY_WDT ?= 1 +CIRCUITPY_WATCHDOG ?= 1 # nRF52840-specific diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index be04dba487..13b913075c 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -241,8 +241,8 @@ endif ifeq ($(CIRCUITPY_USTACK),1) SRC_PATTERNS += ustack/% endif -ifeq ($(CIRCUITPY_WDT),1) -SRC_PATTERNS += wdt/% +ifeq ($(CIRCUITPY_WATCHDOG),1) +SRC_PATTERNS += watchdog/% endif ifeq ($(CIRCUITPY_PEW),1) SRC_PATTERNS += _pew/% @@ -305,8 +305,8 @@ SRC_COMMON_HAL_ALL = \ rtc/__init__.c \ supervisor/Runtime.c \ supervisor/__init__.c \ - wdt/__init__.c \ - wdt/WDT.c \ + watchdog/__init__.c \ + watchdog/WatchDogTimer.c \ SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 50f1139d7a..002b60e8a6 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -630,11 +630,9 @@ extern const struct _mp_obj_module_t ustack_module; #define RE_MODULE #endif -#if CIRCUITPY_WDT -extern const struct _mp_obj_module_t wdt_module; -#define WDT_MODULE { MP_ROM_QSTR(MP_QSTR_wdt), MP_ROM_PTR(&wdt_module) }, -#else -#define WDT_MODULE +// This is not a top-level module; it's microcontroller.watchdog. +#if CIRCUITPY_WATCHDOG +extern const struct _mp_obj_module_t watchdog_module; #endif // Define certain native modules with weak links so they can be replaced with Python @@ -707,7 +705,6 @@ extern const struct _mp_obj_module_t wdt_module; USB_HID_MODULE \ USB_MIDI_MODULE \ USTACK_MODULE \ - WDT_MODULE \ // If weak links are enabled, just include strong links in the main list of modules, // and also include the underscore alternate names. diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 1b74f45c36..865654a0d5 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -229,8 +229,8 @@ CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB) # watchdog hardware support -CIRCUITPY_WDT ?= 0 -CFLAGS += -DCIRCUITPY_WDT=$(CIRCUITPY_WDT) +CIRCUITPY_WATCHDOG ?= 0 +CFLAGS += -DCIRCUITPY_WATCHDOG=$(CIRCUITPY_WATCHDOG) # Enabled micropython.native decorator (experimental) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 21e1c90a92..907f1ec0ab 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -167,6 +167,11 @@ STATIC const mp_rom_map_elem_t mcu_module_globals_table[] = { #else { MP_ROM_QSTR(MP_QSTR_nvm), MP_ROM_PTR(&mp_const_none_obj) }, #endif + #if CIRCUITPY_WATCHDOG + { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&common_hal_mcu_watchdog_obj) }, + #else + { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&mp_const_none_obj) }, + #endif { MP_ROM_QSTR(MP_QSTR_RunMode), MP_ROM_PTR(&mcu_runmode_type) }, { MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&mcu_pin_type) }, { MP_ROM_QSTR(MP_QSTR_pin), MP_ROM_PTR(&mcu_pin_module) }, diff --git a/shared-bindings/microcontroller/__init__.h b/shared-bindings/microcontroller/__init__.h index e1487c555a..6d61c527eb 100644 --- a/shared-bindings/microcontroller/__init__.h +++ b/shared-bindings/microcontroller/__init__.h @@ -49,10 +49,13 @@ extern const mcu_processor_obj_t common_hal_mcu_processor_obj; #if CIRCUITPY_INTERNAL_NVM_SIZE > 0 - #include "common-hal/nvm/ByteArray.h" extern const nvm_bytearray_obj_t common_hal_mcu_nvm_obj; +#endif +#if CIRCUITPY_WATCHDOG +#include "common-hal/watchdog/__init__.h" +extern const watchdog_obj_t common_hal_mcu_watchdog_obj; #endif #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER___INIT___H diff --git a/ports/nrf/common-hal/wdt/__init__.c b/shared-bindings/watchdog/WatchDogTimer.c similarity index 100% rename from ports/nrf/common-hal/wdt/__init__.c rename to shared-bindings/watchdog/WatchDogTimer.c diff --git a/shared-bindings/watchdog/WatchDogTimer.h b/shared-bindings/watchdog/WatchDogTimer.h new file mode 100644 index 0000000000..375ca653d7 --- /dev/null +++ b/shared-bindings/watchdog/WatchDogTimer.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Noralf Trønnes + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGTIMER_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGTIMER_H + +#include + +// extern void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep); +// extern void common_hal_wdt_feed(void); +// extern void common_hal_wdt_disable(void); + + +// typedef struct _wdt_wdt_obj_t { +// mp_obj_base_t base; +// uint32_t timeout; +// bool sleep; +// } wdt_wdt_obj_t; + +extern const mp_obj_type_t watchdog_watchdogtimer_type; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGTIMER_H diff --git a/shared-bindings/wdt/__init__.c b/shared-bindings/watchdog/__init__.c similarity index 59% rename from shared-bindings/wdt/__init__.c rename to shared-bindings/watchdog/__init__.c index a95fa2c539..8289bb88ae 100644 --- a/shared-bindings/wdt/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -27,36 +27,40 @@ #include #include "py/runtime.h" -#include "shared-bindings/wdt/__init__.h" -#include "shared-bindings/wdt/WDT.h" +#include "shared-bindings/watchdog/__init__.h" +// #include "shared-bindings/wdt/WDT.h" //| """Watchdog Timer //| -//| The `wdt` module provides support for a Watchdog Timer. This timer will reset the device +//| 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 thw watchdog timer using :class:`wdt.WDT`. -//| Note that the watchdog timer cannot be disabled once it has been enabled. +//| 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. //| -//| The WDT 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 machine import WDT -//| wdt = WDT(timeout=2000) # enable it with a timeout of 2s +//| from microcontroller.watchdog import WatchDogTimer +//| wdt = WatchDogTimer(timeout=2.5) # enable it with a timeout of 2.5 seconds //| wdt.feed()""" //| -STATIC const mp_rom_map_elem_t wdt_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_wdt) }, - { MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&wdt_wdt_type) }, -}; +// STATIC const mp_rom_map_elem_t wdt_module_globals_table[] = { +// { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_wdt) }, +// { MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&wdt_wdt_type) }, +// }; -STATIC MP_DEFINE_CONST_DICT(wdt_module_globals, wdt_module_globals_table); +// STATIC MP_DEFINE_CONST_DICT(wdt_module_globals, wdt_module_globals_table); -const mp_obj_module_t wdt_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&wdt_module_globals, -}; +// const mp_obj_module_t wdt_module = { +// .base = { &mp_type_module }, +// .globals = (mp_obj_dict_t*)&wdt_module_globals, +// }; diff --git a/shared-bindings/wdt/__init__.h b/shared-bindings/watchdog/__init__.h similarity index 84% rename from shared-bindings/wdt/__init__.h rename to shared-bindings/watchdog/__init__.h index b27452ca5d..90426c1e64 100644 --- a/shared-bindings/wdt/__init__.h +++ b/shared-bindings/watchdog/__init__.h @@ -24,11 +24,9 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H -#define MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H -#include -#include +extern const mp_obj_type_t watchdog_type; - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H diff --git a/shared-bindings/wdt/WDT.c b/shared-bindings/wdt/WDT.c deleted file mode 100644 index edfac897ec..0000000000 --- a/shared-bindings/wdt/WDT.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "py/obj.h" -#include "py/objproperty.h" -#include "py/runtime.h" -#include "shared-bindings/wdt/__init__.h" -#include "shared-bindings/wdt/WDT.h" - -static wdt_wdt_obj_t *wdt_singleton; - -//| class WDT: -//| """Watchdog Timer""" -//| -//| def __init__(self, ): -//| """This class represents the system's Watchdog Timer. It is a -//| singleton and will always return the same instance.""" -//| ... -//| -STATIC mp_obj_t wdt_wdt_make_new(const mp_obj_type_t *type, size_t n_args, - const mp_obj_t *pos_args, - mp_map_t *kw_args) { - enum { ARG_timeout_ms, ARG_sleep }; - static const mp_arg_t allowed_args[] = { - {MP_QSTR_timeout_ms, MP_ARG_INT | MP_ARG_REQUIRED}, - {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - - if (wdt_singleton) - return wdt_singleton; - - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), - allowed_args, args); - - if (args[ARG_timeout_ms].u_int <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - - wdt_wdt_obj_t *self = m_new_obj(wdt_wdt_obj_t); - self->base.type = &wdt_wdt_type; - self->timeout = args[ARG_timeout_ms].u_int; - self->sleep = args[ARG_sleep].u_bool; - - common_hal_wdt_init(self->timeout, self->sleep); - wdt_singleton = self; - return MP_OBJ_FROM_PTR(self); -} - -//| def feed(self): -//| """Feed the watchdog timer. This must be called regularly, otherwise -//| the system will reset.""" -//| ... -//| -STATIC mp_obj_t wdt_wdt_feed(mp_obj_t self_in) { - (void)self_in; - common_hal_wdt_feed(); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_feed_obj, wdt_wdt_feed); - -//| def deinit(self): -//| """Stop the watchdog timer. This may raise an error if the watchdog -//| timer cannot be disabled on this platform.""" -//| ... -//| -STATIC mp_obj_t wdt_wdt_deinit(mp_obj_t self_in) { - (void)self_in; - common_hal_wdt_disable(); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_deinit_obj, wdt_wdt_deinit); - -//| timeout: int = ... -//| """The maximum number of milliseconds that can elapse between calls -//| to feed()""" -//| -STATIC mp_obj_t wdt_wdt_obj_get_timeout(mp_obj_t self_in) { - wdt_wdt_obj_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_int(self->timeout); -} -MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_obj_get_timeout_obj, wdt_wdt_obj_get_timeout); - -const mp_obj_property_t wdt_wdt_timeout_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&wdt_wdt_obj_get_timeout_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -STATIC const mp_rom_map_elem_t wdt_wdt_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&wdt_wdt_feed_obj) }, - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&wdt_wdt_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&wdt_wdt_timeout_obj) }, -}; -STATIC MP_DEFINE_CONST_DICT(wdt_wdt_locals_dict, wdt_wdt_locals_dict_table); - -const mp_obj_type_t wdt_wdt_type = { - { &mp_type_type }, - .name = MP_QSTR_WDT, - .make_new = wdt_wdt_make_new, - .locals_dict = (mp_obj_dict_t*)&wdt_wdt_locals_dict, -}; From 8f46133917c07c75bde4efdc96f83f18070642e4 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 17:46:01 +0800 Subject: [PATCH 022/131] nrf: watchdog: implement software watchdogtimer This adds a software WatchDogTimer implementation that can be used for testing. Signed-off-by: Sean Cross --- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 223 +++++++++++++----- ports/nrf/common-hal/watchdog/WatchDogTimer.h | 3 +- 2 files changed, 166 insertions(+), 60 deletions(-) diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 8213f91762..300ac77122 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -24,15 +24,47 @@ * THE SOFTWARE. */ + +#include +#include + #include "py/obj.h" +#include "py/objproperty.h" #include "py/runtime.h" #include "common-hal/watchdog/WatchDogTimer.h" + +#include "shared-bindings/watchdog/__init__.h" +#include "shared-bindings/watchdog/WatchDogTimer.h" + #include "nrf_wdt.h" +#include "nrfx_timer.h" +#include "nrf/timers.h" +STATIC watchdog_watchdogtimer_obj_t *wdt_singleton; +STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in); +STATIC uint8_t timer_refcount = 0; #define WATCHDOG_RELOAD_COUNT 2 +STATIC nrfx_timer_t *timer = NULL; -void common_hal_watchdog_init(uint32_t duration, bool pause_during_sleep) { +const mp_obj_type_t mp_type_WatchDogTimeout = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogTimeout, + .make_new = mp_obj_exception_make_new, + .attr = mp_obj_exception_attr, + .parent = &mp_type_Exception, +}; + +static mp_obj_exception_t mp_watchdog_timeout_exception = { + .base.type = &mp_type_WatchDogTimeout, + .traceback_alloc = 0, + .traceback_len = 0, + .traceback_data = NULL, + .args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj, +}; + + +STATIC void watchdogtimer_hardware_init(mp_float_t duration, bool pause_during_sleep) { unsigned int channel; nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; if (pause_during_sleep) { @@ -41,7 +73,7 @@ void common_hal_watchdog_init(uint32_t duration, bool pause_during_sleep) { nrf_wdt_behaviour_set(NRF_WDT, behaviour); - uint64_t ticks = (duration * 32768ULL) / 1000; + uint64_t ticks = duration * 32768ULL; if (ticks > UINT32_MAX) { mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); } @@ -54,52 +86,38 @@ void common_hal_watchdog_init(uint32_t duration, bool pause_during_sleep) { nrf_wdt_task_trigger(NRF_WDT, NRF_WDT_TASK_START); } -void common_hal_watchdog_feed(void) { +STATIC void watchdogtimer_hardware_feed(void) { unsigned int channel; for (channel = 0; channel < WATCHDOG_RELOAD_COUNT; channel++) { nrf_wdt_reload_request_set(NRF_WDT, (nrf_wdt_rr_register_t)(NRF_WDT_RR0 + channel)); } } -void common_hal_watchdog_disable(void) { - // mp_raise_ValueError(translate("Watchdog timer cannot be disabled -- board will reset shortly")); +STATIC void watchdogtimer_event_handler(nrf_timer_event_t event_type, void *p_context) { + (void)p_context; + if (event_type != NRF_TIMER_EVENT_COMPARE0) { + // Spurious event. + return; + } + + // If the timer hits without being cleared, pause the timer and raise an exception. + nrfx_timer_pause(timer); + mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&mp_watchdog_timeout_exception)); + MP_STATE_VM(mp_pending_exception) = &mp_watchdog_timeout_exception; +#if MICROPY_ENABLE_SCHEDULER + if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) { + MP_STATE_VM(sched_state) = MP_SCHED_PENDING; + } +#endif } -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "py/obj.h" -#include "py/objproperty.h" -#include "py/runtime.h" -#include "shared-bindings/watchdog/__init__.h" -#include "shared-bindings/watchdog/WatchDogTimer.h" - -static watchdog_watchdogtimer_obj_t *wdt_singleton; +void watchdog_watchdogtimer_reset(void) { + if (timer != NULL) { + nrf_peripherals_free_timer(timer); + } + timer = NULL; + timer_refcount = 0; +} //| class WDT: //| """Watchdog Timer""" @@ -114,31 +132,79 @@ static watchdog_watchdogtimer_obj_t *wdt_singleton; STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_timeout_ms, ARG_sleep }; + enum { ARG_timeout, ARG_sleep, ARG_hardware }; static const mp_arg_t allowed_args[] = { - {MP_QSTR_timeout_ms, MP_ARG_INT | MP_ARG_REQUIRED}, + {MP_QSTR_timeout, MP_ARG_OBJ | MP_ARG_REQUIRED}, {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, + {MP_QSTR_hardware, MP_ARG_BOOL, {.u_bool = false}}, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - if (wdt_singleton) - return wdt_singleton; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); + bool hardware = args[ARG_hardware].u_bool; + bool sleep = args[ARG_sleep].u_bool; - if (args[ARG_timeout_ms].u_int <= 0) { + // If the hardware timer is already running, return that timer. + // If the parameters have changed, then ignore them, but print + // an error. + if (wdt_singleton && hardware) { + if ((sleep != wdt_singleton->sleep) + || (hardware != wdt_singleton->hardware) + || fabsf(timeout - wdt_singleton->timeout) > 0.01f) { + // Print a warning indicating things aren't quite right + // mp_printf(&mp_stderr_print, translate("warning: hardware timer was already running")); + } + watchdogtimer_hardware_feed(); + return wdt_singleton; + } + + if (timeout <= 0) { mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); } watchdog_watchdogtimer_obj_t *self = m_new_obj(watchdog_watchdogtimer_obj_t); self->base.type = &watchdog_watchdogtimer_type; - self->timeout = args[ARG_timeout_ms].u_int; - self->sleep = args[ARG_sleep].u_bool; + self->timeout = timeout; + self->sleep = sleep; + self->hardware = hardware; - common_hal_watchdog_init(self->timeout, self->sleep); - wdt_singleton = self; - return MP_OBJ_FROM_PTR(self); + if (hardware) { + watchdogtimer_hardware_init(self->timeout, self->sleep); + wdt_singleton = self; + } else { + uint64_t ticks = timeout * 31250ULL; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + + if (timer_refcount == 0) { + timer = nrf_peripherals_allocate_timer_or_throw(); + } + timer_refcount++; + + nrfx_timer_config_t timer_config = { + .frequency = NRF_TIMER_FREQ_31250Hz, + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_32, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + .p_context = self, + }; + + nrfx_timer_init(timer, &timer_config, &watchdogtimer_event_handler); + + // true enables interrupt. + nrfx_timer_clear(timer); + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); + nrfx_timer_resume(timer); + } + + // Feed the watchdog, in case there's a timer that's already running + // and it's only partially finished. + mp_obj_t *self_obj = MP_OBJ_FROM_PTR(self); + watchdog_watchdogtimer_feed(self_obj); + return self_obj; } //| def feed(self): @@ -147,8 +213,13 @@ STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_ //| ... //| STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { - (void)self_in; - common_hal_watchdog_feed(); + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if (self->hardware) { + watchdogtimer_hardware_feed(); + } else { + nrfx_timer_clear(timer); + } return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watchdogtimer_feed); @@ -159,8 +230,16 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watch //| ... //| STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { - (void)self_in; - common_hal_watchdog_disable(); + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if (!self->hardware) { + timer_refcount--; + if (timer_refcount == 0) { + nrf_peripherals_free_timer(timer); + timer = NULL; + } + } + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); @@ -169,23 +248,49 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_wat //| """The maximum number of milliseconds that can elapse between calls //| to feed()""" //| -STATIC mp_obj_t watchdog_watchdogtimer_obj_get_timeout(mp_obj_t self_in) { +STATIC mp_obj_t watchdog_watchdogtimer_get_timeout(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_int(self->timeout); + return mp_obj_new_float(self->timeout); } -MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_obj_get_timeout_obj, watchdog_watchdogtimer_obj_get_timeout); +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_timeout_obj, watchdog_watchdogtimer_get_timeout); const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&watchdog_watchdogtimer_obj_get_timeout_obj, + .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_timeout_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; +mp_obj_t watchdog_watchdogtimer___enter__(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if (!self->hardware) { + nrfx_timer_resume(timer); + } + watchdog_watchdogtimer_feed(self_in); + return self_in; +} +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer___enter___obj, watchdog_watchdogtimer___enter__); + +STATIC mp_obj_t watchdog_watchdogtimer___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(args[0]); + if (!self->hardware) { + if (timer) { + nrfx_timer_pause(timer); + } + } + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(watchdog_watchdogtimer___exit___obj, 4, 4, watchdog_watchdogtimer___exit__); + STATIC const mp_rom_map_elem_t watchdog_watchdogtimer_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&watchdog_watchdogtimer_feed_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&watchdog_watchdogtimer_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&watchdog_watchdogtimer_timeout_obj) }, + // { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mp_stream_close_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&watchdog_watchdogtimer___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&watchdog_watchdogtimer___exit___obj) }, }; STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogtimer_locals_dict, watchdog_watchdogtimer_locals_dict_table); diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.h b/ports/nrf/common-hal/watchdog/WatchDogTimer.h index ca57cf8a43..c59796820d 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.h +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.h @@ -32,8 +32,9 @@ typedef struct _watchdog_watchdogtimer_obj_t { mp_obj_base_t base; - uint32_t timeout; + mp_float_t timeout; bool sleep; + bool hardware; } watchdog_watchdogtimer_obj_t; #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H From 87737fb50ac23760ad11f5d23d87dd9020ab5f20 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 18:38:48 +0800 Subject: [PATCH 023/131] watchdog: fix documentation build error Signed-off-by: Sean Cross --- shared-bindings/watchdog/__init__.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index 8289bb88ae..21e87d515a 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -28,7 +28,6 @@ #include "py/runtime.h" #include "shared-bindings/watchdog/__init__.h" -// #include "shared-bindings/wdt/WDT.h" //| """Watchdog Timer //| @@ -44,7 +43,7 @@ //| //| Note that this module can't be imported and used directly. The sole //| instance of :class:`WatchDogTimer` is available at -//| :attr:`microcontroller.watchdog`.""" +//| :attr:`microcontroller.watchdog`. //| //| Example usage:: //| @@ -52,15 +51,3 @@ //| wdt = WatchDogTimer(timeout=2.5) # enable it with a timeout of 2.5 seconds //| wdt.feed()""" //| - -// STATIC const mp_rom_map_elem_t wdt_module_globals_table[] = { -// { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_wdt) }, -// { MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&wdt_wdt_type) }, -// }; - -// STATIC MP_DEFINE_CONST_DICT(wdt_module_globals, wdt_module_globals_table); - -// const mp_obj_module_t wdt_module = { -// .base = { &mp_type_module }, -// .globals = (mp_obj_dict_t*)&wdt_module_globals, -// }; From 0169ea5155d553094d33613e94a6c597ee2e0860 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 18:39:13 +0800 Subject: [PATCH 024/131] nrf: discard arm exception sections Since these exceptions are unused, don't include them in the output binary. Signed-off-by: Sean Cross --- ports/nrf/boards/common.template.ld | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index 334a3506e1..5982b8ba0d 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -70,18 +70,6 @@ SECTIONS _etext = .; /* define a global symbol at end of code */ } >FLASH_FIRMWARE - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } >FLASH_FIRMWARE - - .ARM : - { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH_FIRMWARE - /* used by the startup to initialize data */ _sidata = .; @@ -145,6 +133,14 @@ SECTIONS . = ALIGN(4); } >RAM + /* Remove exception unwinding information, since Circuit Python + does not support this GCC feature. */ + /DISCARD/ : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + *(.ARM.exidx*) + } + /* Remove information from the standard libraries */ /* /DISCARD/ : From ae950bc050fc9c7ee675d0a4d52f352ebc24a369 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 20:45:03 +0800 Subject: [PATCH 025/131] add WatchDogTimeout exception This adds an exception to be raised when the WatchDogTimer times out. Note that this currently causes a HardFault, and it's not clear why it's not behaving properly. Signed-off-by: Sean Cross --- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 25 +++++-------------- py/modbuiltins.c | 3 +++ py/mpstate.h | 5 ++++ py/obj.h | 3 +++ py/objexcept.c | 3 +++ py/runtime.c | 9 +++++++ 6 files changed, 29 insertions(+), 19 deletions(-) diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 300ac77122..148146b01f 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -47,23 +47,6 @@ STATIC uint8_t timer_refcount = 0; #define WATCHDOG_RELOAD_COUNT 2 STATIC nrfx_timer_t *timer = NULL; -const mp_obj_type_t mp_type_WatchDogTimeout = { - { &mp_type_type }, - .name = MP_QSTR_WatchDogTimeout, - .make_new = mp_obj_exception_make_new, - .attr = mp_obj_exception_attr, - .parent = &mp_type_Exception, -}; - -static mp_obj_exception_t mp_watchdog_timeout_exception = { - .base.type = &mp_type_WatchDogTimeout, - .traceback_alloc = 0, - .traceback_len = 0, - .traceback_data = NULL, - .args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj, -}; - - STATIC void watchdogtimer_hardware_init(mp_float_t duration, bool pause_during_sleep) { unsigned int channel; nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; @@ -93,6 +76,10 @@ STATIC void watchdogtimer_hardware_feed(void) { } } +NORETURN void mp_raise_WatchDogTimeout(void) { + nlr_raise(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); +} + STATIC void watchdogtimer_event_handler(nrf_timer_event_t event_type, void *p_context) { (void)p_context; if (event_type != NRF_TIMER_EVENT_COMPARE0) { @@ -102,8 +89,7 @@ STATIC void watchdogtimer_event_handler(nrf_timer_event_t event_type, void *p_co // If the timer hits without being cleared, pause the timer and raise an exception. nrfx_timer_pause(timer); - mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&mp_watchdog_timeout_exception)); - MP_STATE_VM(mp_pending_exception) = &mp_watchdog_timeout_exception; + MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception)); #if MICROPY_ENABLE_SCHEDULER if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) { MP_STATE_VM(sched_state) = MP_SCHED_PENDING; @@ -139,6 +125,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_ {MP_QSTR_hardware, MP_ARG_BOOL, {.u_bool = false}}, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); diff --git a/py/modbuiltins.c b/py/modbuiltins.c index e764f1987e..b031ce9fe0 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -719,6 +719,9 @@ STATIC const mp_rom_map_elem_t mp_module_builtins_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_IndexError), MP_ROM_PTR(&mp_type_IndexError) }, { MP_ROM_QSTR(MP_QSTR_KeyboardInterrupt), MP_ROM_PTR(&mp_type_KeyboardInterrupt) }, { MP_ROM_QSTR(MP_QSTR_ReloadException), MP_ROM_PTR(&mp_type_ReloadException) }, + #if CIRCUITPY_WATCHDOG + { MP_ROM_QSTR(MP_QSTR_WatchDogTimeout), MP_ROM_PTR(&mp_type_WatchDogTimeout) }, + #endif { MP_ROM_QSTR(MP_QSTR_KeyError), MP_ROM_PTR(&mp_type_KeyError) }, { MP_ROM_QSTR(MP_QSTR_LookupError), MP_ROM_PTR(&mp_type_LookupError) }, { MP_ROM_QSTR(MP_QSTR_MemoryError), MP_ROM_PTR(&mp_type_MemoryError) }, diff --git a/py/mpstate.h b/py/mpstate.h index a5815776a4..5d3b7709b3 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -141,6 +141,11 @@ typedef struct _mp_state_vm_t { // exception object of type ReloadException mp_obj_exception_t mp_reload_exception; + #if CIRCUITPY_WATCHDOG + // exception object of type WatchdogTimeout + mp_obj_exception_t mp_watchdog_exception; + #endif + // dictionary with loaded modules (may be exposed as sys.modules) mp_obj_dict_t mp_loaded_modules_dict; diff --git a/py/obj.h b/py/obj.h index fa315d12f7..cabe5498db 100644 --- a/py/obj.h +++ b/py/obj.h @@ -596,6 +596,9 @@ extern const mp_obj_type_t mp_type_IndentationError; extern const mp_obj_type_t mp_type_IndexError; extern const mp_obj_type_t mp_type_KeyboardInterrupt; extern const mp_obj_type_t mp_type_ReloadException; +#if CIRCUITPY_WATCHDOG +extern const mp_obj_type_t mp_type_WatchDogTimeout; +#endif extern const mp_obj_type_t mp_type_KeyError; extern const mp_obj_type_t mp_type_LookupError; extern const mp_obj_type_t mp_type_MemoryError; diff --git a/py/objexcept.c b/py/objexcept.c index b7a536c5e3..db09d51538 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -256,6 +256,9 @@ const mp_obj_type_t mp_type_BaseException = { MP_DEFINE_EXCEPTION(SystemExit, BaseException) MP_DEFINE_EXCEPTION(KeyboardInterrupt, BaseException) MP_DEFINE_EXCEPTION(ReloadException, BaseException) +#if CIRCUITPY_WATCHDOG +MP_DEFINE_EXCEPTION(WatchDogTimeout, BaseException) +#endif MP_DEFINE_EXCEPTION(GeneratorExit, BaseException) MP_DEFINE_EXCEPTION(Exception, BaseException) #if MICROPY_PY_ASYNC_AWAIT diff --git a/py/runtime.c b/py/runtime.c index 59dcbc7a1c..02352ea6c7 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -86,6 +86,15 @@ void mp_init(void) { MP_STATE_VM(mp_kbd_exception).args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj; #endif + #if CIRCUITPY_WATCHDOG + // initialise the exception object for raising WatchDogTimeout + MP_STATE_VM(mp_kbd_exception).base.type = &mp_type_WatchDogTimeout; + MP_STATE_VM(mp_kbd_exception).traceback_alloc = 0; + MP_STATE_VM(mp_kbd_exception).traceback_len = 0; + MP_STATE_VM(mp_kbd_exception).traceback_data = NULL; + MP_STATE_VM(mp_kbd_exception).args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj; + #endif + MP_STATE_VM(mp_reload_exception).base.type = &mp_type_ReloadException; MP_STATE_VM(mp_reload_exception).traceback_alloc = 0; MP_STATE_VM(mp_reload_exception).traceback_len = 0; From ec99dae95384fa08e4b1bc72273f1d34c6d646bb Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 21:33:43 +0800 Subject: [PATCH 026/131] tick: break on watchdog timeout exception Signed-off-by: Sean Cross --- supervisor/shared/tick.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index dc38e76f61..0e2adf2160 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -96,7 +96,8 @@ void mp_hal_delay_ms(mp_uint_t delay) { RUN_BACKGROUND_TASKS; // Check to see if we've been CTRL-Ced by autoreload or the user. if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { + MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || + MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))) { break; } remaining = end_tick - port_get_raw_ticks(NULL); From 08362c9cabce24ffdc2bd6018ab7fc3e9e6e4801 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 12:35:29 +0800 Subject: [PATCH 027/131] watchdogtimer: refactor to new api This refactors the WatchDogTimer API to use the format proposed in https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632268227 Signed-off-by: Sean Cross --- .../nrf/common-hal/microcontroller/__init__.c | 10 +- ports/nrf/common-hal/watchdog/WatchDogMode.c | 0 ports/nrf/common-hal/watchdog/WatchDogTimer.c | 256 ++++++++++-------- ports/nrf/common-hal/watchdog/WatchDogTimer.h | 3 +- ports/nrf/common-hal/watchdog/__init__.c | 17 -- py/circuitpy_defns.mk | 1 + py/circuitpy_mpconfig.h | 4 + shared-bindings/microcontroller/__init__.c | 2 +- shared-bindings/microcontroller/__init__.h | 4 +- shared-bindings/watchdog/WatchDogMode.c | 88 ++++++ shared-bindings/watchdog/WatchDogMode.h | 47 ++++ shared-bindings/watchdog/__init__.c | 21 +- shared-bindings/watchdog/__init__.h | 2 +- 13 files changed, 307 insertions(+), 148 deletions(-) create mode 100644 ports/nrf/common-hal/watchdog/WatchDogMode.c create mode 100644 shared-bindings/watchdog/WatchDogMode.c create mode 100644 shared-bindings/watchdog/WatchDogMode.h diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index 1dd1cecfbf..187b46ad1b 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -117,12 +117,14 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { #endif #if CIRCUITPY_WATCHDOG -// The singleton nvm.WatchDogTimer object. -const watchdog_obj_t common_hal_mcu_watchdog_obj = { +// The singleton watchdog.WatchDogTimer object. +watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj = { .base = { - .type = &watchdog_type, + .type = &watchdog_watchdogtimer_type, }, - .watchdogtimer = (mp_obj_t)&mp_const_none_obj, + .timeout = 0.0f, + .sleep = false, + .mode = WATCHDOGMODE_NONE, }; #endif diff --git a/ports/nrf/common-hal/watchdog/WatchDogMode.c b/ports/nrf/common-hal/watchdog/WatchDogMode.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 148146b01f..28a96138f5 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -41,8 +41,6 @@ #include "nrfx_timer.h" #include "nrf/timers.h" -STATIC watchdog_watchdogtimer_obj_t *wdt_singleton; -STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in); STATIC uint8_t timer_refcount = 0; #define WATCHDOG_RELOAD_COUNT 2 STATIC nrfx_timer_t *timer = NULL; @@ -80,7 +78,7 @@ NORETURN void mp_raise_WatchDogTimeout(void) { nlr_raise(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); } -STATIC void watchdogtimer_event_handler(nrf_timer_event_t event_type, void *p_context) { +STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void *p_context) { (void)p_context; if (event_type != NRF_TIMER_EVENT_COMPARE0) { // Spurious event. @@ -105,107 +103,20 @@ void watchdog_watchdogtimer_reset(void) { timer_refcount = 0; } -//| class WDT: -//| """Watchdog Timer""" -//| -//| def __init__(self, ): -//| """This class represents the system's Watchdog Timer. It is a -//| singleton and will always return the same instance. -//| -//| """ -//| ... -//| -STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_t n_args, - const mp_obj_t *pos_args, - mp_map_t *kw_args) { - enum { ARG_timeout, ARG_sleep, ARG_hardware }; - static const mp_arg_t allowed_args[] = { - {MP_QSTR_timeout, MP_ARG_OBJ | MP_ARG_REQUIRED}, - {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, - {MP_QSTR_hardware, MP_ARG_BOOL, {.u_bool = false}}, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); - - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), - allowed_args, args); - mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); - bool hardware = args[ARG_hardware].u_bool; - bool sleep = args[ARG_sleep].u_bool; - - // If the hardware timer is already running, return that timer. - // If the parameters have changed, then ignore them, but print - // an error. - if (wdt_singleton && hardware) { - if ((sleep != wdt_singleton->sleep) - || (hardware != wdt_singleton->hardware) - || fabsf(timeout - wdt_singleton->timeout) > 0.01f) { - // Print a warning indicating things aren't quite right - // mp_printf(&mp_stderr_print, translate("warning: hardware timer was already running")); - } - watchdogtimer_hardware_feed(); - return wdt_singleton; - } - - if (timeout <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - - watchdog_watchdogtimer_obj_t *self = m_new_obj(watchdog_watchdogtimer_obj_t); - self->base.type = &watchdog_watchdogtimer_type; - self->timeout = timeout; - self->sleep = sleep; - self->hardware = hardware; - - if (hardware) { - watchdogtimer_hardware_init(self->timeout, self->sleep); - wdt_singleton = self; - } else { - uint64_t ticks = timeout * 31250ULL; - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - - if (timer_refcount == 0) { - timer = nrf_peripherals_allocate_timer_or_throw(); - } - timer_refcount++; - - nrfx_timer_config_t timer_config = { - .frequency = NRF_TIMER_FREQ_31250Hz, - .mode = NRF_TIMER_MODE_TIMER, - .bit_width = NRF_TIMER_BIT_WIDTH_32, - .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, - .p_context = self, - }; - - nrfx_timer_init(timer, &timer_config, &watchdogtimer_event_handler); - - // true enables interrupt. - nrfx_timer_clear(timer); - nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); - nrfx_timer_resume(timer); - } - - // Feed the watchdog, in case there's a timer that's already running - // and it's only partially finished. - mp_obj_t *self_obj = MP_OBJ_FROM_PTR(self); - watchdog_watchdogtimer_feed(self_obj); - return self_obj; -} - //| def feed(self): //| """Feed the watchdog timer. This must be called regularly, otherwise -//| the system will reset.""" +//| the timer will expire.""" //| ... //| STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - if (self->hardware) { + if (self->mode == WATCHDOGMODE_RESET) { watchdogtimer_hardware_feed(); - } else { + } else if (self->mode == WATCHDOGMODE_RAISE) { nrfx_timer_clear(timer); + } else if (self->mode == WATCHDOGMODE_NONE) { + mp_raise_ValueError(translate("WatchDogTimer is not currently running")); } return mp_const_none; } @@ -219,71 +130,178 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watch STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - if (!self->hardware) { + if (self->mode == WATCHDOGMODE_RAISE) { timer_refcount--; if (timer_refcount == 0) { nrf_peripherals_free_timer(timer); timer = NULL; } + } else if (self->mode == WATCHDOGMODE_RESET) { + mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); } return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); -//| timeout: int = ... -//| """The maximum number of milliseconds that can elapse between calls +//| timeout: float = ... +//| """The maximum number of seconds that can elapse between calls //| to feed()""" //| -STATIC mp_obj_t watchdog_watchdogtimer_get_timeout(mp_obj_t self_in) { +STATIC mp_obj_t watchdog_watchdogtimer_obj_get_timeout(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_float(self->timeout); } -MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_timeout_obj, watchdog_watchdogtimer_get_timeout); +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_timeout_obj, watchdog_watchdogtimer_obj_get_timeout); + +STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_t timeout_obj) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_float_t timeout = mp_obj_get_float(timeout_obj); + + if (timeout <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + + if (self->mode == WATCHDOGMODE_RESET) { + // If the WatchDogTimer is already running in "RESET" mode, raise an error + // since the mode cannot be changed once started. + mp_raise_TypeError(translate("Cannot change the timeout once mode is WatchDogMode.RESET")); + } else if (self->mode == WATCHDOGMODE_RAISE) { + // If the WatchDogTimer is already running in "RAISE" mode, reset the timer + // with the new value. + uint64_t ticks = timeout * 31250ULL; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + nrfx_timer_clear(timer); + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); + } + + self->timeout = timeout; + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_timeout_obj, watchdog_watchdogtimer_obj_set_timeout); const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { .base.type = &mp_type_property, .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_timeout_obj, - (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&watchdog_watchdogtimer_set_timeout_obj, (mp_obj_t)&mp_const_none_obj}, }; -mp_obj_t watchdog_watchdogtimer___enter__(mp_obj_t self_in) { +//| mode: watchdog.WatchDogMode = ... +//| """The current operating mode of the WatchDogTimer `watchdog.WatchDogMode`. +//| +//| Setting a WatchDogMode activates the WatchDog:: +//| +//| import microcontroller +//| import watchdog +//| +//| w = microcontroller.watchdog +//| w.timeout = 5 +//| w.mode = watchdog.WatchDogMode.RAISE +//| +//| +//| Once set, the WatchDogTimer will perform the specified action if the timer expires. +//| +STATIC mp_obj_t watchdog_watchdogtimer_obj_get_mode(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - - if (!self->hardware) { - nrfx_timer_resume(timer); + switch (self->mode) { + case WATCHDOGMODE_NONE: default: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_none_obj); + case WATCHDOGMODE_RAISE: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_raise_obj); + case WATCHDOGMODE_RESET: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_reset_obj); } - watchdog_watchdogtimer_feed(self_in); - return self_in; } -MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer___enter___obj, watchdog_watchdogtimer___enter__); +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_mode_obj, watchdog_watchdogtimer_obj_get_mode); -STATIC mp_obj_t watchdog_watchdogtimer___exit__(size_t n_args, const mp_obj_t *args) { - (void)n_args; - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(args[0]); - if (!self->hardware) { - if (timer) { - nrfx_timer_pause(timer); +STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t mode_obj) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + watchdog_watchdogmode_obj_t *mode = MP_OBJ_TO_PTR(mode_obj); + if (mode == MP_ROM_PTR(&watchdog_watchdogmode_none_obj)) { + if (self->mode == WATCHDOGMODE_RESET) { + mp_raise_TypeError(translate("WatchDogTimer mode cannot be changed once set to WatchDogMode.RESET")); } + else if (self->mode == WATCHDOGMODE_RAISE) { + timer_refcount--; + if (timer_refcount == 0) { + nrf_peripherals_free_timer(timer); + timer = NULL; + } + } + self->mode = WATCHDOGMODE_NONE; + + } else if (mode == MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)) { + if (self->timeout <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + if (self->mode == WATCHDOGMODE_RESET) { + mp_raise_ValueError(translate("WatchDogTimer mode cannot be changed once set to WatchDogMode.RESET")); + } + else if (self->mode == WATCHDOGMODE_NONE) { + uint64_t ticks = self->timeout * 31250ULL; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + + if (timer_refcount == 0) { + timer = nrf_peripherals_allocate_timer_or_throw(); + } + timer_refcount++; + + nrfx_timer_config_t timer_config = { + .frequency = NRF_TIMER_FREQ_31250Hz, + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_32, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + .p_context = self, + }; + + nrfx_timer_init(timer, &timer_config, &watchdogtimer_timer_event_handler); + + // true enables interrupt. + nrfx_timer_clear(timer); + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); + nrfx_timer_resume(timer); + } + self->mode = WATCHDOGMODE_RAISE; + + } else if (mode == MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)) { + if (self->timeout <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + if (self->mode == WATCHDOGMODE_RAISE) { + timer_refcount--; + if (timer_refcount == 0) { + nrf_peripherals_free_timer(timer); + timer = NULL; + } + } + watchdogtimer_hardware_init(self->timeout, self->sleep); + self->mode = WATCHDOGMODE_RESET; } + return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(watchdog_watchdogtimer___exit___obj, 4, 4, watchdog_watchdogtimer___exit__); +MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_mode_obj, watchdog_watchdogtimer_obj_set_mode); + +const mp_obj_property_t watchdog_watchdogtimer_mode_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_mode_obj, + (mp_obj_t)&watchdog_watchdogtimer_set_mode_obj, + (mp_obj_t)&mp_const_none_obj}, +}; STATIC const mp_rom_map_elem_t watchdog_watchdogtimer_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&watchdog_watchdogtimer_feed_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&watchdog_watchdogtimer_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&watchdog_watchdogtimer_timeout_obj) }, - // { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mp_stream_close_obj) }, - { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&watchdog_watchdogtimer___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&watchdog_watchdogtimer___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_mode), MP_ROM_PTR(&watchdog_watchdogtimer_mode_obj) }, }; STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogtimer_locals_dict, watchdog_watchdogtimer_locals_dict_table); const mp_obj_type_t watchdog_watchdogtimer_type = { { &mp_type_type }, .name = MP_QSTR_WatchDogTimer, - .make_new = watchdog_watchdogtimer_make_new, + // .make_new = watchdog_watchdogtimer_make_new, .locals_dict = (mp_obj_dict_t*)&watchdog_watchdogtimer_locals_dict, }; diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.h b/ports/nrf/common-hal/watchdog/WatchDogTimer.h index c59796820d..4176944696 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.h +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.h @@ -29,12 +29,13 @@ #include "py/obj.h" #include "shared-bindings/watchdog/WatchDogTimer.h" +#include "shared-bindings/watchdog/WatchDogMode.h" typedef struct _watchdog_watchdogtimer_obj_t { mp_obj_base_t base; mp_float_t timeout; bool sleep; - bool hardware; + watchdog_watchdogmode_t mode; } watchdog_watchdogtimer_obj_t; #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/nrf/common-hal/watchdog/__init__.c b/ports/nrf/common-hal/watchdog/__init__.c index 4013d1317d..79875d1279 100644 --- a/ports/nrf/common-hal/watchdog/__init__.c +++ b/ports/nrf/common-hal/watchdog/__init__.c @@ -23,20 +23,3 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#include "py/obj.h" -#include "common-hal/watchdog/__init__.h" -#include "common-hal/watchdog/WatchDogTimer.h" - -STATIC const mp_rom_map_elem_t watchdog_locals_dict_table[] = { - {MP_ROM_QSTR(MP_QSTR_WatchDogTimer), MP_ROM_PTR(&watchdog_watchdogtimer_type) }, -}; -STATIC MP_DEFINE_CONST_DICT(watchdog_locals_dict, watchdog_locals_dict_table); - -const mp_obj_type_t watchdog_type = { - { &mp_type_type }, - .name = MP_QSTR_watchdog, - // .make_new = watchdog_watchdogtimer_make_new, - .locals_dict = (mp_obj_dict_t*)&watchdog_locals_dict, -}; - diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 13b913075c..d77559912f 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -306,6 +306,7 @@ SRC_COMMON_HAL_ALL = \ supervisor/Runtime.c \ supervisor/__init__.c \ watchdog/__init__.c \ + watchdog/WatchDogMode.c \ watchdog/WatchDogTimer.c \ SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 002b60e8a6..0b5547058b 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -633,6 +633,9 @@ extern const struct _mp_obj_module_t ustack_module; // This is not a top-level module; it's microcontroller.watchdog. #if CIRCUITPY_WATCHDOG extern const struct _mp_obj_module_t watchdog_module; +#define WATCHDOG_MODULE { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&watchdog_module) }, +#else +#define WATCHDOG_MODULE #endif // Define certain native modules with weak links so they can be replaced with Python @@ -705,6 +708,7 @@ extern const struct _mp_obj_module_t watchdog_module; USB_HID_MODULE \ USB_MIDI_MODULE \ USTACK_MODULE \ + WATCHDOG_MODULE \ // If weak links are enabled, just include strong links in the main list of modules, // and also include the underscore alternate names. diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 907f1ec0ab..88fe9c2245 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -168,7 +168,7 @@ STATIC const mp_rom_map_elem_t mcu_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_nvm), MP_ROM_PTR(&mp_const_none_obj) }, #endif #if CIRCUITPY_WATCHDOG - { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&common_hal_mcu_watchdog_obj) }, + { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&common_hal_mcu_watchdogtimer_obj) }, #else { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&mp_const_none_obj) }, #endif diff --git a/shared-bindings/microcontroller/__init__.h b/shared-bindings/microcontroller/__init__.h index 6d61c527eb..8abdff763c 100644 --- a/shared-bindings/microcontroller/__init__.h +++ b/shared-bindings/microcontroller/__init__.h @@ -54,8 +54,8 @@ extern const nvm_bytearray_obj_t common_hal_mcu_nvm_obj; #endif #if CIRCUITPY_WATCHDOG -#include "common-hal/watchdog/__init__.h" -extern const watchdog_obj_t common_hal_mcu_watchdog_obj; +#include "common-hal/watchdog/WatchDogTimer.h" +extern watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj; #endif #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER___INIT___H diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c new file mode 100644 index 0000000000..c5c4b23bc3 --- /dev/null +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -0,0 +1,88 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Sean Cross for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/watchdog/WatchDogMode.h" + +//| class WatchDogMode: +//| """run state of the watchdog timer""" +//| +//| def __init__(self, ): +//| """Enum-like class to define the run mode of the watchdog timer.""" +//| +//| NONE: Any = ... +//| """Take no action if the watchdog timer expires. +//| +//| :type watchdog.WatchDogMode:""" +//| +//| RAISE: Any = ... +//| """Raise an exception when the WatchDogTimer expires. +//| +//| :type watchdog.WatchDogMode:""" +//| +//| RESET: Any = ... +//| """Reset the system if the WatchDogTimer expires. +//| +//| :type watchdog.WatchDogMode:""" +//| +const mp_obj_type_t watchdog_watchdogmode_type; + +const watchdog_watchdogmode_obj_t watchdog_watchdogmode_none_obj = { + { &watchdog_watchdogmode_type }, +}; + +const watchdog_watchdogmode_obj_t watchdog_watchdogmode_raise_obj = { + { &watchdog_watchdogmode_type }, +}; + +const watchdog_watchdogmode_obj_t watchdog_watchdogmode_reset_obj = { + { &watchdog_watchdogmode_type }, +}; + +STATIC const mp_rom_map_elem_t watchdog_watchdogmode_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_NONE), MP_ROM_PTR(&watchdog_watchdogmode_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; + if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)) { + runmode = MP_QSTR_RAISE; + } + else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)) { + runmode = MP_QSTR_RESET; + } + mp_printf(print, "%q.%q.%q", MP_QSTR_watchdog, MP_QSTR_WatchDogMode, + runmode); +} + +const mp_obj_type_t watchdog_watchdogmode_type = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogMode, + .print = watchdog_watchdogmode_print, + .locals_dict = (mp_obj_t)&watchdog_watchdogmode_locals_dict, +}; diff --git a/shared-bindings/watchdog/WatchDogMode.h b/shared-bindings/watchdog/WatchDogMode.h new file mode 100644 index 0000000000..77bf58db63 --- /dev/null +++ b/shared-bindings/watchdog/WatchDogMode.h @@ -0,0 +1,47 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Sean Cross for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGMODE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGMODE_H + +#include "py/obj.h" + +typedef enum { + WATCHDOGMODE_NONE, + WATCHDOGMODE_RAISE, + WATCHDOGMODE_RESET, +} watchdog_watchdogmode_t; + +const mp_obj_type_t watchdog_watchdogmode_type; + +typedef struct { + mp_obj_base_t base; +} watchdog_watchdogmode_obj_t; +extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_none_obj; +extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_raise_obj; +extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_reset_obj; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGMODE_H diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index 21e87d515a..36993db936 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -28,6 +28,7 @@ #include "py/runtime.h" #include "shared-bindings/watchdog/__init__.h" +#include "shared-bindings/watchdog/WatchDogMode.h" //| """Watchdog Timer //| @@ -47,7 +48,21 @@ //| //| Example usage:: //| -//| from microcontroller.watchdog import WatchDogTimer -//| wdt = WatchDogTimer(timeout=2.5) # enable it with a timeout of 2.5 seconds -//| wdt.feed()""" +//| from microcontroller import watchdog as w +//| from watchdog import WatchDogMode +//| w.timeout=2.5 # Set a timeout of 2.5 seconds +//| w.mode = WatchDogMode.RAISE +//| w.feed()""" //| + +STATIC const mp_rom_map_elem_t watchdog_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_watchdog) }, + { MP_ROM_QSTR(MP_QSTR_WatchDogMode), MP_ROM_PTR(&watchdog_watchdogmode_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(watchdog_module_globals, watchdog_module_globals_table); + +const mp_obj_module_t watchdog_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&watchdog_module_globals, +}; diff --git a/shared-bindings/watchdog/__init__.h b/shared-bindings/watchdog/__init__.h index 90426c1e64..7203b8aa51 100644 --- a/shared-bindings/watchdog/__init__.h +++ b/shared-bindings/watchdog/__init__.h @@ -27,6 +27,6 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H #define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H -extern const mp_obj_type_t watchdog_type; +extern const mp_obj_module_t watchdog_module; #endif // MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H From 8c5df5f7329f84c005d217d18148b616f55b942f Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 12:56:14 +0800 Subject: [PATCH 028/131] supervisor: add a new WATCHDOG_RESET safe mode reason This mode will be used if the board is reset due to the watchdog expiring. Signed-off-by: Sean Cross --- supervisor/shared/safe_mode.c | 3 +++ supervisor/shared/safe_mode.h | 1 + 2 files changed, 4 insertions(+) diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index c957aee534..a167ab392c 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -160,6 +160,9 @@ void print_safe_mode_message(safe_mode_t reason) { case MEM_MANAGE: serial_write_compressed(translate("Invalid memory access.")); break; + case WATCHDOG_RESET: + serial_write_compressed(translate("Watchdog timer expired.")); + break; default: serial_write_compressed(translate("Unknown reason.")); break; diff --git a/supervisor/shared/safe_mode.h b/supervisor/shared/safe_mode.h index 5b09c4b543..c160739aec 100644 --- a/supervisor/shared/safe_mode.h +++ b/supervisor/shared/safe_mode.h @@ -41,6 +41,7 @@ typedef enum { NORDIC_SOFT_DEVICE_ASSERT, FLASH_WRITE_FAIL, MEM_MANAGE, + WATCHDOG_RESET, } safe_mode_t; safe_mode_t wait_for_safe_mode_reset(void); From e738f5eaa13c0e30dc082c511d9659c5f35e7f7e Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 12:56:49 +0800 Subject: [PATCH 029/131] nrf: boot into safe mode sometimes for watchdog reset If the watchdog resets the system and we're plugged into USB, boot into safe mode. Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 36725293c8..89797e6dcb 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -131,6 +131,21 @@ safe_mode_t port_init(void) { analogin_init(); #endif + // If the board was reset by the WatchDogTimer, we may + // need to boot into safe mode. Reset the RESETREAS bit + // for the WatchDogTimer so we don't encounter this the + // next time we reboot. + if (NRF_POWER->RESETREAS & POWER_RESETREAS_DOG_Msk) { + NRF_POWER->RESETREAS = POWER_RESETREAS_DOG_Msk; + uint32_t usb_reg = NRF_POWER->USBREGSTATUS; + + // If USB is connected, then the user might be editing `code.py`, + // in which case we should reboot into Safe Mode. + if (usb_reg & POWER_USBREGSTATUS_VBUSDETECT_Msk) { + return WATCHDOG_RESET; + } + } + return NO_SAFE_MODE; } From 589cb1af6de04a01e1cfda1082fea4f6fbc4440c Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 17:29:54 +0800 Subject: [PATCH 030/131] nrf: watchdog: use nrfx_wdt driver Instead of directly poking registers, use `nrfx_wdt`. Signed-off-by: Sean Cross --- ports/nrf/Makefile | 1 + ports/nrf/common-hal/watchdog/WatchDogTimer.c | 71 ++++++++++--------- ports/nrf/nrfx_config.h | 7 ++ ports/nrf/nrfx_glue.h | 8 +-- 4 files changed, 49 insertions(+), 38 deletions(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 8a7b1104b9..e5931af5ee 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -136,6 +136,7 @@ SRC_NRFX = $(addprefix nrfx/,\ drivers/src/nrfx_gpiote.c \ drivers/src/nrfx_rtc.c \ drivers/src/nrfx_nvmc.c \ + drivers/src/nrfx_wdt.c \ ) ifdef EXTERNAL_FLASH_DEVICES diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 28a96138f5..358fab7987 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -37,42 +37,17 @@ #include "shared-bindings/watchdog/__init__.h" #include "shared-bindings/watchdog/WatchDogTimer.h" -#include "nrf_wdt.h" -#include "nrfx_timer.h" +#include "supervisor/port.h" + #include "nrf/timers.h" +#include "nrf_wdt.h" +#include "nrfx_wdt.h" +#include "nrfx_timer.h" STATIC uint8_t timer_refcount = 0; -#define WATCHDOG_RELOAD_COUNT 2 STATIC nrfx_timer_t *timer = NULL; - -STATIC void watchdogtimer_hardware_init(mp_float_t duration, bool pause_during_sleep) { - unsigned int channel; - nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; - if (pause_during_sleep) { - behaviour = NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT; - } - - nrf_wdt_behaviour_set(NRF_WDT, behaviour); - - uint64_t ticks = duration * 32768ULL; - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - nrf_wdt_reload_value_set(NRF_WDT, (uint32_t) ticks); - - for (channel = 0; channel < WATCHDOG_RELOAD_COUNT; channel++) { - nrf_wdt_reload_request_enable(NRF_WDT, channel); - } - - nrf_wdt_task_trigger(NRF_WDT, NRF_WDT_TASK_START); -} - -STATIC void watchdogtimer_hardware_feed(void) { - unsigned int channel; - for (channel = 0; channel < WATCHDOG_RELOAD_COUNT; channel++) { - nrf_wdt_reload_request_set(NRF_WDT, (nrf_wdt_rr_register_t)(NRF_WDT_RR0 + channel)); - } -} +STATIC nrfx_wdt_t wdt = NRFX_WDT_INSTANCE(0); +STATIC nrfx_wdt_channel_id wdt_channel_id; NORETURN void mp_raise_WatchDogTimeout(void) { nlr_raise(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); @@ -95,6 +70,12 @@ STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void #endif } +// This function is called if the timer expires. The system will reboot in 1/16384 of a second. +// Issue a reboot ourselves so we can do any cleanup necessary. +STATIC void watchdogtimer_watchdog_event_handler(void) { + reset_cpu(); +} + void watchdog_watchdogtimer_reset(void) { if (timer != NULL) { nrf_peripherals_free_timer(timer); @@ -112,7 +93,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); if (self->mode == WATCHDOGMODE_RESET) { - watchdogtimer_hardware_feed(); + nrfx_wdt_feed(&wdt); } else if (self->mode == WATCHDOGMODE_RAISE) { nrfx_timer_clear(timer); } else if (self->mode == WATCHDOGMODE_NONE) { @@ -276,7 +257,29 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t m timer = NULL; } } - watchdogtimer_hardware_init(self->timeout, self->sleep); + + uint64_t ticks = self->timeout * 1000.0f; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + + nrfx_wdt_config_t config = { + .reload_value = ticks, // in units of ms + .behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP, + NRFX_WDT_IRQ_CONFIG + }; + + nrfx_err_t err_code; + err_code = nrfx_wdt_init(&wdt, &config, watchdogtimer_watchdog_event_handler); + if (err_code != NRFX_SUCCESS) { + mp_raise_OSError(1); + } + err_code = nrfx_wdt_channel_alloc(&wdt, &wdt_channel_id); + if (err_code != NRFX_SUCCESS) { + mp_raise_OSError(1); + } + nrfx_wdt_enable(&wdt); + nrfx_wdt_feed(&wdt); self->mode = WATCHDOGMODE_RESET; } diff --git a/ports/nrf/nrfx_config.h b/ports/nrf/nrfx_config.h index 7a7f2e6d64..2dcdba14c6 100644 --- a/ports/nrf/nrfx_config.h +++ b/ports/nrf/nrfx_config.h @@ -122,4 +122,11 @@ // NVM controller #define NRFX_NVMC_ENABLED 1 +// Watchdog timer +#define NRFX_WDT_ENABLED 1 +#define NRFX_WDT0_ENABLED 1 +// This IRQ indicates the system will reboot shortly, so give +// it a high priority. +#define NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY 1 + #endif // NRFX_CONFIG_H__ diff --git a/ports/nrf/nrfx_glue.h b/ports/nrf/nrfx_glue.h index 345de38704..9f91b72a14 100644 --- a/ports/nrf/nrfx_glue.h +++ b/ports/nrf/nrfx_glue.h @@ -180,17 +180,17 @@ static inline bool _NRFX_IRQ_IS_PENDING(IRQn_Type irq_number) return (NVIC_GetPendingIRQ(irq_number) == 1); } -//#include -//#include +void common_hal_mcu_disable_interrupts(void); +void common_hal_mcu_enable_interrupts(void); /** * @brief Macro for entering into a critical section. */ -#define NRFX_CRITICAL_SECTION_ENTER() CRITICAL_REGION_ENTER() +#define NRFX_CRITICAL_SECTION_ENTER() common_hal_mcu_disable_interrupts() /** * @brief Macro for exiting from a critical section. */ -#define NRFX_CRITICAL_SECTION_EXIT() CRITICAL_REGION_EXIT() +#define NRFX_CRITICAL_SECTION_EXIT() common_hal_mcu_enable_interrupts() //------------------------------------------------------------------------------ From bd086a102e515765b55b50db9f3e45a23164b840 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 17:43:05 +0800 Subject: [PATCH 031/131] Revert "add WatchDogTimeout exception" This reverts commit 561e7e619095869f58fc728d428f3ff20e8bfc40. --- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 112 +++++++++++++++++- ports/nrf/common-hal/watchdog/__init__.h | 8 -- py/modbuiltins.c | 3 - py/mpstate.h | 5 - py/obj.h | 3 - py/objexcept.c | 3 - py/runtime.c | 9 -- 7 files changed, 108 insertions(+), 35 deletions(-) diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 358fab7987..3820fdccec 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -49,9 +49,21 @@ STATIC nrfx_timer_t *timer = NULL; STATIC nrfx_wdt_t wdt = NRFX_WDT_INSTANCE(0); STATIC nrfx_wdt_channel_id wdt_channel_id; -NORETURN void mp_raise_WatchDogTimeout(void) { - nlr_raise(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); -} +const mp_obj_type_t mp_type_WatchDogTimeout = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogTimeout, + .make_new = mp_obj_exception_make_new, + .attr = mp_obj_exception_attr, + .parent = &mp_type_Exception, +}; + +static mp_obj_exception_t mp_watchdog_timeout_exception = { + .base.type = &mp_type_WatchDogTimeout, + .traceback_alloc = 0, + .traceback_len = 0, + .traceback_data = NULL, + .args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj, +}; STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void *p_context) { (void)p_context; @@ -62,7 +74,8 @@ STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void // If the timer hits without being cleared, pause the timer and raise an exception. nrfx_timer_pause(timer); - MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception)); + mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&mp_watchdog_timeout_exception)); + MP_STATE_VM(mp_pending_exception) = &mp_watchdog_timeout_exception; #if MICROPY_ENABLE_SCHEDULER if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) { MP_STATE_VM(sched_state) = MP_SCHED_PENDING; @@ -84,6 +97,97 @@ void watchdog_watchdogtimer_reset(void) { timer_refcount = 0; } +<<<<<<< HEAD +======= +//| class WDT: +//| """Watchdog Timer""" +//| +//| def __init__(self, ): +//| """This class represents the system's Watchdog Timer. It is a +//| singleton and will always return the same instance. +//| +//| """ +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_t n_args, + const mp_obj_t *pos_args, + mp_map_t *kw_args) { + enum { ARG_timeout, ARG_sleep, ARG_hardware }; + static const mp_arg_t allowed_args[] = { + {MP_QSTR_timeout, MP_ARG_OBJ | MP_ARG_REQUIRED}, + {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, + {MP_QSTR_hardware, MP_ARG_BOOL, {.u_bool = false}}, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), + allowed_args, args); + mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); + bool hardware = args[ARG_hardware].u_bool; + bool sleep = args[ARG_sleep].u_bool; + + // If the hardware timer is already running, return that timer. + // If the parameters have changed, then ignore them, but print + // an error. + if (wdt_singleton && hardware) { + if ((sleep != wdt_singleton->sleep) + || (hardware != wdt_singleton->hardware) + || fabsf(timeout - wdt_singleton->timeout) > 0.01f) { + // Print a warning indicating things aren't quite right + // mp_printf(&mp_stderr_print, translate("warning: hardware timer was already running")); + } + watchdogtimer_hardware_feed(); + return wdt_singleton; + } + + if (timeout <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + + watchdog_watchdogtimer_obj_t *self = m_new_obj(watchdog_watchdogtimer_obj_t); + self->base.type = &watchdog_watchdogtimer_type; + self->timeout = timeout; + self->sleep = sleep; + self->hardware = hardware; + + if (hardware) { + watchdogtimer_hardware_init(self->timeout, self->sleep); + wdt_singleton = self; + } else { + uint64_t ticks = timeout * 31250ULL; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + + if (timer_refcount == 0) { + timer = nrf_peripherals_allocate_timer_or_throw(); + } + timer_refcount++; + + nrfx_timer_config_t timer_config = { + .frequency = NRF_TIMER_FREQ_31250Hz, + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_32, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + .p_context = self, + }; + + nrfx_timer_init(timer, &timer_config, &watchdogtimer_event_handler); + + // true enables interrupt. + nrfx_timer_clear(timer); + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); + nrfx_timer_resume(timer); + } + + // Feed the watchdog, in case there's a timer that's already running + // and it's only partially finished. + mp_obj_t *self_obj = MP_OBJ_FROM_PTR(self); + watchdog_watchdogtimer_feed(self_obj); + return self_obj; +} + +>>>>>>> parent of 561e7e619... add WatchDogTimeout exception //| def feed(self): //| """Feed the watchdog timer. This must be called regularly, otherwise //| the timer will expire.""" diff --git a/ports/nrf/common-hal/watchdog/__init__.h b/ports/nrf/common-hal/watchdog/__init__.h index fbfb98eff5..de19bdae44 100644 --- a/ports/nrf/common-hal/watchdog/__init__.h +++ b/ports/nrf/common-hal/watchdog/__init__.h @@ -27,12 +27,4 @@ #ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H #define MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H -#include "py/obj.h" -#include "shared-bindings/watchdog/__init__.h" - -typedef struct _watchdog_obj_t { - mp_obj_base_t base; - mp_rom_obj_t *watchdogtimer; -} watchdog_obj_t; - #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H diff --git a/py/modbuiltins.c b/py/modbuiltins.c index b031ce9fe0..e764f1987e 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -719,9 +719,6 @@ STATIC const mp_rom_map_elem_t mp_module_builtins_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_IndexError), MP_ROM_PTR(&mp_type_IndexError) }, { MP_ROM_QSTR(MP_QSTR_KeyboardInterrupt), MP_ROM_PTR(&mp_type_KeyboardInterrupt) }, { MP_ROM_QSTR(MP_QSTR_ReloadException), MP_ROM_PTR(&mp_type_ReloadException) }, - #if CIRCUITPY_WATCHDOG - { MP_ROM_QSTR(MP_QSTR_WatchDogTimeout), MP_ROM_PTR(&mp_type_WatchDogTimeout) }, - #endif { MP_ROM_QSTR(MP_QSTR_KeyError), MP_ROM_PTR(&mp_type_KeyError) }, { MP_ROM_QSTR(MP_QSTR_LookupError), MP_ROM_PTR(&mp_type_LookupError) }, { MP_ROM_QSTR(MP_QSTR_MemoryError), MP_ROM_PTR(&mp_type_MemoryError) }, diff --git a/py/mpstate.h b/py/mpstate.h index 5d3b7709b3..a5815776a4 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -141,11 +141,6 @@ typedef struct _mp_state_vm_t { // exception object of type ReloadException mp_obj_exception_t mp_reload_exception; - #if CIRCUITPY_WATCHDOG - // exception object of type WatchdogTimeout - mp_obj_exception_t mp_watchdog_exception; - #endif - // dictionary with loaded modules (may be exposed as sys.modules) mp_obj_dict_t mp_loaded_modules_dict; diff --git a/py/obj.h b/py/obj.h index cabe5498db..fa315d12f7 100644 --- a/py/obj.h +++ b/py/obj.h @@ -596,9 +596,6 @@ extern const mp_obj_type_t mp_type_IndentationError; extern const mp_obj_type_t mp_type_IndexError; extern const mp_obj_type_t mp_type_KeyboardInterrupt; extern const mp_obj_type_t mp_type_ReloadException; -#if CIRCUITPY_WATCHDOG -extern const mp_obj_type_t mp_type_WatchDogTimeout; -#endif extern const mp_obj_type_t mp_type_KeyError; extern const mp_obj_type_t mp_type_LookupError; extern const mp_obj_type_t mp_type_MemoryError; diff --git a/py/objexcept.c b/py/objexcept.c index db09d51538..b7a536c5e3 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -256,9 +256,6 @@ const mp_obj_type_t mp_type_BaseException = { MP_DEFINE_EXCEPTION(SystemExit, BaseException) MP_DEFINE_EXCEPTION(KeyboardInterrupt, BaseException) MP_DEFINE_EXCEPTION(ReloadException, BaseException) -#if CIRCUITPY_WATCHDOG -MP_DEFINE_EXCEPTION(WatchDogTimeout, BaseException) -#endif MP_DEFINE_EXCEPTION(GeneratorExit, BaseException) MP_DEFINE_EXCEPTION(Exception, BaseException) #if MICROPY_PY_ASYNC_AWAIT diff --git a/py/runtime.c b/py/runtime.c index 02352ea6c7..59dcbc7a1c 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -86,15 +86,6 @@ void mp_init(void) { MP_STATE_VM(mp_kbd_exception).args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj; #endif - #if CIRCUITPY_WATCHDOG - // initialise the exception object for raising WatchDogTimeout - MP_STATE_VM(mp_kbd_exception).base.type = &mp_type_WatchDogTimeout; - MP_STATE_VM(mp_kbd_exception).traceback_alloc = 0; - MP_STATE_VM(mp_kbd_exception).traceback_len = 0; - MP_STATE_VM(mp_kbd_exception).traceback_data = NULL; - MP_STATE_VM(mp_kbd_exception).args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj; - #endif - MP_STATE_VM(mp_reload_exception).base.type = &mp_type_ReloadException; MP_STATE_VM(mp_reload_exception).traceback_alloc = 0; MP_STATE_VM(mp_reload_exception).traceback_len = 0; From 15530a69c79ded8b38cdb1d87a4e2515a4e12510 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 18:43:23 +0800 Subject: [PATCH 032/131] supervisor: tick: check for watchdog exception if enabled Check to see if the current exception is a Watchdog exception, if it's enabled. This ensures we break out of the current sleep() if a watchdog timeout hits. Signed-off-by: Sean Cross --- supervisor/shared/tick.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 0e2adf2160..ba12e1e8c7 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -86,6 +86,13 @@ void PLACE_IN_ITCM(supervisor_run_background_tasks_if_tick)() { run_background_tasks(); } +#ifdef CIRCUITPY_WATCHDOG +extern mp_obj_exception_t mp_watchdog_timeout_exception; +#define WATCHDOG_EXCEPTION_CHECK() (MP_STATE_VM(mp_pending_exception) == &mp_watchdog_timeout_exception) +#else +#define WATCHDOG_EXCEPTION_CHECK() 0 +#endif + void mp_hal_delay_ms(mp_uint_t delay) { uint64_t start_tick = port_get_raw_ticks(NULL); // Adjust the delay to ticks vs ms. @@ -97,7 +104,7 @@ void mp_hal_delay_ms(mp_uint_t delay) { // Check to see if we've been CTRL-Ced by autoreload or the user. if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))) { + WATCHDOG_EXCEPTION_CHECK()) { break; } remaining = end_tick - port_get_raw_ticks(NULL); From 108409c6cdfb4adb9f18affe8714cfb6a8a86188 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 18:44:22 +0800 Subject: [PATCH 033/131] nrf: common-hal: finish reworking exceptions This finishes the rework of the exception handler, which is once again stored inside the watchdog timer module. This also implements a `watchdog_reset()` that is used to disable the RAISE watchdog, if one is enabled. Signed-off-by: Sean Cross --- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 134 ++++-------------- ports/nrf/common-hal/watchdog/WatchDogTimer.h | 2 + 2 files changed, 28 insertions(+), 108 deletions(-) diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 3820fdccec..8132ceacc2 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -34,6 +34,7 @@ #include "common-hal/watchdog/WatchDogTimer.h" +#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/watchdog/__init__.h" #include "shared-bindings/watchdog/WatchDogTimer.h" @@ -57,7 +58,7 @@ const mp_obj_type_t mp_type_WatchDogTimeout = { .parent = &mp_type_Exception, }; -static mp_obj_exception_t mp_watchdog_timeout_exception = { +mp_obj_exception_t mp_watchdog_timeout_exception = { .base.type = &mp_type_WatchDogTimeout, .traceback_alloc = 0, .traceback_len = 0, @@ -66,7 +67,7 @@ static mp_obj_exception_t mp_watchdog_timeout_exception = { }; STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void *p_context) { - (void)p_context; + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(p_context); if (event_type != NRF_TIMER_EVENT_COMPARE0) { // Spurious event. return; @@ -74,6 +75,7 @@ STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void // If the timer hits without being cleared, pause the timer and raise an exception. nrfx_timer_pause(timer); + self->mode = WATCHDOGMODE_NONE; mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&mp_watchdog_timeout_exception)); MP_STATE_VM(mp_pending_exception) = &mp_watchdog_timeout_exception; #if MICROPY_ENABLE_SCHEDULER @@ -89,105 +91,6 @@ STATIC void watchdogtimer_watchdog_event_handler(void) { reset_cpu(); } -void watchdog_watchdogtimer_reset(void) { - if (timer != NULL) { - nrf_peripherals_free_timer(timer); - } - timer = NULL; - timer_refcount = 0; -} - -<<<<<<< HEAD -======= -//| class WDT: -//| """Watchdog Timer""" -//| -//| def __init__(self, ): -//| """This class represents the system's Watchdog Timer. It is a -//| singleton and will always return the same instance. -//| -//| """ -//| ... -//| -STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_t n_args, - const mp_obj_t *pos_args, - mp_map_t *kw_args) { - enum { ARG_timeout, ARG_sleep, ARG_hardware }; - static const mp_arg_t allowed_args[] = { - {MP_QSTR_timeout, MP_ARG_OBJ | MP_ARG_REQUIRED}, - {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, - {MP_QSTR_hardware, MP_ARG_BOOL, {.u_bool = false}}, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), - allowed_args, args); - mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); - bool hardware = args[ARG_hardware].u_bool; - bool sleep = args[ARG_sleep].u_bool; - - // If the hardware timer is already running, return that timer. - // If the parameters have changed, then ignore them, but print - // an error. - if (wdt_singleton && hardware) { - if ((sleep != wdt_singleton->sleep) - || (hardware != wdt_singleton->hardware) - || fabsf(timeout - wdt_singleton->timeout) > 0.01f) { - // Print a warning indicating things aren't quite right - // mp_printf(&mp_stderr_print, translate("warning: hardware timer was already running")); - } - watchdogtimer_hardware_feed(); - return wdt_singleton; - } - - if (timeout <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - - watchdog_watchdogtimer_obj_t *self = m_new_obj(watchdog_watchdogtimer_obj_t); - self->base.type = &watchdog_watchdogtimer_type; - self->timeout = timeout; - self->sleep = sleep; - self->hardware = hardware; - - if (hardware) { - watchdogtimer_hardware_init(self->timeout, self->sleep); - wdt_singleton = self; - } else { - uint64_t ticks = timeout * 31250ULL; - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - - if (timer_refcount == 0) { - timer = nrf_peripherals_allocate_timer_or_throw(); - } - timer_refcount++; - - nrfx_timer_config_t timer_config = { - .frequency = NRF_TIMER_FREQ_31250Hz, - .mode = NRF_TIMER_MODE_TIMER, - .bit_width = NRF_TIMER_BIT_WIDTH_32, - .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, - .p_context = self, - }; - - nrfx_timer_init(timer, &timer_config, &watchdogtimer_event_handler); - - // true enables interrupt. - nrfx_timer_clear(timer); - nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); - nrfx_timer_resume(timer); - } - - // Feed the watchdog, in case there's a timer that's already running - // and it's only partially finished. - mp_obj_t *self_obj = MP_OBJ_FROM_PTR(self); - watchdog_watchdogtimer_feed(self_obj); - return self_obj; -} - ->>>>>>> parent of 561e7e619... add WatchDogTimeout exception //| def feed(self): //| """Feed the watchdog timer. This must be called regularly, otherwise //| the timer will expire.""" @@ -221,6 +124,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { nrf_peripherals_free_timer(timer); timer = NULL; } + self->mode = WATCHDOGMODE_NONE; } else if (self->mode == WATCHDOGMODE_RESET) { mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); } @@ -229,6 +133,17 @@ STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); +void watchdog_reset(void) { + if (common_hal_mcu_watchdogtimer_obj.mode == WATCHDOGMODE_RAISE) { + common_hal_mcu_watchdogtimer_obj.mode = WATCHDOGMODE_NONE; + timer_refcount--; + if (timer_refcount == 0) { + nrf_peripherals_free_timer(timer); + timer = NULL; + } + } +} + //| timeout: float = ... //| """The maximum number of seconds that can elapse between calls //| to feed()""" @@ -250,7 +165,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_ if (self->mode == WATCHDOGMODE_RESET) { // If the WatchDogTimer is already running in "RESET" mode, raise an error // since the mode cannot be changed once started. - mp_raise_TypeError(translate("Cannot change the timeout once mode is WatchDogMode.RESET")); + mp_raise_TypeError(translate("cannot change the timeout once mode is WatchDogMode.RESET")); } else if (self->mode == WATCHDOGMODE_RAISE) { // If the WatchDogTimer is already running in "RAISE" mode, reset the timer // with the new value. @@ -322,15 +237,13 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t m if (self->mode == WATCHDOGMODE_RESET) { mp_raise_ValueError(translate("WatchDogTimer mode cannot be changed once set to WatchDogMode.RESET")); } - else if (self->mode == WATCHDOGMODE_NONE) { - uint64_t ticks = self->timeout * 31250ULL; - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - + else if (self->mode == WATCHDOGMODE_NONE || self->mode == WATCHDOGMODE_RAISE) { if (timer_refcount == 0) { timer = nrf_peripherals_allocate_timer_or_throw(); } + if (timer == NULL) { + mp_raise_RuntimeError(translate("timer was null")); + } timer_refcount++; nrfx_timer_config_t timer_config = { @@ -343,6 +256,11 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t m nrfx_timer_init(timer, &timer_config, &watchdogtimer_timer_event_handler); + uint64_t ticks = nrfx_timer_ms_to_ticks(timer, self->timeout * 1000); + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + // true enables interrupt. nrfx_timer_clear(timer); nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.h b/ports/nrf/common-hal/watchdog/WatchDogTimer.h index 4176944696..f5ea453ccb 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.h +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.h @@ -38,4 +38,6 @@ typedef struct _watchdog_watchdogtimer_obj_t { watchdog_watchdogmode_t mode; } watchdog_watchdogtimer_obj_t; +void watchdog_reset(void); + #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H From c5c13a8ba14490c94fd7409bae0183e59b5767f4 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 18:51:54 +0800 Subject: [PATCH 034/131] nrf: reset watchdog as part of port_reset() Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 89797e6dcb..9fe72905c6 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -50,6 +50,7 @@ #include "common-hal/pulseio/PulseIn.h" #include "common-hal/rtc/RTC.h" #include "common-hal/neopixel_write/__init__.h" +#include "common-hal/watchdog/WatchDogTimer.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/rtc/__init__.h" @@ -189,6 +190,10 @@ void reset_port(void) { bleio_reset(); #endif +#if CIRCUITPY_WATCHDOG + watchdog_reset(); +#endif + reset_all_pins(); } From c7efc94a336091a1e6d79e94a9e80b31e5d5fc3f Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 18:52:21 +0800 Subject: [PATCH 035/131] watchdog: move timeout exception to shared-bindings Make this exception globally available to all platforms that have enabled the watchdog timer. Signed-off-by: Sean Cross --- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 16 ---------------- shared-bindings/watchdog/__init__.c | 16 ++++++++++++++++ shared-bindings/watchdog/__init__.h | 2 ++ supervisor/shared/tick.c | 14 +++++++------- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 8132ceacc2..32af258663 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -50,22 +50,6 @@ STATIC nrfx_timer_t *timer = NULL; STATIC nrfx_wdt_t wdt = NRFX_WDT_INSTANCE(0); STATIC nrfx_wdt_channel_id wdt_channel_id; -const mp_obj_type_t mp_type_WatchDogTimeout = { - { &mp_type_type }, - .name = MP_QSTR_WatchDogTimeout, - .make_new = mp_obj_exception_make_new, - .attr = mp_obj_exception_attr, - .parent = &mp_type_Exception, -}; - -mp_obj_exception_t mp_watchdog_timeout_exception = { - .base.type = &mp_type_WatchDogTimeout, - .traceback_alloc = 0, - .traceback_len = 0, - .traceback_data = NULL, - .args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj, -}; - STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void *p_context) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(p_context); if (event_type != NRF_TIMER_EVENT_COMPARE0) { diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index 36993db936..7f818b226c 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -55,6 +55,22 @@ //| w.feed()""" //| +const mp_obj_type_t mp_type_WatchDogTimeout = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogTimeout, + .make_new = mp_obj_exception_make_new, + .attr = mp_obj_exception_attr, + .parent = &mp_type_Exception, +}; + +mp_obj_exception_t mp_watchdog_timeout_exception = { + .base.type = &mp_type_WatchDogTimeout, + .traceback_alloc = 0, + .traceback_len = 0, + .traceback_data = NULL, + .args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj, +}; + STATIC const mp_rom_map_elem_t watchdog_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_watchdog) }, { MP_ROM_QSTR(MP_QSTR_WatchDogMode), MP_ROM_PTR(&watchdog_watchdogmode_type) }, diff --git a/shared-bindings/watchdog/__init__.h b/shared-bindings/watchdog/__init__.h index 7203b8aa51..b5a0ad71d1 100644 --- a/shared-bindings/watchdog/__init__.h +++ b/shared-bindings/watchdog/__init__.h @@ -28,5 +28,7 @@ #define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H extern const mp_obj_module_t watchdog_module; +extern mp_obj_exception_t mp_watchdog_timeout_exception; +extern const mp_obj_type_t mp_type_WatchDogTimeout; #endif // MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index ba12e1e8c7..23516799fa 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -44,6 +44,13 @@ static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); #include "shared-bindings/microcontroller/__init__.h" +#if CIRCUITPY_WATCHDOG +#include "shared-bindings/watchdog/__init__.h" +#define WATCHDOG_EXCEPTION_CHECK() (MP_STATE_VM(mp_pending_exception) == &mp_watchdog_timeout_exception) +#else +#define WATCHDOG_EXCEPTION_CHECK() 0 +#endif + void supervisor_tick(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); @@ -86,13 +93,6 @@ void PLACE_IN_ITCM(supervisor_run_background_tasks_if_tick)() { run_background_tasks(); } -#ifdef CIRCUITPY_WATCHDOG -extern mp_obj_exception_t mp_watchdog_timeout_exception; -#define WATCHDOG_EXCEPTION_CHECK() (MP_STATE_VM(mp_pending_exception) == &mp_watchdog_timeout_exception) -#else -#define WATCHDOG_EXCEPTION_CHECK() 0 -#endif - void mp_hal_delay_ms(mp_uint_t delay) { uint64_t start_tick = port_get_raw_ticks(NULL); // Adjust the delay to ticks vs ms. From 5edc29c6a592fc70f6d273dc89c3dd1be8afcb13 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 19:34:54 +0800 Subject: [PATCH 036/131] nrf: microcontroller: use port reset path For `microcontroller.reset()`, don't manually call NVIC_SystemReset(). Instead, call the `port_reset()` in case the port wants to do any cleanup. Signed-off-by: Sean Cross --- ports/nrf/common-hal/microcontroller/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index 187b46ad1b..cc5f2a285a 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -94,7 +94,7 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { void common_hal_mcu_reset(void) { filesystem_flush(); - NVIC_SystemReset(); + reset_cpu(); } // The singleton microcontroller.Processor object, bound to microcontroller.cpu From daf7c2857da3f0cc61f20474bdd1ce2824cb409c Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 19:36:05 +0800 Subject: [PATCH 037/131] nrf: port: save rtc value across reboots As part of the reset process, save the current tick count to an uninitialized memory location. That way, the current tick value will be preserved across reboots. A reboot will cause us to lose a certain number of ticks, depending on how long a reboot takes, however if reboots are infrequent then this will not be a large amount of time lost. Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 9fe72905c6..5c76f6aa11 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -78,13 +78,19 @@ const nrfx_rtc_config_t rtc_config = { .interrupt_priority = 6 }; -static volatile uint64_t overflowed_ticks = 0; +#define OVERFLOW_CHECK_PREFIX 0x2cad564f +#define OVERFLOW_CHECK_SUFFIX 0x11343ef7 +static volatile struct { + uint32_t prefix; + uint64_t overflowed_ticks; + uint32_t suffix; +} overflow_tracker __attribute__((section(".uninitialized"))); void rtc_handler(nrfx_rtc_int_type_t int_type) { if (int_type == NRFX_RTC_INT_OVERFLOW) { // Our RTC is 24 bits and we're clocking it at 32.768khz which is 32 (2 ** 5) subticks per // tick. - overflowed_ticks += (1L<< (24 - 5)); + overflow_tracker.overflowed_ticks += (1L<< (24 - 5)); } else if (int_type == NRFX_RTC_INT_TICK && nrfx_rtc_counter_get(&rtc_instance) % 32 == 0) { // Do things common to all ports when the tick occurs supervisor_tick(); @@ -101,6 +107,17 @@ void tick_init(void) { nrfx_rtc_init(&rtc_instance, &rtc_config, rtc_handler); nrfx_rtc_enable(&rtc_instance); nrfx_rtc_overflow_enable(&rtc_instance, true); + + // If the check prefix and suffix aren't correct, then the structure + // in memory isn't correct and the clock will be wildly wrong. Initialize + // the prefix and suffix so that we know the value is correct, and reset + // the time to 0. + if (overflow_tracker.prefix != OVERFLOW_CHECK_PREFIX || + overflow_tracker.suffix != OVERFLOW_CHECK_SUFFIX) { + overflow_tracker.prefix = OVERFLOW_CHECK_PREFIX; + overflow_tracker.suffix = OVERFLOW_CHECK_SUFFIX; + overflow_tracker.overflowed_ticks = 0; + } } safe_mode_t port_init(void) { @@ -205,6 +222,10 @@ void reset_to_bootloader(void) { } void reset_cpu(void) { + // We're getting ready to reset, so save the counter off. + // This counter will get reset to zero during the reboot. + uint32_t ticks = nrfx_rtc_counter_get(&rtc_instance); + overflow_tracker.overflowed_ticks += ticks; NVIC_SystemReset(); } @@ -248,7 +269,7 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { if (subticks != NULL) { *subticks = (rtc % 32); } - return overflowed_ticks + rtc / 32; + return overflow_tracker.overflowed_ticks + rtc / 32; } // Enable 1/1024 second tick. From 33001f4e19ab0e6117713e7e27d8b6b31b314e9d Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 20:31:47 +0800 Subject: [PATCH 038/131] nrf: simmel: shrink filesystem to fit watchdog timer The watchdog timer has increased the amount of code and text that's required. Signed-off-by: Sean Cross --- ports/nrf/boards/simmel/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/simmel/mpconfigboard.h b/ports/nrf/boards/simmel/mpconfigboard.h index bcffb40ea5..28c4ee7d93 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.h +++ b/ports/nrf/boards/simmel/mpconfigboard.h @@ -40,7 +40,7 @@ #endif #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (80*1024) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (76*1024) #define BOOTLOADER_SIZE (0x4000) // 12 kiB #define CIRCUITPY_BLE_CONFIG_SIZE (12*1024) From d0f1b59be54ddd574bdd15a0dd459c74038a5417 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sat, 23 May 2020 10:18:35 +0800 Subject: [PATCH 039/131] nrf: pca10100: disable some unused features to shrink image This removes some features that are largely unused in order to get the image to fit. Recommended in https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632859678 Signed-off-by: Sean Cross --- ports/nrf/boards/pca10100/mpconfigboard.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 1206c8fe59..715b65e63e 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -8,9 +8,13 @@ MCU_CHIP = nrf52833 INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_BITBANGIO = 0 CIRCUITPY_BUSIO = 1 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PIXELBUF = 0 @@ -20,6 +24,8 @@ CIRCUITPY_RTC = 1 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 +SUPEROPT_GC = 0 + # These defines must be overridden before mpconfigboard.h is included, which is # why they are passed on the command line. CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' From 296ba101ec8895720012660e36c4e34246b6b1b2 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sat, 23 May 2020 11:17:11 +0800 Subject: [PATCH 040/131] nrf: set WDT priority to 2 The previous setting of `1` meant that the bluetooth system couldn't be used when the watchdog timer was enabled. Signed-off-by: Sean Cross --- ports/nrf/nrfx_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/nrfx_config.h b/ports/nrf/nrfx_config.h index 2dcdba14c6..b528a6032b 100644 --- a/ports/nrf/nrfx_config.h +++ b/ports/nrf/nrfx_config.h @@ -127,6 +127,6 @@ #define NRFX_WDT0_ENABLED 1 // This IRQ indicates the system will reboot shortly, so give // it a high priority. -#define NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY 1 +#define NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY 2 #endif // NRFX_CONFIG_H__ From e470376c126828c768dfbcf25430869e8bc2b021 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sat, 23 May 2020 11:26:27 +0800 Subject: [PATCH 041/131] nrf: add ticks (not subticks) to overflow count during reset Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 5c76f6aa11..aee2d63e1d 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -225,7 +225,7 @@ void reset_cpu(void) { // We're getting ready to reset, so save the counter off. // This counter will get reset to zero during the reboot. uint32_t ticks = nrfx_rtc_counter_get(&rtc_instance); - overflow_tracker.overflowed_ticks += ticks; + overflow_tracker.overflowed_ticks += ticks / 32; NVIC_SystemReset(); } From dbf1bef56ab3a7ce73388c9833c9aa5a4074eb24 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 27 May 2020 10:21:43 +0800 Subject: [PATCH 042/131] watchdog: support catching the timeout With this patch, the exception can now be caught: import microcontroller import watchdog import time wdt = microcontroller.watchdog wdt.timeout = 5 while True: wdt.mode = watchdog.WatchDogMode.RAISE print("Starting loop -- should exit after five seconds") try: while True: time.sleep(10) # pass # This also works for a spinloop except watchdog.WatchDogTimeout as e: print("Watchdog Expired (PASS)") except Exception as e: print("Other exception (FAIL)") print("Exited loop") This prints: Starting loop -- should exit after five seconds Watchdog Expired (PASS) Starting loop -- should exit after five seconds Watchdog Expired (PASS) Starting loop -- should exit after five seconds Watchdog Expired (PASS) Signed-off-by: Sean Cross --- shared-bindings/watchdog/__init__.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index 7f818b226c..d0704b7cf7 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -74,6 +74,7 @@ mp_obj_exception_t mp_watchdog_timeout_exception = { STATIC const mp_rom_map_elem_t watchdog_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_watchdog) }, { MP_ROM_QSTR(MP_QSTR_WatchDogMode), MP_ROM_PTR(&watchdog_watchdogmode_type) }, + { MP_ROM_QSTR(MP_QSTR_WatchDogTimeout), MP_ROM_PTR(&mp_type_WatchDogTimeout) }, }; STATIC MP_DEFINE_CONST_DICT(watchdog_module_globals, watchdog_module_globals_table); From aac5a4f178f311eb2aaf7d58135e9df49f80f7c4 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 27 May 2020 11:25:24 +0800 Subject: [PATCH 043/131] watchdog: use common_hal_watchdog_* pattern This pulls all common functionality into `shared-bindings` and keeps platform-specific code inside `nrf`. Additionally, this performs most validation in the `shared-bindings` site. The only validation that occurs inside platform-specific `common-hal` code is related to timeout limits that are platform-specific. Additionally, all documentation is now inside the `shared-bindings` directory. Signed-off-by: Sean Cross --- .../nrf/common-hal/microcontroller/__init__.c | 1 - ports/nrf/common-hal/watchdog/WatchDogTimer.c | 233 ++++-------------- ports/nrf/common-hal/watchdog/WatchDogTimer.h | 17 +- shared-bindings/watchdog/WatchDogMode.c | 32 ++- shared-bindings/watchdog/WatchDogMode.h | 4 +- shared-bindings/watchdog/WatchDogTimer.c | 172 +++++++++++++ shared-bindings/watchdog/WatchDogTimer.h | 19 +- 7 files changed, 270 insertions(+), 208 deletions(-) diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index cc5f2a285a..f5caf68ef8 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -123,7 +123,6 @@ watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj = { .type = &watchdog_watchdogtimer_type, }, .timeout = 0.0f, - .sleep = false, .mode = WATCHDOGMODE_NONE, }; #endif diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 32af258663..bec0ac4732 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -69,88 +69,46 @@ STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void #endif } -// This function is called if the timer expires. The system will reboot in 1/16384 of a second. -// Issue a reboot ourselves so we can do any cleanup necessary. +static void timer_free(void) { + timer_refcount--; + if (timer_refcount == 0) { + nrf_peripherals_free_timer(timer); + timer = NULL; + } +} + +// This function is called if the timer expires. The system will reboot +// in 1/16384 of a second. Issue a reboot ourselves so we can do any +// cleanup necessary. STATIC void watchdogtimer_watchdog_event_handler(void) { reset_cpu(); } -//| def feed(self): -//| """Feed the watchdog timer. This must be called regularly, otherwise -//| the timer will expire.""" -//| ... -//| -STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - +void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self) { if (self->mode == WATCHDOGMODE_RESET) { nrfx_wdt_feed(&wdt); } else if (self->mode == WATCHDOGMODE_RAISE) { nrfx_timer_clear(timer); - } else if (self->mode == WATCHDOGMODE_NONE) { - mp_raise_ValueError(translate("WatchDogTimer is not currently running")); } - return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watchdogtimer_feed); -//| def deinit(self): -//| """Stop the watchdog timer. This may raise an error if the watchdog -//| timer cannot be disabled on this platform.""" -//| ... -//| -STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - - if (self->mode == WATCHDOGMODE_RAISE) { - timer_refcount--; - if (timer_refcount == 0) { - nrf_peripherals_free_timer(timer); - timer = NULL; - } - self->mode = WATCHDOGMODE_NONE; - } else if (self->mode == WATCHDOGMODE_RESET) { - mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); +void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { + if (timer) { + timer_free(); } - - return mp_const_none; + self->mode = WATCHDOGMODE_NONE; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); void watchdog_reset(void) { - if (common_hal_mcu_watchdogtimer_obj.mode == WATCHDOGMODE_RAISE) { - common_hal_mcu_watchdogtimer_obj.mode = WATCHDOGMODE_NONE; - timer_refcount--; - if (timer_refcount == 0) { - nrf_peripherals_free_timer(timer); - timer = NULL; - } - } + common_hal_watchdog_deinit(&common_hal_mcu_watchdogtimer_obj); } -//| timeout: float = ... -//| """The maximum number of seconds that can elapse between calls -//| to feed()""" -//| -STATIC mp_obj_t watchdog_watchdogtimer_obj_get_timeout(mp_obj_t self_in) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_float(self->timeout); +mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self) { + return self->timeout; } -MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_timeout_obj, watchdog_watchdogtimer_obj_get_timeout); -STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_t timeout_obj) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - mp_float_t timeout = mp_obj_get_float(timeout_obj); - - if (timeout <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - - if (self->mode == WATCHDOGMODE_RESET) { - // If the WatchDogTimer is already running in "RESET" mode, raise an error - // since the mode cannot be changed once started. - mp_raise_TypeError(translate("cannot change the timeout once mode is WatchDogMode.RESET")); - } else if (self->mode == WATCHDOGMODE_RAISE) { +void common_hal_watchdog_set_timeout(watchdog_watchdogtimer_obj_t *self, mp_float_t timeout) { + if (self->mode == WATCHDOGMODE_RAISE) { // If the WatchDogTimer is already running in "RAISE" mode, reset the timer // with the new value. uint64_t ticks = timeout * 31250ULL; @@ -162,108 +120,42 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_ } self->timeout = timeout; - return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_timeout_obj, watchdog_watchdogtimer_obj_set_timeout); -const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_timeout_obj, - (mp_obj_t)&watchdog_watchdogtimer_set_timeout_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| mode: watchdog.WatchDogMode = ... -//| """The current operating mode of the WatchDogTimer `watchdog.WatchDogMode`. -//| -//| Setting a WatchDogMode activates the WatchDog:: -//| -//| import microcontroller -//| import watchdog -//| -//| w = microcontroller.watchdog -//| w.timeout = 5 -//| w.mode = watchdog.WatchDogMode.RAISE -//| -//| -//| Once set, the WatchDogTimer will perform the specified action if the timer expires. -//| -STATIC mp_obj_t watchdog_watchdogtimer_obj_get_mode(mp_obj_t self_in) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - switch (self->mode) { - case WATCHDOGMODE_NONE: default: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_none_obj); - case WATCHDOGMODE_RAISE: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_raise_obj); - case WATCHDOGMODE_RESET: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_reset_obj); - } +watchdog_watchdogmode_t common_hal_watchdog_get_mode(watchdog_watchdogtimer_obj_t *self) { + return self->mode; } -MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_mode_obj, watchdog_watchdogtimer_obj_get_mode); -STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t mode_obj) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - watchdog_watchdogmode_obj_t *mode = MP_OBJ_TO_PTR(mode_obj); - if (mode == MP_ROM_PTR(&watchdog_watchdogmode_none_obj)) { - if (self->mode == WATCHDOGMODE_RESET) { - mp_raise_TypeError(translate("WatchDogTimer mode cannot be changed once set to WatchDogMode.RESET")); +void common_hal_watchdog_set_mode(watchdog_watchdogtimer_obj_t *self, watchdog_watchdogmode_t new_mode) { + watchdog_watchdogmode_t current_mode = self->mode; + + if (new_mode == WATCHDOGMODE_RAISE) { + if (timer_refcount == 0) { + timer = nrf_peripherals_allocate_timer_or_throw(); } - else if (self->mode == WATCHDOGMODE_RAISE) { - timer_refcount--; - if (timer_refcount == 0) { - nrf_peripherals_free_timer(timer); - timer = NULL; - } - } - self->mode = WATCHDOGMODE_NONE; + timer_refcount++; - } else if (mode == MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)) { - if (self->timeout <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - if (self->mode == WATCHDOGMODE_RESET) { - mp_raise_ValueError(translate("WatchDogTimer mode cannot be changed once set to WatchDogMode.RESET")); - } - else if (self->mode == WATCHDOGMODE_NONE || self->mode == WATCHDOGMODE_RAISE) { - if (timer_refcount == 0) { - timer = nrf_peripherals_allocate_timer_or_throw(); - } - if (timer == NULL) { - mp_raise_RuntimeError(translate("timer was null")); - } - timer_refcount++; + nrfx_timer_config_t timer_config = { + .frequency = NRF_TIMER_FREQ_31250Hz, + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_32, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + .p_context = self, + }; - nrfx_timer_config_t timer_config = { - .frequency = NRF_TIMER_FREQ_31250Hz, - .mode = NRF_TIMER_MODE_TIMER, - .bit_width = NRF_TIMER_BIT_WIDTH_32, - .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, - .p_context = self, - }; + nrfx_timer_init(timer, &timer_config, &watchdogtimer_timer_event_handler); - nrfx_timer_init(timer, &timer_config, &watchdogtimer_timer_event_handler); - - uint64_t ticks = nrfx_timer_ms_to_ticks(timer, self->timeout * 1000); - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - - // true enables interrupt. - nrfx_timer_clear(timer); - nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); - nrfx_timer_resume(timer); - } - self->mode = WATCHDOGMODE_RAISE; - - } else if (mode == MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)) { - if (self->timeout <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - if (self->mode == WATCHDOGMODE_RAISE) { - timer_refcount--; - if (timer_refcount == 0) { - nrf_peripherals_free_timer(timer); - timer = NULL; - } + uint64_t ticks = nrfx_timer_ms_to_ticks(timer, self->timeout * 1000); + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); } + // true enables interrupt. + nrfx_timer_clear(timer); + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); + nrfx_timer_resume(timer); + + } else if (new_mode == WATCHDOGMODE_RESET) { uint64_t ticks = self->timeout * 1000.0f; if (ticks > UINT32_MAX) { mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); @@ -286,31 +178,12 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t m } nrfx_wdt_enable(&wdt); nrfx_wdt_feed(&wdt); - self->mode = WATCHDOGMODE_RESET; } - return mp_const_none; + // If we just switched away from RAISE, disable the timmer. + if (current_mode == WATCHDOGMODE_RAISE && new_mode != WATCHDOGMODE_RAISE) { + timer_free(); + } + + self->mode = new_mode; } -MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_mode_obj, watchdog_watchdogtimer_obj_set_mode); - -const mp_obj_property_t watchdog_watchdogtimer_mode_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_mode_obj, - (mp_obj_t)&watchdog_watchdogtimer_set_mode_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -STATIC const mp_rom_map_elem_t watchdog_watchdogtimer_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&watchdog_watchdogtimer_feed_obj) }, - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&watchdog_watchdogtimer_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&watchdog_watchdogtimer_timeout_obj) }, - { MP_ROM_QSTR(MP_QSTR_mode), MP_ROM_PTR(&watchdog_watchdogtimer_mode_obj) }, -}; -STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogtimer_locals_dict, watchdog_watchdogtimer_locals_dict_table); - -const mp_obj_type_t watchdog_watchdogtimer_type = { - { &mp_type_type }, - .name = MP_QSTR_WatchDogTimer, - // .make_new = watchdog_watchdogtimer_make_new, - .locals_dict = (mp_obj_dict_t*)&watchdog_watchdogtimer_locals_dict, -}; diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.h b/ports/nrf/common-hal/watchdog/WatchDogTimer.h index f5ea453ccb..8d6df934e4 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.h +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.h @@ -28,16 +28,17 @@ #define MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H #include "py/obj.h" -#include "shared-bindings/watchdog/WatchDogTimer.h" #include "shared-bindings/watchdog/WatchDogMode.h" +#include "shared-bindings/watchdog/WatchDogTimer.h" -typedef struct _watchdog_watchdogtimer_obj_t { - mp_obj_base_t base; - mp_float_t timeout; - bool sleep; - watchdog_watchdogmode_t mode; -} watchdog_watchdogtimer_obj_t; +struct _watchdog_watchdogtimer_obj_t { + mp_obj_base_t base; + mp_float_t timeout; + watchdog_watchdogmode_t mode; +}; +// This needs to be called in order to disable the watchdog if it's set to +// "RAISE". If set to "RESET", then the watchdog cannot be reset. void watchdog_reset(void); -#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H +#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c index c5c4b23bc3..cc75a6ea44 100644 --- a/shared-bindings/watchdog/WatchDogMode.c +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -32,11 +32,6 @@ //| def __init__(self, ): //| """Enum-like class to define the run mode of the watchdog timer.""" //| -//| NONE: Any = ... -//| """Take no action if the watchdog timer expires. -//| -//| :type watchdog.WatchDogMode:""" -//| //| RAISE: Any = ... //| """Raise an exception when the WatchDogTimer expires. //| @@ -49,10 +44,6 @@ //| const mp_obj_type_t watchdog_watchdogmode_type; -const watchdog_watchdogmode_obj_t watchdog_watchdogmode_none_obj = { - { &watchdog_watchdogmode_type }, -}; - const watchdog_watchdogmode_obj_t watchdog_watchdogmode_raise_obj = { { &watchdog_watchdogmode_type }, }; @@ -61,8 +52,29 @@ const watchdog_watchdogmode_obj_t watchdog_watchdogmode_reset_obj = { { &watchdog_watchdogmode_type }, }; +watchdog_watchdogmode_t watchdog_watchdogmode_obj_to_type(mp_obj_t obj) { + if (obj == MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)) { + return WATCHDOGMODE_RAISE; + } else if (obj == MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)) { + return WATCHDOGMODE_RESET; + } + return WATCHDOGMODE_NONE; +} + +mp_obj_t watchdog_watchdogmode_type_to_obj(watchdog_watchdogmode_t mode) { + switch (mode) { + case WATCHDOGMODE_RAISE: + return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_raise_obj); + case WATCHDOGMODE_RESET: + return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_reset_obj); + case WATCHDOGMODE_NONE: + default: + return (mp_obj_t)MP_ROM_PTR(&mp_const_none_obj); + } +} + STATIC const mp_rom_map_elem_t watchdog_watchdogmode_locals_dict_table[] = { - {MP_ROM_QSTR(MP_QSTR_NONE), MP_ROM_PTR(&watchdog_watchdogmode_none_obj)}, + {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)}, }; diff --git a/shared-bindings/watchdog/WatchDogMode.h b/shared-bindings/watchdog/WatchDogMode.h index 77bf58db63..68022671fb 100644 --- a/shared-bindings/watchdog/WatchDogMode.h +++ b/shared-bindings/watchdog/WatchDogMode.h @@ -37,10 +37,12 @@ typedef enum { const mp_obj_type_t watchdog_watchdogmode_type; +watchdog_watchdogmode_t watchdog_watchdogmode_obj_to_type(mp_obj_t obj); +mp_obj_t watchdog_watchdogmode_type_to_obj(watchdog_watchdogmode_t mode); + typedef struct { mp_obj_base_t base; } watchdog_watchdogmode_obj_t; -extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_none_obj; extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_raise_obj; extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_reset_obj; diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index e69de29bb2..5411d0bef5 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -0,0 +1,172 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include +#include + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" + +#include "common-hal/watchdog/WatchDogTimer.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/watchdog/__init__.h" +#include "shared-bindings/watchdog/WatchDogTimer.h" + +#include "supervisor/port.h" + +//| def feed(self): +//| """Feed the watchdog timer. This must be called regularly, otherwise +//| the timer will expire.""" +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + watchdog_watchdogmode_t current_mode = common_hal_watchdog_get_mode(self); + + if (current_mode == WATCHDOGMODE_NONE) { + mp_raise_ValueError(translate("WatchDogTimer is not currently running")); + } + common_hal_watchdog_feed(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watchdogtimer_feed); + +//| def deinit(self): +//| """Stop the watchdog timer. This may raise an error if the watchdog +//| timer cannot be disabled on this platform.""" +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + watchdog_watchdogmode_t current_mode = common_hal_watchdog_get_mode(self); + + if (current_mode == WATCHDOGMODE_RESET) { + mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); + } + + common_hal_watchdog_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); + +//| timeout: float = ... +//| """The maximum number of seconds that can elapse between calls +//| to feed()""" +//| +STATIC mp_obj_t watchdog_watchdogtimer_obj_get_timeout(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_float(common_hal_watchdog_get_timeout(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_timeout_obj, watchdog_watchdogtimer_obj_get_timeout); + +STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_t timeout_obj) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_float_t timeout = mp_obj_get_float(timeout_obj); + + if (timeout <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + + common_hal_watchdog_set_timeout(self, timeout); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_timeout_obj, watchdog_watchdogtimer_obj_set_timeout); + +const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_timeout_obj, + (mp_obj_t)&watchdog_watchdogtimer_set_timeout_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| mode: watchdog.WatchDogMode = ... +//| """The current operating mode of the WatchDogTimer `watchdog.WatchDogMode`. +//| +//| Setting a WatchDogMode activates the WatchDog:: +//| +//| import microcontroller +//| import watchdog +//| +//| w = microcontroller.watchdog +//| w.timeout = 5 +//| w.mode = watchdog.WatchDogMode.RAISE +//| +//| +//| Once set, the WatchDogTimer will perform the specified action if the timer expires.""" +//| +STATIC mp_obj_t watchdog_watchdogtimer_obj_get_mode(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + return watchdog_watchdogmode_type_to_obj(common_hal_watchdog_get_mode(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_mode_obj, watchdog_watchdogtimer_obj_get_mode); + +STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t mode_obj) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + watchdog_watchdogmode_t current_mode = common_hal_watchdog_get_mode(self); + watchdog_watchdogmode_t new_mode = watchdog_watchdogmode_obj_to_type(mode_obj); + mp_float_t current_timeout = common_hal_watchdog_get_timeout(self); + + // When setting the mode, the timeout value must be greater than zero + if (new_mode == WATCHDOGMODE_RESET || new_mode == WATCHDOGMODE_RAISE) { + if (current_timeout <= 0) { + mp_raise_ValueError(translate("WatchDogTimer.timeout must be greater than 0")); + } + } + + // Don't allow changing the mode once the watchdog timer has been started + if (current_mode == WATCHDOGMODE_RESET && new_mode != WATCHDOGMODE_RESET) { + mp_raise_TypeError(translate("WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET")); + } + + common_hal_watchdog_set_mode(self, new_mode); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_mode_obj, watchdog_watchdogtimer_obj_set_mode); + +const mp_obj_property_t watchdog_watchdogtimer_mode_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_mode_obj, + (mp_obj_t)&watchdog_watchdogtimer_set_mode_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t watchdog_watchdogtimer_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&watchdog_watchdogtimer_feed_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&watchdog_watchdogtimer_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&watchdog_watchdogtimer_timeout_obj) }, + { MP_ROM_QSTR(MP_QSTR_mode), MP_ROM_PTR(&watchdog_watchdogtimer_mode_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogtimer_locals_dict, watchdog_watchdogtimer_locals_dict_table); + +const mp_obj_type_t watchdog_watchdogtimer_type = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogTimer, + // .make_new = watchdog_watchdogtimer_make_new, + .locals_dict = (mp_obj_dict_t*)&watchdog_watchdogtimer_locals_dict, +}; diff --git a/shared-bindings/watchdog/WatchDogTimer.h b/shared-bindings/watchdog/WatchDogTimer.h index 375ca653d7..48044748a9 100644 --- a/shared-bindings/watchdog/WatchDogTimer.h +++ b/shared-bindings/watchdog/WatchDogTimer.h @@ -28,17 +28,20 @@ #define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGTIMER_H #include +#include "shared-bindings/watchdog/WatchDogMode.h" -// extern void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep); -// extern void common_hal_wdt_feed(void); -// extern void common_hal_wdt_disable(void); +typedef struct _watchdog_watchdogtimer_obj_t watchdog_watchdogtimer_obj_t; +extern void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self); -// typedef struct _wdt_wdt_obj_t { -// mp_obj_base_t base; -// uint32_t timeout; -// bool sleep; -// } wdt_wdt_obj_t; +extern void common_hal_watchdog_set_mode(watchdog_watchdogtimer_obj_t *self, watchdog_watchdogmode_t); +extern watchdog_watchdogmode_t common_hal_watchdog_get_mode(watchdog_watchdogtimer_obj_t *self); + +extern void common_hal_watchdog_set_timeout(watchdog_watchdogtimer_obj_t *self, mp_float_t timeout); +extern mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self); + +extern void common_hal_watchdog_enable(watchdog_watchdogtimer_obj_t *self); +extern void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self); extern const mp_obj_type_t watchdog_watchdogtimer_type; From aa0445228ba79ac042e2802ae9f1a5e71b9a3ed6 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 27 May 2020 11:38:38 +0800 Subject: [PATCH 044/131] locale: generate strings for watchdog timer Run `make translate` to generate strings for `shared-bindings/watchdog`. Signed-off-by: Sean Cross --- locale/ID.po | 30 +++++++++++++++++++++++++++++- locale/circuitpython.pot | 30 +++++++++++++++++++++++++++++- locale/cs.po | 30 +++++++++++++++++++++++++++++- locale/de_DE.po | 30 +++++++++++++++++++++++++++++- locale/en_US.po | 30 +++++++++++++++++++++++++++++- locale/en_x_pirate.po | 30 +++++++++++++++++++++++++++++- locale/es.po | 30 +++++++++++++++++++++++++++++- locale/fil.po | 30 +++++++++++++++++++++++++++++- locale/fr.po | 30 +++++++++++++++++++++++++++++- locale/it_IT.po | 30 +++++++++++++++++++++++++++++- locale/ko.po | 30 +++++++++++++++++++++++++++++- locale/nl.po | 30 +++++++++++++++++++++++++++++- locale/pl.po | 30 +++++++++++++++++++++++++++++- locale/pt_BR.po | 30 +++++++++++++++++++++++++++++- locale/sv.po | 30 +++++++++++++++++++++++++++++- locale/zh_Latn_pinyin.po | 30 +++++++++++++++++++++++++++++- 16 files changed, 464 insertions(+), 16 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 8bd3851673..ba2662201f 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:28+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1662,6 +1662,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "PERINGATAN: Nama file kode anda mempunyai dua ekstensi\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3049,6 +3069,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3204,6 +3228,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index b0d766a97b..4201850311 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:28+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1645,6 +1645,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3024,6 +3044,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3178,6 +3202,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index de98ac4fc1..8160156995 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:28+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1645,6 +1645,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3024,6 +3044,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3178,6 +3202,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 56615c6363..fe738d62a3 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:28+0800\n" "PO-Revision-Date: 2020-05-18 02:48+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German 0" msgstr "value_count muss größer als 0 sein" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index 887bf90402..638e70f66a 100644 --- a/locale/en_US.po +++ b/locale/en_US.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:28+0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -1645,6 +1645,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3024,6 +3044,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3178,6 +3202,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index ccd05e59d7..fa94bfa1fa 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.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:28+0800\n" "PO-Revision-Date: 2020-03-30 22:11+0000\n" "Last-Translator: Tannewt \n" "Language-Team: English 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/es.po b/locale/es.po index d3af180035..a2dcdbd113 100644 --- a/locale/es.po +++ b/locale/es.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:28+0800\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: \n" @@ -1664,6 +1664,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "ADVERTENCIA: El nombre de archivo de tu código tiene dos extensiones\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3067,6 +3087,10 @@ msgstr "limite debe ser en el rango 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() toma un sequencio 9" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3221,6 +3245,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index c3b5070aa2..3593fa7e94 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:28+0800\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1672,6 +1672,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "BABALA: Ang pangalan ng file ay may dalawang extension\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3079,6 +3099,10 @@ msgstr "ang threshold ay dapat sa range 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kumukuha ng 9-sequence" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3234,6 +3258,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 9cd5a7cb64..c9b5bf74af 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:28+0800\n" "PO-Revision-Date: 2020-05-26 19:37+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French 0" msgstr "'value_count' doit être > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "la fenêtre doit être <= intervalle" diff --git a/locale/it_IT.po b/locale/it_IT.po index f94a03aee6..5a4e3ac5a5 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.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:28+0800\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1681,6 +1681,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "ATTENZIONE: Il nome del sorgente ha due estensioni\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3086,6 +3106,10 @@ msgstr "la soglia deve essere nell'intervallo 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3241,6 +3265,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index f85a4356a4..29f825397b 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:28+0800\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1650,6 +1650,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3029,6 +3049,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3183,6 +3207,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index bab9e30793..d1477d83dd 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:28+0800\n" "PO-Revision-Date: 2020-05-19 17:08+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" @@ -1689,6 +1689,26 @@ msgstr "Voltage lees time-out" msgid "WARNING: Your code filename has two extensions\n" msgstr "WAARSCHUWING: De bestandsnaam van de code heeft twee extensies\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3073,6 +3093,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3227,6 +3251,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 10716998a7..a5064d6bdf 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:28+0800\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -1650,6 +1650,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "UWAGA: Nazwa pliku ma dwa rozszerzenia\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3035,6 +3055,10 @@ msgstr "threshold musi być w zakresie 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() wymaga 9-elementowej sekwencji" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3189,6 +3213,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "value_count musi być > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 21293c4977..d0d81bccba 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:28+0800\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -1663,6 +1663,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "AVISO: Seu arquivo de código tem duas extensões\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3047,6 +3067,10 @@ msgstr "Limite deve estar no alcance de 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3202,6 +3226,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index c95e36f963..25f8f34da6 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:28+0800\n" "PO-Revision-Date: 2020-05-20 18:32+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1686,6 +1686,26 @@ msgstr "Avläsning av spänning tog för lång tid" msgid "WARNING: Your code filename has two extensions\n" msgstr "VARNING: Ditt filnamn för kod har två tillägg\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3081,6 +3101,10 @@ msgstr "tröskelvärdet måste ligga i intervallet 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kräver en 9-sekvens" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "timeout måste vara 0.0-100.0 sekunder" @@ -3235,6 +3259,10 @@ msgstr "värdet måste passa i %d byte(s)" msgid "value_count must be > 0" msgstr "value_count måste vara > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "window måste vara <= interval" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 72e5d88cf5..19b79f2c53 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:28+0800\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1673,6 +1673,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "Jǐnggào: Nǐ de dàimǎ wénjiàn míng yǒu liǎng gè kuòzhǎn míng\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3065,6 +3085,10 @@ msgstr "yùzhí bìxū zài fànwéi 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() xūyào 9 xùliè" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo" @@ -3219,6 +3243,10 @@ msgstr "Zhí bìxū fúhé %d zì jié" msgid "value_count must be > 0" msgstr "zhí jìshù bìxū wèi > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "Chuāngkǒu bìxū shì <= jiàngé" From 4e22b9a3464bbace0d0cd6d51bf2afaf40cd5722 Mon Sep 17 00:00:00 2001 From: dherrada <=> Date: Wed, 27 May 2020 11:30:51 -0400 Subject: [PATCH 045/131] 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 53fb699436739891988bdbd0f1a6546fc1f67859 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 27 May 2020 11:45:15 -0400 Subject: [PATCH 046/131] Add pin resetting across boards, fix array size detection issue --- ports/mimxrt10xx/common-hal/busio/I2C.c | 107 +++++++++++++----- ports/mimxrt10xx/common-hal/busio/I2C.h | 4 +- ports/mimxrt10xx/common-hal/busio/SPI.c | 34 +++++- ports/mimxrt10xx/common-hal/busio/UART.c | 24 +++- .../common-hal/microcontroller/Pin.c | 1 + .../mimxrt10xx/MIMXRT1011/periph.c | 6 +- .../mimxrt10xx/MIMXRT1011/periph.h | 6 + .../mimxrt10xx/MIMXRT1021/periph.c | 6 +- .../mimxrt10xx/MIMXRT1021/periph.h | 6 + .../mimxrt10xx/MIMXRT1062/periph.c | 6 +- .../mimxrt10xx/MIMXRT1062/periph.h | 6 + ports/stm/common-hal/busio/SPI.c | 20 ++-- 12 files changed, 165 insertions(+), 61 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/busio/I2C.c b/ports/mimxrt10xx/common-hal/busio/I2C.c index 0bb7dcc6c6..0ac3678680 100644 --- a/ports/mimxrt10xx/common-hal/busio/I2C.c +++ b/ports/mimxrt10xx/common-hal/busio/I2C.c @@ -27,15 +27,32 @@ #include +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/busio/I2C.h" #include "py/mperrno.h" #include "py/runtime.h" #include "periph.h" #include "fsl_lpi2c.h" +#include "fsl_gpio.h" #define I2C_CLOCK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllClk) / 8 / (1+CLOCK_GetDiv(kCLOCK_Lpi2cDiv))) +#define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U +//arrays use 0 based numbering: I2C1 is stored at index 0 +#define MAX_I2C 4 +STATIC bool reserved_i2c[MAX_I2C]; +STATIC bool never_reset_i2c[MAX_I2C]; + +void i2c_reset(void) { + for(uint i = 0; i < MP_ARRAY_SIZE(mcu_i2c_banks); i++) { + if (!never_reset_i2c[i]) { + reserved_i2c[i] = false; + LPI2C_MasterDeinit(mcu_i2c_banks[i]); + } + } +} static void config_periph_pin(const mcu_periph_obj_t *periph) { IOMUXC_SetPinMux( @@ -56,11 +73,49 @@ static void config_periph_pin(const mcu_periph_obj_t *periph) { | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); } +static void i2c_check_pin_config(const mcu_pin_obj_t *pin, uint32_t pull) +{ + IOMUXC_SetPinConfig(0, 0, 0, 0, pin->cfg_reg, + IOMUXC_SW_PAD_CTL_PAD_HYS(1) + | IOMUXC_SW_PAD_CTL_PAD_PUS(0) // Pulldown + | IOMUXC_SW_PAD_CTL_PAD_PUE(pull) // 0=nopull (keeper), 1=pull + | IOMUXC_SW_PAD_CTL_PAD_PKE(1) + | IOMUXC_SW_PAD_CTL_PAD_ODE(0) + | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) + | IOMUXC_SW_PAD_CTL_PAD_DSE(1) + | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); +} + void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint32_t frequency, uint32_t timeout) { - const uint32_t sda_count = sizeof(mcu_i2c_sda_list) / sizeof(mcu_periph_obj_t); - const uint32_t scl_count = sizeof(mcu_i2c_scl_list) / sizeof(mcu_periph_obj_t); + #if CIRCUITPY_REQUIRE_I2C_PULLUPS + // Test that the pins are in a high state. (Hopefully indicating they are pulled up.) + IOMUXC_SetPinMux(sda->mux_reg, IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5, 0, 0, 0, 0); + IOMUXC_SetPinMux(scl->mux_reg, IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5, 0, 0, 0, 0); + i2c_check_pin_config(sda, 1); + i2c_check_pin_config(scl, 1); + const gpio_pin_config_t check_config = { kGPIO_DigitalInput, 0, kGPIO_NoIntmode }; + GPIO_PinInit(sda->gpio, sda->number, &check_config); + GPIO_PinInit(scl->gpio, scl->number, &check_config); + + common_hal_mcu_delay_us(10); + + i2c_check_pin_config(sda, 0); + i2c_check_pin_config(scl, 0); + + // We must pull up within 3us to achieve 400khz. + common_hal_mcu_delay_us(3); + + if( !GPIO_PinRead(sda->gpio, sda->number) || !GPIO_PinRead(scl->gpio, scl->number)) { + common_hal_reset_pin(sda); + common_hal_reset_pin(scl); + mp_raise_RuntimeError(translate("SDA or SCL needs a pull up")); + } + #endif + + const uint32_t sda_count = MP_ARRAY_SIZE(mcu_i2c_sda_list); + const uint32_t scl_count = MP_ARRAY_SIZE(mcu_i2c_scl_list); for (uint32_t i = 0; i < sda_count; ++i) { if (mcu_i2c_sda_list[i].pin != sda) @@ -73,21 +128,21 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, if (mcu_i2c_scl_list[j].bank_idx != mcu_i2c_sda_list[i].bank_idx) continue; - self->sda_pin = &mcu_i2c_sda_list[i]; - self->scl_pin = &mcu_i2c_scl_list[j]; + self->sda = &mcu_i2c_sda_list[i]; + self->scl = &mcu_i2c_scl_list[j]; break; } } - if(self->sda_pin == NULL || self->scl_pin == NULL) { + if(self->sda == NULL || self->scl == NULL) { mp_raise_RuntimeError(translate("Invalid I2C pin selection")); } else { - self->i2c = mcu_i2c_banks[self->sda_pin->bank_idx - 1]; + self->i2c = mcu_i2c_banks[self->sda->bank_idx - 1]; } - config_periph_pin(self->sda_pin); - config_periph_pin(self->scl_pin); + config_periph_pin(self->sda); + config_periph_pin(self->scl); lpi2c_master_config_t config = { 0 }; LPI2C_MasterGetDefaultConfig(&config); @@ -96,34 +151,35 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, LPI2C_MasterInit(self->i2c, &config, I2C_CLOCK_FREQ); -#if CIRCUITPY_REQUIRE_I2C_PULLUPS -// if (!gpio_get_pin_level(sda->number) || !gpio_get_pin_level(scl->number)) { -// reset_pin_number(sda->number); -// reset_pin_number(scl->number); -// mp_raise_RuntimeError(translate("SDA or SCL needs a pull up")); -// } -#endif + claim_pin(self->sda->pin); + claim_pin(self->scl->pin); +} - claim_pin(self->sda_pin->pin); - claim_pin(self->scl_pin->pin); +void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { + never_reset_i2c[self->sda->bank_idx - 1] = true; + + common_hal_never_reset_pin(self->sda->pin); + common_hal_never_reset_pin(self->scl->pin); } bool common_hal_busio_i2c_deinited(busio_i2c_obj_t *self) { - return self->sda_pin == NULL; + return self->sda == NULL; } void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { if (common_hal_busio_i2c_deinited(self)) { return; } + reserved_i2c[self->sda->bank_idx - 1] = false; + never_reset_i2c[self->sda->bank_idx - 1] = false; LPI2C_MasterDeinit(self->i2c); -// reset_pin_number(self->sda_pin); -// reset_pin_number(self->scl_pin); + common_hal_reset_pin(self->sda->pin); + common_hal_reset_pin(self->scl->pin); - self->sda_pin = NULL; - self->scl_pin = NULL; + self->sda = NULL; + self->scl = NULL; } bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { @@ -183,10 +239,3 @@ uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, return MP_EIO; } - -void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { -// never_reset_sercom(self->i2c_desc.device.hw); -// -// never_reset_pin_number(self->scl_pin); -// never_reset_pin_number(self->sda_pin); -} diff --git a/ports/mimxrt10xx/common-hal/busio/I2C.h b/ports/mimxrt10xx/common-hal/busio/I2C.h index 924e108116..789f01a5f5 100644 --- a/ports/mimxrt10xx/common-hal/busio/I2C.h +++ b/ports/mimxrt10xx/common-hal/busio/I2C.h @@ -37,8 +37,8 @@ typedef struct { mp_obj_base_t base; LPI2C_Type *i2c; bool has_lock; - const mcu_periph_obj_t *scl_pin; - const mcu_periph_obj_t *sda_pin; + const mcu_periph_obj_t *scl; + const mcu_periph_obj_t *sda; } busio_i2c_obj_t; #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_I2C_H diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index 54c8d001db..23e2761143 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -25,6 +25,8 @@ * THE SOFTWARE. */ +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/busio/SPI.h" #include "py/mperrno.h" #include "py/runtime.h" @@ -34,6 +36,8 @@ #include +#define LPSPI_MASTER_CLK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllPfd0Clk) / (CLOCK_GetDiv(kCLOCK_LpspiDiv) + 1)) + //arrays use 0 based numbering: SPI1 is stored at index 0 #define MAX_SPI 4 STATIC bool reserved_spi[MAX_SPI]; @@ -58,11 +62,12 @@ STATIC void config_periph_pin(const mcu_periph_obj_t *periph) { | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); } -#define LPSPI_MASTER_CLK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllPfd0Clk) / (CLOCK_GetDiv(kCLOCK_LpspiDiv) + 1)) - void spi_reset(void) { - for (int i = 0; i < MAX_SPI; i++) { - reserved_spi[i] = false; + for (uint i = 0; i < MP_ARRAY_SIZE(mcu_spi_banks); i++) { + if (!never_reset_spi[i]) { + reserved_spi[i] = false; + LPSPI_Deinit(mcu_spi_banks[i]); + } } } @@ -192,7 +197,14 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { - // TODO + never_reset_spi[self->clock->bank_idx - 1] = true; + common_hal_never_reset_pin(self->clock->pin); + if (self->mosi != NULL) { + common_hal_never_reset_pin(self->mosi->pin); + } + if (self->miso != NULL) { + common_hal_never_reset_pin(self->miso->pin); + } } bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { @@ -203,8 +215,20 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { if (common_hal_busio_spi_deinited(self)) { return; } + LPSPI_Deinit(self->spi); + reserved_spi[self->clock->bank_idx - 1] = false; + never_reset_spi[self->clock->bank_idx - 1] = false; + common_hal_reset_pin(self->clock->pin); + if (self->mosi != NULL) { + common_hal_reset_pin(self->mosi->pin); + } + if (self->miso != NULL) { + common_hal_reset_pin(self->miso->pin); + } self->clock = NULL; + self->mosi = NULL; + self->miso = NULL; } bool common_hal_busio_spi_configure(busio_spi_obj_t *self, diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 015b0188f4..463c404f9c 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -25,6 +25,7 @@ * THE SOFTWARE. */ +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/busio/UART.h" @@ -73,6 +74,13 @@ void LPUART_UserCallback(LPUART_Type *base, lpuart_handle_t *handle, status_t st } } +void uart_reset(void) { + for(uint i = 0; i < MP_ARRAY_SIZE(mcu_uart_banks); i++) { + reserved_uart[i] = false; + LPUART_Deinit(mcu_uart_banks[i]); + } +} + void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, @@ -278,13 +286,21 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { if (common_hal_busio_uart_deinited(self)) { return; } - + if (self->rx) { + reserved_uart[self->rx->bank_idx - 1] = false; + } else { + reserved_uart[self->tx->bank_idx - 1] = false; + } + LPUART_Deinit(self->uart); - gc_free(self->ringbuf); -// reset_pin_number(self->rx); -// reset_pin_number(self->tx); + if (self->rx) { + common_hal_reset_pin(self->rx->pin); + } + if (self->tx) { + common_hal_reset_pin(self->tx->pin); + } self->rx = NULL; self->tx = NULL; diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index e75df6e609..233e66006b 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -5,6 +5,7 @@ * * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries * Copyright (c) 2019 Artur Pacholec + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c index 2fed6dfc61..3e2c6972b0 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c @@ -29,7 +29,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[] = { LPI2C1, LPI2C2 }; +LPI2C_Type *mcu_i2c_banks[2] = { LPI2C1, LPI2C2 }; const mcu_periph_obj_t mcu_i2c_sda_list[8] = { PERIPH_PIN(1, 0, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_AD_13), @@ -55,7 +55,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[8] = { PERIPH_PIN(2, 3, kIOMUXC_LPI2C2_SCL_SELECT_INPUT, 3, &pin_GPIO_10), }; -LPSPI_Type *mcu_spi_banks[] = { LPSPI1, LPSPI2 }; +LPSPI_Type *mcu_spi_banks[2] = { LPSPI1, LPSPI2 }; const mcu_periph_obj_t mcu_spi_sck_list[4] = { PERIPH_PIN(1, 0, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_AD_06), @@ -81,7 +81,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[4] = { PERIPH_PIN(2, 1, kIOMUXC_LPSPI2_SDI_SELECT_INPUT, 1, &pin_GPIO_SD_09), }; -LPUART_Type *mcu_uart_banks[] = { LPUART1, LPUART2, LPUART3, LPUART4 }; +LPUART_Type *mcu_uart_banks[4] = { LPUART1, LPUART2, LPUART3, LPUART4 }; const mcu_periph_obj_t mcu_uart_rx_list[9] = { PERIPH_PIN(1, 2, kIOMUXC_LPUART1_RXD_SELECT_INPUT, 0, &pin_GPIO_SD_11), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h index d6d4895371..3bc86f33a5 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h @@ -27,13 +27,19 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H +LPI2C_Type *mcu_i2c_banks[2]; + extern const mcu_periph_obj_t mcu_i2c_sda_list[8]; extern const mcu_periph_obj_t mcu_i2c_scl_list[8]; +LPSPI_Type *mcu_spi_banks[2]; + extern const mcu_periph_obj_t mcu_spi_sck_list[4]; extern const mcu_periph_obj_t mcu_spi_mosi_list[4]; extern const mcu_periph_obj_t mcu_spi_miso_list[4]; +LPUART_Type *mcu_uart_banks[4]; + extern const mcu_periph_obj_t mcu_uart_rx_list[9]; extern const mcu_periph_obj_t mcu_uart_tx_list[9]; extern const mcu_periph_obj_t mcu_uart_rts_list[4]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c index 60f301668a..814b4120d1 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c @@ -30,7 +30,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; +LPI2C_Type *mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; const mcu_periph_obj_t mcu_i2c_sda_list[8] = { PERIPH_PIN(1, 6, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_EMC_03), @@ -60,7 +60,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[8] = { PERIPH_PIN(4, 3, kIOMUXC_LPI2C4_SCL_SELECT_INPUT, 1, &pin_GPIO_SD_B1_02), }; -LPSPI_Type *mcu_spi_banks[] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; +LPSPI_Type *mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; const mcu_periph_obj_t mcu_spi_sck_list[8] = { PERIPH_PIN(1, 4, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_SD_B0_02), @@ -104,7 +104,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[8] = { PERIPH_PIN(4, 4, kIOMUXC_LPSPI2_SDI_SELECT_INPUT, 1, &pin_GPIO_EMC_35), }; -LPUART_Type *mcu_uart_banks[] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; +LPUART_Type *mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; const mcu_periph_obj_t mcu_uart_rx_list[16] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_07), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h index ba88ef4c61..814bc5f6c3 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h @@ -28,13 +28,19 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H +LPI2C_Type *mcu_i2c_banks[4]; + extern const mcu_periph_obj_t mcu_i2c_sda_list[8]; extern const mcu_periph_obj_t mcu_i2c_scl_list[8]; +LPSPI_Type *mcu_spi_banks[4]; + extern const mcu_periph_obj_t mcu_spi_sck_list[8]; extern const mcu_periph_obj_t mcu_spi_mosi_list[8]; extern const mcu_periph_obj_t mcu_spi_miso_list[8]; +LPUART_Type *mcu_uart_banks[8]; + extern const mcu_periph_obj_t mcu_uart_rx_list[16]; extern const mcu_periph_obj_t mcu_uart_tx_list[16]; extern const mcu_periph_obj_t mcu_uart_rts_list[10]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c index 9a1a4ab65c..388a1b0147 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c @@ -29,7 +29,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; +LPI2C_Type *mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; const mcu_periph_obj_t mcu_i2c_sda_list[9] = { PERIPH_PIN(1, 2, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_SD_B1_05), @@ -61,7 +61,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[9] = { PERIPH_PIN(4, 0, kIOMUXC_LPI2C4_SCL_SELECT_INPUT, 1, &pin_GPIO_AD_B0_12), }; -LPSPI_Type *mcu_spi_banks[] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; +LPSPI_Type *mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; const mcu_periph_obj_t mcu_spi_sck_list[8] = { PERIPH_PIN(1, 3, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_EMC_27), @@ -105,7 +105,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[8] = { PERIPH_PIN(4, 1, kIOMUXC_LPSPI4_SDI_SELECT_INPUT, 1, &pin_GPIO_B1_05), }; -LPUART_Type *mcu_uart_banks[] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; +LPUART_Type *mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; const mcu_periph_obj_t mcu_uart_rx_list[18] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_13), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h index 45b92f2473..35ac4fc9b7 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h @@ -27,13 +27,19 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H +LPI2C_Type *mcu_i2c_banks[4]; + extern const mcu_periph_obj_t mcu_i2c_sda_list[9]; extern const mcu_periph_obj_t mcu_i2c_scl_list[9]; +LPSPI_Type *mcu_spi_banks[4]; + extern const mcu_periph_obj_t mcu_spi_sck_list[8]; extern const mcu_periph_obj_t mcu_spi_mosi_list[8]; extern const mcu_periph_obj_t mcu_spi_miso_list[8]; +LPUART_Type *mcu_uart_banks[8]; + extern const mcu_periph_obj_t mcu_uart_rx_list[18]; extern const mcu_periph_obj_t mcu_uart_tx_list[18]; extern const mcu_periph_obj_t mcu_uart_rts_list[9]; diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index d3310efe06..65eeb8ebcf 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -269,18 +269,14 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { - for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_spi_banks); i++) { - if (mcu_spi_banks[i] == self->handle.Instance) { - never_reset_spi[i] = true; - never_reset_pin_number(self->sck->pin->port, self->sck->pin->number); - if (self->mosi != NULL) { - never_reset_pin_number(self->mosi->pin->port, self->mosi->pin->number); - } - if (self->miso != NULL) { - never_reset_pin_number(self->miso->pin->port, self->miso->pin->number); - } - break; - } + + never_reset_spi[self->sck->periph_index - 1] = true; + never_reset_pin_number(self->sck->pin->port, self->sck->pin->number); + if (self->mosi != NULL) { + never_reset_pin_number(self->mosi->pin->port, self->mosi->pin->number); + } + if (self->miso != NULL) { + never_reset_pin_number(self->miso->pin->port, self->miso->pin->number); } } From d06a7c467195bd3efb1cbc4aef8887160a45b6b3 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 27 May 2020 11:47:15 -0400 Subject: [PATCH 047/131] 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 048/131] 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 049/131] 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 050/131] 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 051/131] 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 From 90571e7b7f773e0bedbb69617101f67be4128a9e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 27 May 2020 16:43:35 -0500 Subject: [PATCH 052/131] Various doc examples: Fix the "/ 18" copypasta bug --- shared-bindings/audiobusio/I2SOut.c | 2 +- shared-bindings/audiocore/RawSample.c | 2 +- shared-bindings/audioio/AudioOut.c | 2 +- shared-bindings/audiopwmio/PWMAudioOut.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index d965aac89e..fd71a6e852 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -61,7 +61,7 @@ //| length = 8000 // 440 //| sine_wave = array.array("H", [0] * length) //| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15) //| //| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) //| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9) diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index c0f9325e67..2eadf1fab4 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -61,7 +61,7 @@ //| length = 8000 // 440 //| sine_wave = array.array("h", [0] * length) //| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15)) +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15)) //| //| dac = audioio.AudioOut(board.SPEAKER) //| sine_wave = audiocore.RawSample(sine_wave) diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 5748682020..9ba72bd41d 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -61,7 +61,7 @@ //| length = 8000 // 440 //| sine_wave = array.array("H", [0] * length) //| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15) //| //| dac = audioio.AudioOut(board.SPEAKER) //| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index d6b102317f..812b7330d4 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -63,7 +63,7 @@ //| length = 8000 // 440 //| sine_wave = array.array("H", [0] * length) //| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15) //| //| dac = audiopwmio.PWMAudioOut(board.SPEAKER) //| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) From 3ecd8cbd20e0c230447f180c2b97834fd8eb2f8c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 27 May 2020 20:28:58 -0500 Subject: [PATCH 053/131] locale: Restore translations lost in 357467022 Merge pull request #2931 from tannewt/esp32s2_digitalio --- locale/cs.po | 68 ++--- locale/de_DE.po | 570 ++++++++++++++++++++----------------- locale/nl.po | 744 ++++++++++++++++++++++++------------------------ 3 files changed, 716 insertions(+), 666 deletions(-) diff --git a/locale/cs.po b/locale/cs.po index b4cfed2a90..825b31509a 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -3,25 +3,28 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \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" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"PO-Revision-Date: 2020-05-24 03:22+0000\n" +"Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" -"Language: \n" +"Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" +"X-Generator: Weblate 4.1-dev\n" #: main.c msgid "" "\n" "Code done running. Waiting for reload.\n" msgstr "" +"\n" +"Kód byl dokončen. Čekám na opětovné načtení.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -29,65 +32,70 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Založte prosím problém s obsahem vaší jednotky CIRCUITPY na adrese\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Pro ukončení, prosím resetujte desku bez " #: py/obj.c msgid " File \"%q\"" -msgstr "" +msgstr "  Soubor \"% q\"" #: py/obj.c msgid " File \"%q\", line %d" -msgstr "" +msgstr "  Soubor \"% q\", řádek% d" #: main.c msgid " output:\n" -msgstr "" +msgstr " výstup:\n" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "" +msgstr "%% c vyžaduje int nebo char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d adresní piny a %d rgb piny označují výšku %d, nikoli %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" -msgstr "" +msgstr "%q se nyní používá" #: py/obj.c msgid "%q index out of range" -msgstr "" +msgstr "%q index je mimo rozsah" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "" +msgstr "Indexy% q musí být celá čísla, nikoli% s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "Seznam% q musí být seznam" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c #: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" -msgstr "" +msgstr "% q musí být > = 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "% q musí být n-tice délky 2" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "" +msgstr "% q by měl být int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -368,10 +376,6 @@ 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 "" @@ -805,7 +809,7 @@ msgstr "" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -884,11 +888,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -964,8 +968,7 @@ 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/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "" @@ -1076,6 +1079,10 @@ msgstr "" msgid "Name too long" msgstr "" +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Negative step not supported" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" msgstr "" @@ -1238,10 +1245,6 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Pin is input only" -msgstr "" - #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" @@ -1419,7 +1422,7 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -3066,7 +3069,8 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/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 25476a7a8f..9c3af7cdb9 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \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" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"PO-Revision-Date: 2020-05-23 16:13+0000\n" +"Last-Translator: Timon \n" "Language-Team: German \n" "Language: de_DE\n" @@ -43,7 +43,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"Zum Beenden setzen Sie bitte die Karte ohne " +"Zum Beenden, resete bitte das Board ohne " #: py/obj.c msgid " File \"%q\"" @@ -65,7 +65,7 @@ msgstr "%%c erwartet int oder char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d Adress-Pins und %d rgb-Pins zeigen eine Höhe von %d, nicht von %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -77,7 +77,7 @@ msgstr "Der Index %q befindet sich außerhalb des Bereiches" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "%q Indizes müssen ganze Zahlen sein, nicht %s" +msgstr "%q Indizes müssen Integer sein, nicht %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -96,7 +96,7 @@ msgstr "%q muss ein Tupel der Länge 2 sein" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "%q sollte ein int sein" +msgstr "%q sollte ein integer sein" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -167,7 +167,7 @@ msgstr "Das Objekt '%s' unterstützt '%q' nicht" #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" -msgstr "'%s' Objekt unterstützt keine Zuordnung von Elementen" +msgstr "'%s' Objekt unterstützt keine Zuweisung von Elementen" #: py/obj.c #, c-format @@ -186,7 +186,7 @@ msgstr "'%s' Objekt ist kein Iterator" #: py/objtype.c py/runtime.c #, c-format msgid "'%s' object is not callable" -msgstr "'%s' object ist nicht callable" +msgstr "'%s' object ist nicht aufrufbar" #: py/runtime.c #, c-format @@ -252,7 +252,7 @@ msgstr "*x muss Zuordnungsziel sein" #: py/obj.c msgid ", in %q\n" -msgstr "" +msgstr ", in %q\n" #: py/objcomplex.c msgid "0.0 to a complex power" @@ -313,11 +313,11 @@ msgstr "Alle timer werden benutzt" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Bereits am anbieten (advertising)." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "AnalogIn ist an diesem Pin nicht unterstützt" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -348,11 +348,13 @@ msgstr "Array-Werte sollten aus Einzelbytes bestehen." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Es darf höchstens %d %q spezifiziert werden (nicht %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +"Versuch einer Heap Reservierung, wenn die MicroPython-VM nicht ausgeführt " +"wird." #: main.c msgid "Auto-reload is off.\n" @@ -379,10 +381,6 @@ msgstr "Bit clock und word select müssen eine clock unit teilen" msgid "Bit depth must be multiple of 8." msgstr "Bit depth muss ein Vielfaches von 8 sein." -#: 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 pins müssen Hardware Interrupts unterstützen" @@ -405,7 +403,7 @@ msgstr "Die Helligkeit ist nicht einstellbar" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Buffer + Offset zu klein %d %d %d" #: shared-module/usb_hid/Device.c #, c-format @@ -415,7 +413,7 @@ msgstr "Der Puffergröße ist inkorrekt. Sie sollte %d bytes haben." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "Der Puffer ist kein Byte-Array" +msgstr "Der Buffer ist kein Byte-Array." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -425,7 +423,7 @@ msgstr "Der Puffer ist zu klein" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein." +msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -433,12 +431,12 @@ msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "Puffer zu groß und kann nicht reserviert werden" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Buffer um %d Bytes zu kurz" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -448,7 +446,7 @@ msgstr "Bus pin %d wird schon benutzt" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." -msgstr "Der Puffer muss 16 Bytes lang sein" +msgstr "Der Puffer muss 16 Bytes lang sein." #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." @@ -456,7 +454,7 @@ msgstr "Ein Bytes kann nur Werte zwischen 0 und 255 annehmen." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "CBC-Blöcke müssen ein Vielfaches von 16 Bytes sein" #: py/objtype.c msgid "Call super().__init__() before accessing native object." @@ -464,7 +462,7 @@ msgstr "Rufe super().__init__() vor dem Zugriff auf ein natives Objekt auf." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "CCCD kann nicht auf lokales Merkmal eingestellt werden" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" @@ -483,6 +481,7 @@ msgstr "Kann Temperatur nicht holen" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" +"Es können keine Scanantworten für erweiterte, verbindbare Anzeigen vorliegen." #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" @@ -498,13 +497,13 @@ msgstr "Aufnahme in eine Datei nicht möglich" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when USB is active." -msgstr "Kann '/' nicht remounten when USB aktiv ist" +msgstr "Kann '/' nicht remounten when USB aktiv ist." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Reset zum bootloader nicht möglich da bootloader nicht vorhanden" +msgstr "Reset zum bootloader nicht möglich da bootloader nicht vorhanden." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." @@ -512,11 +511,11 @@ msgstr "Der Wert kann nicht gesetzt werden, wenn die Richtung input ist." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "RTS oder CTS können im RS485-Modus nicht angegeben werden" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "" +msgstr "Slice kann keine sub-klasse sein" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." @@ -529,6 +528,7 @@ msgstr "sizeof scalar kann nicht eindeutig bestimmt werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" +"Die Frequenz eines bereits verwendeten Timers kann nicht variiert werden" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -540,13 +540,16 @@ msgstr "Schreiben von CharacteristicBuffer ist nicht vorgesehen" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "Der CircuitPython-Kerncode ist hart abgestürzt. Hoppla!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"CircuitPython befindet sich im abgesicherten Modus, da Sie beim Booten die " +"Reset-Taste gedrückt haben. Drücken Sie erneut, um den abgesicherten Modus " +"zu verlassen.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -574,6 +577,8 @@ msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"Die Verbindung wurde getrennt und kann nicht mehr verwendet werden. " +"Erstellen Sie eine neue Verbindung." #: py/persistentcode.c msgid "Corrupt .mpy file" @@ -589,35 +594,35 @@ msgstr "Konnte UART nicht initialisieren" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "Kanal konnte nicht initialisiert werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "Timer konnte nicht initialisiert werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "Kanal konnte nicht neu initiiert werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "Timer konnte nicht neu gestartet werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "PWM konnte nicht neu gestartet werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "PWM konnte nicht gestartet werden" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Interrupt konnte nicht gestartet werden, RX beschäftigt" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "Decoder konnte nicht zugeordnet werden" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -626,7 +631,7 @@ msgstr "Konnte first buffer nicht zuteilen" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "Eingabepuffer konnte nicht reserviert werden" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -635,15 +640,15 @@ msgstr "Konnte second buffer nicht zuteilen" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Absturz in den HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "DAC Kanal Intialisierungs Fehler" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "DAC Device Init Error" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -672,7 +677,7 @@ msgstr "Gerät in Benutzung" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "DigitalInOut wird auf dem angegebenen Pin nicht unterstützt" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -691,7 +696,7 @@ msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "Die EZB arbeitet jeweils nur mit 16 Bytes" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -736,10 +741,11 @@ msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." msgstr "" +"Erweiterte Werbung (advertising) mit Scanantwort wird nicht unterstützt." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "FFT ist nur für ndarrays definiert" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -765,7 +771,7 @@ msgstr "Konnte keine RX Buffer mit %d allozieren" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Verbindung fehlgeschlagen: interner Fehler" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" @@ -773,7 +779,7 @@ msgstr "Verbindung nicht erfolgreich: timeout" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Parsen der MP3 Datei fehlgeschlagen" #: ports/nrf/sd_mutex.c #, c-format @@ -782,7 +788,7 @@ msgstr "Mutex konnte nicht freigegeben werden. Status: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Interner Flash konnte nicht geschrieben werden." #: py/moduerrno.c msgid "File exists" @@ -797,6 +803,8 @@ msgstr "" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" +"Die Frequenz muss mit dem vorhandenen PWMOut unter Verwendung dieses Timers " +"übereinstimmen" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -816,11 +824,11 @@ msgstr "Gruppe voll" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Hardware beschäftigt, versuchen Sie alternative Pins" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Hardware in benutzung, probiere alternative Pins" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -828,7 +836,7 @@ msgstr "Lese/Schreibe-operation an geschlossener Datei" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "I2C-Init-Fehler" #: extmod/machine_i2c.c msgid "I2C operation not supported" @@ -837,7 +845,7 @@ msgstr "I2C-operation nicht unterstützt" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV muss %d Bytes lang sein" #: py/persistentcode.c msgid "" @@ -857,20 +865,20 @@ msgstr "Eingabe-/Ausgabefehler" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Unzureichende Authentifizierung" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Unzureichende Verschlüsselung" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "Interner Definitionsfehler" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Interner Fehler #%d" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -879,7 +887,7 @@ msgstr "Ungültiger %q pin" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Ungültiger ADC-Einheitenwert" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" @@ -887,11 +895,11 @@ msgstr "Ungültige BMP-Datei" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "Ungültiger DAC-Pin angegeben" #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "Ungültige I2C-Pinauswahl" #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c @@ -899,13 +907,13 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Ungültige PWM Frequenz" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "Ungültige SPI-Pin-Auswahl" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "Ungültige UART-Pinauswahl" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" @@ -921,7 +929,7 @@ msgstr "Ungültige Puffergröße" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "Ungültige Byteorder String" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" @@ -933,7 +941,7 @@ msgstr "Ungültige Anzahl von Kanälen" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "Ungültige Richtung" +msgstr "Ungültige Richtung." #: shared-module/audiocore/WaveFile.c msgid "Invalid file" @@ -945,11 +953,11 @@ msgstr "Ungültige format chunk size" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "Ungültige Frequenz geliefert" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Ungültiger Speicherzugriff." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -979,14 +987,13 @@ msgstr "Ungültiger Pin für rechten 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/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Ungültige Pins" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Ungültige Pins für PWMOut" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c @@ -999,7 +1006,7 @@ msgstr "Ungültige Eigenschaften" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "Ungültiger Ausführungsmodus" +msgstr "Ungültiger Ausführungsmodus." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" @@ -1019,11 +1026,11 @@ msgstr "Ungültige wave Datei" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "Ungültige Wort- / Bitlänge" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "Der Schlüssel muss 16, 24 oder 32 Byte lang sein" #: py/compile.c msgid "LHS of keyword arg must be an id" @@ -1047,11 +1054,11 @@ msgstr "Länge darf nicht negativ sein" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "MISO pin Initialisierung fehlgeschlagen" +msgstr "MISO pin Initialisierung fehlgeschlagen." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "MOSI pin Initialisierung fehlgeschlagen" +msgstr "MOSI pin Initialisierung fehlgeschlagen." #: shared-module/displayio/Shape.c #, c-format @@ -1061,10 +1068,11 @@ msgstr "Maximaler x-Wert beim Spiegeln ist %d" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" +"MicroPython NLR-Sprung fehlgeschlagen. Wahrscheinlich Speicherbeschädigung." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "Schwerwiegender MicroPython-Fehler." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -1073,7 +1081,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Fehlender MISO- oder MOSI-Pin" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." @@ -1081,16 +1089,20 @@ msgstr "Muss eine %q Unterklasse sein." #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Muss MISO- oder MOSI-Pin bereitstellen" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Muss ein Vielfaches von 6 RGB-Pins verwenden, nicht %d" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Name zu lang" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Negative step not supported" +msgstr "Negativer Schritt wird nicht unterstützt" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" @@ -1108,11 +1120,11 @@ msgstr "Kein DMA Kanal gefunden" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Kein MISO Pin" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Kein MOSI Pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1132,7 +1144,7 @@ msgstr "Keine Taktgeber verfügbar" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Keine Verbindung: Länge kann nicht bestimmt werden" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1157,15 +1169,15 @@ msgstr "Keine Hardwareunterstützung an diesem Pin" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Es wurde kein Schlüssel angegeben" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "Keine langen Integer (long) unterstützt" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "An diesem Pin sind keine Timer mehr verfügbar." #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1181,11 +1193,11 @@ msgstr "Keine solche Datei/Verzeichnis" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Kein Timer verfügbar" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "" +msgstr "Fehlerbehauptung für Nordic Soft Device." #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1246,7 +1258,7 @@ msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBus wird noch nicht unterstützt" #: py/moduerrno.c msgid "Permission denied" @@ -1260,17 +1272,13 @@ msgstr "Zugang verweigert" msgid "Pin does not have ADC capabilities" msgstr "Pin hat keine ADC Funktionalität" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Pin is input only" -msgstr "" - #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "Pin muss Hardware-Interrupts unterstützen" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "PIN-Nummer bereits von EXTI reserviert" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1279,6 +1287,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"Pinbelegung verwendet %d Bytes pro Element, was mehr als die idealen %d " +"Bytes verbraucht. Wenn dies nicht vermieden werden kann, übergeben Sie " +"allow_inefficient = True an den Konstruktor" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1286,21 +1297,21 @@ msgstr "und alle Module im Dateisystem \n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "Polygone brauchen mindestens 3 Punkte" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" -msgstr "" +msgstr "Pop aus einem leeren Ps2-Puffer" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "" +msgstr "Der Präfixbuffer muss sich auf dem Heap befinden" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" "Drücke eine Taste um dich mit der REPL zu verbinden. Drücke Strg-D zum neu " -"laden" +"laden." #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -1308,23 +1319,23 @@ msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." #: ports/stm/common-hal/pulseio/PulseIn.c msgid "PulseIn not supported on this chip" -msgstr "" +msgstr "PulseIn wird auf diesem Chip nicht unterstützt" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" -msgstr "" +msgstr "PulseOut wird auf diesem Chip nicht unterstützt" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "RNG DeInit-Fehler" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "RNG Init Fehler" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "RS485-Inversion angegeben, wenn nicht im RS485-Modus" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c @@ -1338,11 +1349,11 @@ msgstr "Eine RTC wird auf diesem Board nicht unterstützt" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS / CTS / RS485 Wird von diesem Gerät noch nicht unterstützt" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Fehler bei der Erzeugung von Zufallszahlen" #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" @@ -1362,7 +1373,7 @@ msgstr "Zu früh neu geladen" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "Der angeforderte AES-Modus wird nicht unterstützt" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1386,11 +1397,11 @@ msgstr "SDA oder SCL brauchen pull up" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "SPI-Init-Fehler" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "SPI-Neuinitialisierungsfehler" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" @@ -1403,15 +1414,15 @@ msgstr "Abtastrate zu hoch. Wert muss unter %d liegen" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "Scannen Sie bereits in Bearbeitung. Stoppen Sie mit stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "Ausgewählter CTS-Pin ungültig" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "Ausgewählter RTS-Pin ungültig" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1429,7 +1440,7 @@ msgstr "Slices werden nicht unterstützt" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Quell- und Zielbuffer müssen gleich lang sein" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1443,19 +1454,21 @@ msgstr "Die Stackgröße sollte mindestens 256 sein" msgid "Stream missing readinto() or write() method." msgstr "Stream fehlt readinto() oder write() Methode." -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Geben Sie mindestens einen UART-Pin an" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "Zeitüberschreitung beim Auslesen der Temperatur" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" +"Der CircuitPython-Heap wurde beschädigt, weil der Stapel zu klein war.\n" +"Bitte erhöhen Sie die Stapelgröße, wenn Sie wissen wie oder wenn nicht:" #: supervisor/shared/safe_mode.c msgid "" @@ -1471,51 +1484,59 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"Die Spannungsversorgung des Mikrocontrollers hat den minimal Wert " +"unterschritten.\n" +"Stellen Sie sicher, dass Ihr Netzteil genug Strom bereitstellt für den " +"gesamten Stromkreis und drücken Sie Reset (nach dem Auswerfen von " +"CIRCUITPY).\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" +"Das bits_per_sample des Samples stimmt nicht mit dem des Mixers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "" +msgstr "Die Kanalanzahl des Samples stimmt nicht mit der des Mixers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" -msgstr "" +msgstr "Die Abtastrate der Probe stimmt nicht mit der des Mischers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" msgstr "" +"Die Art des Vorzeichens des Samples stimmt nicht mit dem des Mixers überein" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" -msgstr "" +msgstr "Die Kachelhöhe muss die Bitmaphöhe genau teilen" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "Kachel index außerhalb der Grenzen" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "Kachelwert außerhalb der Grenzen" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" -msgstr "" +msgstr "Die Kachelbreite muss die Bitmap-Breite genau teilen" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +"Zeitbeschränkung ist zu groß: Maximale Zeitbeschränkung ist %d Sekunden" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." -msgstr "Zu viele Kanäle im sample" +msgstr "Zu viele Kanäle im sample." #: shared-module/displayio/__init__.c msgid "Too many display busses" -msgstr "" +msgstr "Zu viele Display Busse" #: shared-module/displayio/__init__.c msgid "Too many displays" @@ -1524,6 +1545,8 @@ msgstr "Zu viele displays" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +"Die Gesamtzahl der zu schreibenden Daten ist größer als " +"outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -1535,23 +1558,23 @@ msgstr "Tuple- oder struct_time-Argument erforderlich" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "UART Buffer reservierungs Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "" +msgstr "UART De-Init-Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "UART Init Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "UART Re-Init-Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "UART-Schreibfehler" #: shared-module/usb_hid/Device.c msgid "USB Busy" @@ -1567,7 +1590,7 @@ msgstr "UUID Integer-Wert muss ein Wert von 0 bis 0xffff sein" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "UUID Zeichenfolge ist nicht 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "UUID string ist nicht 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" @@ -1607,21 +1630,21 @@ msgstr "Unerwarteter nrfx uuid-Typ" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "" +msgstr "Unbekannter Gatt-Fehler: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "" +msgstr "Unbekannter Grund." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "" +msgstr "Unbekannter Sicherheitsfehler: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "" +msgstr "Unbekannter Soft Device-Fehler: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format @@ -1635,6 +1658,8 @@ msgid "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." msgstr "" +"Nicht näher bezeichnetes Problem. Möglicherweise wurde die Pairing-" +"Eingabeaufforderung auf dem anderen Gerät abgelehnt oder ignoriert." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c msgid "Unsupported baudrate" @@ -1654,12 +1679,12 @@ msgstr "Nicht unterstützte Operation" #: shared-bindings/digitalio/DigitalInOut.c msgid "Unsupported pull value." -msgstr "Nicht unterstützter Pull-Wert" +msgstr "Nicht unterstützter Pull-Wert." #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "" +msgstr "Wert Länge != Erforderliche feste Länge" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -1672,7 +1697,7 @@ msgstr "Viper-Funktionen unterstützen derzeit nicht mehr als 4 Argumente" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "Zeitüberschreitung beim Lesen der Spannung" #: main.c msgid "WARNING: Your code filename has two extensions\n" @@ -1697,11 +1722,13 @@ msgstr "" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "" +msgstr "Schreiben nicht unterstüzt für die Characteristic" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" +"Sie befinden sich im abgesicherten Modus: Es ist etwas Unerwartetes " +"passiert.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -1743,7 +1770,7 @@ msgstr "adresses ist leer" #: extmod/ulab/code/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" +msgstr "arctan2 ist nur für Skalare und ndarrays implementiert" #: py/modbuiltins.c msgid "arg is an empty sequence" @@ -1751,7 +1778,7 @@ msgstr "arg ist eine leere Sequenz" #: extmod/ulab/code/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "Das Argument argsort muss ein ndarray sein" #: py/runtime.c msgid "argument has wrong type" @@ -1768,7 +1795,7 @@ msgstr "Argument sollte '%q' sein, nicht '%q'" #: extmod/ulab/code/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "Argumente müssen ndarrays sein" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -1776,7 +1803,7 @@ msgstr "Array/Bytes auf der rechten Seite erforderlich" #: extmod/ulab/code/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" +msgstr "Sie haben versucht argmin/argmax von einer leeren Sequenz zu bekommen" #: py/objstr.c msgid "attributes not supported yet" @@ -1784,23 +1811,23 @@ msgstr "Attribute werden noch nicht unterstützt" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "Die Achse muss -1, 0, Keine oder 1 sein" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "Die Achse muss -1, 0 oder 1 sein" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "Die Achse muss None, 0 oder 1 sein" #: py/builtinevex.c msgid "bad compile mode" -msgstr "" +msgstr "schlechter Kompilierungsmodus" #: py/objstr.c msgid "bad conversion specifier" -msgstr "" +msgstr "schlechter Konvertierungsspezifizierer" #: py/objstr.c msgid "bad format string" @@ -1853,15 +1880,15 @@ msgstr "Buffer müssen gleich lang sein" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" -msgstr "" +msgstr "Tasten müssen digitalio.DigitalInOut sein" #: py/vm.c msgid "byte code not implemented" -msgstr "" +msgstr "Bytecode nicht implementiert" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "Byteorder ist kein String" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" @@ -1869,7 +1896,7 @@ msgstr "bytes mit mehr als 8 bits werden nicht unterstützt" #: py/objstr.c msgid "bytes value out of range" -msgstr "" +msgstr "Byte-Wert außerhalb des Bereichs" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" @@ -1898,6 +1925,8 @@ msgstr "kann nur Bytecode speichern" #: py/objtype.c msgid "can't add special method to already-subclassed class" msgstr "" +"Der bereits untergeordneten Klasse kann keine spezielle Methode hinzugefügt " +"werden" #: py/compile.c msgid "can't assign to expression" @@ -1988,11 +2017,13 @@ msgstr "Laden mit '%q' index nicht möglich" #: py/objgenerator.c msgid "can't pend throw to just-started generator" -msgstr "" +msgstr "Ich kann den Wurf nicht an den gerade gestarteten Generator hängen" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" msgstr "" +"Nicht \"None\" Werte können nicht an einen gerade gestarteten Generator " +"gesendet werden" #: py/objnamedtuple.c msgid "can't set attribute" @@ -2014,11 +2045,15 @@ msgstr "Speichern mit '%q' Index nicht möglich" msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" +"kann nicht von der automatischen Feldnummerierung zur manuellen " +"Feldspezifikation wechseln" #: py/objstr.c msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +"kann nicht von der manuellen Feldspezifikation zur automatischen " +"Feldnummerierung wechseln" #: py/objtype.c msgid "cannot create '%q' instances" @@ -2039,14 +2074,15 @@ msgstr "kann keinen relativen Import durchführen" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" msgstr "" +"Array kann nicht umgeformt werden (inkompatible Eingabe- / Ausgabeform)" #: py/emitnative.c msgid "casting" -msgstr "" +msgstr "Umwandlung (cast)" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "" +msgstr "(char) Zeichenpuffer zu klein" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" @@ -2058,7 +2094,7 @@ msgstr "chr() arg ist nicht in range(256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" -msgstr "" +msgstr "Kreis kann nur in einem Elternteil registriert werden" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" @@ -2067,6 +2103,7 @@ msgstr "Farbpuffer muss 3 Bytes (RGB) oder 4 Bytes (RGB + pad byte) sein" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" msgstr "" +"Der Farbpuffer muss ein Puffer, ein Tupel, eine Liste oder ein Int sein" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" @@ -2103,27 +2140,27 @@ msgstr "Umwandlung zu Objekt" #: extmod/ulab/code/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "Convolve-Argumente müssen lineare Arrays sein" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "Convolve-Argumente müssen ndarrays sein" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "Convolve Argumente dürfen nicht leer sein" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "Eingabearray konnte nicht aus der Form übertragen werden" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "Vandermonde-Matrix konnte nicht invertiert werden" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "ddof muss kleiner als die Länge des Datensatzes sein" #: py/parsenum.c msgid "decimal numbers not supported" @@ -2137,10 +2174,12 @@ msgstr "Die Standart-Ausnahmebehandlung muss als letztes sein" msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" +"Der Zielbuffer muss ein Bytearray oder ein Array vom Typ 'B' für bit_depth = " +"8 sein" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "" +msgstr "Der Zielpuffer muss ein Array vom Typ 'H' für bit_depth = 16 sein" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" @@ -2148,11 +2187,11 @@ msgstr "destination_length muss ein int >= 0 sein" #: py/objdict.c msgid "dict update sequence has wrong length" -msgstr "" +msgstr "Die Wörterbuch-Aktualisierungssequenz hat eine falsche Länge" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "diff Argument muss ein ndarray sein" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2177,7 +2216,7 @@ msgstr "leere Sequenz" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "" +msgstr "Ende des Formats wärend der Suche nach einem conversion specifier" #: shared-bindings/displayio/Shape.c msgid "end_x should be an int" @@ -2186,7 +2225,7 @@ msgstr "end_x sollte ein int sein" #: ports/nrf/common-hal/busio/UART.c #, c-format msgid "error = 0x%08lX" -msgstr "" +msgstr "Fehler = 0x%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" @@ -2226,23 +2265,23 @@ msgstr "Es wurden zusätzliche Argumente ohne Keyword angegeben" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "f-string expression Teil kann kein '#' beinhalten" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "Die f-String expression darf keinen Backslash enthalten" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-string: leere expression nicht erlaubt" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: erwartet '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: einzelne '}' nicht erlaubt" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c @@ -2255,11 +2294,11 @@ msgstr "Das Dateisystem muss eine Mount-Methode bereitstellen" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "Das erste Argument muss iterierbar sein" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "Das erste Argument muss ein Ndarray sein" #: py/objtype.c msgid "first argument to super() must be type" @@ -2271,11 +2310,11 @@ msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "Die Abflachungsreihenfolge muss entweder \"C\" oder \"F\" sein" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "Das Flip-Argument muss ein Ndarray sein" #: py/objint.c msgid "float too big" @@ -2287,7 +2326,7 @@ msgstr "Die Schriftart (font) muss 2048 Byte lang sein" #: py/objstr.c msgid "format requires a dict" -msgstr "" +msgstr "Format erfordert ein Wörterbuch (dict)" #: py/objdeque.c msgid "full" @@ -2308,7 +2347,7 @@ msgstr "Funktion hat mehrere Werte für Argument '%q'" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "Die Funktion ist nur für Skalare und Ndarrays implementiert" #: py/argcheck.c #, c-format @@ -2376,7 +2415,7 @@ msgstr "padding ist inkorrekt" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "Index ist außerhalb der Grenzen" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2387,11 +2426,11 @@ msgstr "index außerhalb der Reichweite" #: py/obj.c msgid "indices must be integers" -msgstr "Indizes müssen ganze Zahlen sein" +msgstr "Indizes müssen Integer sein" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "Indizes müssen Integer, Slices oder Boolesche Listen sein" #: py/compile.c msgid "inline assembler must be a function" @@ -2399,35 +2438,35 @@ msgstr "inline assembler muss eine function sein" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "Das Eingabeargument muss eine Ganzzahl oder ein 2-Tupel sein" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "Die Länge des Eingabearrays muss eine Potenz von 2 sein" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "Eingabedaten müssen iterierbar sein" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "Eingabematrix ist asymmetrisch" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "Eingabematrix ist singulär" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "Die Eingabe muss eine quadratische Matrix sein" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "Die Eingabe muss Tupel, Liste, Bereich oder Ndarray sein" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "Eingabevektoren müssen gleich lang sein" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" @@ -2509,11 +2548,11 @@ msgstr "issubclass() arg 2 muss eine Klasse oder ein Tupel von Klassen sein" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "iterables sind nicht gleich lang" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "Iterationen sind nicht konvergiert (converged)" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" @@ -2545,7 +2584,7 @@ msgstr "Für diesen Typ ist length nicht zulässig" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "Der Pegel muss zwischen 0 und 1 liegen" #: py/objarray.c msgid "lhs and rhs should be compatible" @@ -2563,7 +2602,7 @@ msgstr "Lokales '%q' verwendet bevor Typ bekannt" msgid "local variable referenced before assignment" msgstr "" "Es wurde versucht auf eine Variable zuzugreifen, die es (noch) nicht gibt. " -"Variablen immer zuerst Zuweisen!" +"Variablen immer zuerst Zuweisen" #: py/objint.c msgid "long int not supported in this build" @@ -2571,7 +2610,7 @@ msgstr "long int wird in diesem Build nicht unterstützt" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "fehlformatierter f-string" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" @@ -2579,15 +2618,15 @@ msgstr "map buffer zu klein" #: py/modmath.c shared-bindings/math/__init__.c msgid "math domain error" -msgstr "" +msgstr "Mathe-Domain-Fehler" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "Matrix Dimensionen stimmen nicht überein" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "Matrix ist nicht positiv definitiv" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -2614,7 +2653,7 @@ msgstr "Modul nicht gefunden" #: extmod/ulab/code/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "mehr Freiheitsgrade als Datenpunkte" #: py/compile.c msgid "multiple *x in assignment" @@ -2622,7 +2661,7 @@ msgstr "mehrere *x in Zuordnung" #: py/objtype.c msgid "multiple bases have instance lay-out conflict" -msgstr "" +msgstr "Mehrere Basen haben einen Instanzlayoutkonflikt" #: py/objtype.c msgid "multiple inheritance not supported" @@ -2630,7 +2669,7 @@ msgstr "Mehrfache Vererbung nicht unterstützt" #: py/emitnative.c msgid "must raise an object" -msgstr "" +msgstr "muss ein Objekt verursachen (raise)" #: extmod/machine_spi.c msgid "must specify all of sck/mosi/miso" @@ -2642,7 +2681,7 @@ msgstr "muss Schlüsselwortargument für key function verwenden" #: extmod/ulab/code/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n muss zwischen 0 und 9 liegen" #: py/runtime.c msgid "name '%q' is not defined" @@ -2658,24 +2697,24 @@ msgstr "Name für Argumente wiederverwendet" #: py/emitnative.c msgid "native yield" -msgstr "" +msgstr "native Ausbeute (yield)" #: py/runtime.c #, c-format msgid "need more than %d values to unpack" -msgstr "" +msgstr "Zum Entpacken sind mehr als %d Werte erforderlich" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "" +msgstr "negative Potenz ohne Gleitkomma (float) Unterstützung" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "" +msgstr "Negative shift Anzahl" #: py/vm.c msgid "no active exception to reraise" -msgstr "" +msgstr "Keine aktive Ausnahme zu verusachen (raise)" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c msgid "no available NIC" @@ -2683,7 +2722,7 @@ msgstr "kein verfügbares Netzwerkadapter (NIC)" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "" +msgstr "Kein Binding für nonlocal gefunden" #: py/builtinimport.c msgid "no module named '%q'" @@ -2700,7 +2739,7 @@ msgstr "kein solches Attribut" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "" +msgstr "non-UUID gefunden in service_uuids_whitelist" #: py/compile.c msgid "non-default argument follows default argument" @@ -2712,11 +2751,11 @@ msgstr "eine nicht-hex zahl wurde gefunden" #: py/compile.c msgid "non-keyword arg after */**" -msgstr "" +msgstr "Nicht-Schlüsselwort arg nach * / **" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "" +msgstr "Nicht-Schlüsselwort Argument nach Schlüsselwort Argument" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" @@ -2725,18 +2764,19 @@ msgstr "keine 128-bit UUID" #: py/objstr.c msgid "not all arguments converted during string formatting" msgstr "" +"Nicht alle Argumente wurden während der Formatierung des Strings konvertiert" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "" +msgstr "Nicht genügend Argumente für den Formatierungs-String" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "Die Anzahl der Argumente muss 2 oder 3 sein" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "Die Anzahl der Punkte muss mindestens 2 betragen" #: py/obj.c #, c-format @@ -2765,7 +2805,7 @@ msgstr "Objekt ist kein Iterator" #: py/objtype.c py/runtime.c msgid "object not callable" -msgstr "" +msgstr "Objekt nicht aufrufbar" #: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" @@ -2804,19 +2844,20 @@ msgstr "nur eine sample_rate=16000 wird unterstützt" #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" +"Es werden nur Slices mit Schritt = 1 (auch bekannt als None) unterstützt" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "Operanden konnten nicht zusammen gesendet werden" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "Die Operation ist für ndarrays nicht implementiert" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "Die Operation wird für den angegebenen Typ nicht unterstützt" #: py/modbuiltins.c msgid "ord expects a character" @@ -2826,7 +2867,7 @@ msgstr "ord erwartet ein Zeichen" #, c-format msgid "ord() expected a character, but string of length %d found" msgstr "" -"ord() erwartet ein Zeichen aber es wurde eine Zeichenfolge mit Länge %d " +"ord() erwartet einen Buchstaben(char) aber es wurde ein String mit Länge %d " "gefunden" #: py/objint_mpz.c @@ -2835,7 +2876,7 @@ msgstr "Überlauf beim konvertieren von long int zu machine word" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" -msgstr "" +msgstr "Die Palette muss 32 Byte lang sein" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" @@ -2851,7 +2892,7 @@ msgstr "Die Parameter müssen Register der Reihenfolge a2 bis a5 sein" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "" +msgstr "Die Parameter müssen Register der Reihenfolge r0 bis r3 sein" #: shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" @@ -2859,7 +2900,7 @@ msgstr "Pixelkoordinaten außerhalb der Grenzen" #: shared-bindings/displayio/Bitmap.c msgid "pixel value requires too many bits" -msgstr "" +msgstr "Der Pixelwert erfordert zu viele Bits" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" @@ -2867,7 +2908,7 @@ msgstr "pixel_shader muss displayio.Palette oder displayio.ColorConverter sein" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" -msgstr "" +msgstr "Polygon kann nur in einem übergeordneten Element registriert werden" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2894,7 +2935,7 @@ msgstr "pow() drittes Argument darf nicht 0 sein" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "" +msgstr "pow () mit 3 Argumenten erfordert Integer" #: extmod/modutimeq.c msgid "queue overflow" @@ -2902,11 +2943,11 @@ msgstr "Warteschlangenüberlauf" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "rohe F-Strings sind nicht implementiert" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "Real- und Imaginärteile müssen gleich lang sein" #: py/builtinimport.c msgid "relative import" @@ -2923,25 +2964,25 @@ msgstr "return annotation muss ein identifier sein" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "" +msgstr "Rückgabe erwartet '%q', aber '%q' erhalten" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins[%d] dupliziert eine andere Pinbelegung" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins [%d] befindet sich nicht am selben Port wie clock" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "Die rechte Seite muss ein Ndarray oder ein Skalar sein" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "rsplit(None,n)" #: shared-bindings/audiocore/RawSample.c msgid "" @@ -2965,31 +3006,31 @@ msgstr "kompilieren von Skripten nicht unterstützt" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "Form muss ein 2-Tupel sein" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "" +msgstr "Vorzeichen nicht erlaubt in einem String formatierungs specifier" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" -msgstr "" +msgstr "Vorzeichen mit ganzzahligem Formatbezeichner 'c' nicht erlaubt" #: py/objstr.c msgid "single '}' encountered in format string" -msgstr "" +msgstr "einzelne '}' in Formatierungs-String gefunden" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "Größe ist nur für ndarrays definiert" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" -msgstr "" +msgstr "Die Schlafdauer darf nicht negativ sein" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" -msgstr "" +msgstr "Der Slice-Schritt kann nicht Null sein" #: py/objint.c py/sequence.c msgid "small int overflow" @@ -3001,7 +3042,7 @@ msgstr "weicher reboot\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "sortierungs Argument muss ein ndarray sein" #: py/objstr.c msgid "start/end indices" @@ -3034,7 +3075,7 @@ msgstr "String index außerhalb des Bereiches" #: py/objstrunicode.c #, c-format msgid "string indices must be integers, not %s" -msgstr "" +msgstr "String indizes müssen Integer sein, nicht %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3075,11 +3116,11 @@ msgstr "threshold muss im Intervall 0-65536 liegen" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" -msgstr "" +msgstr "time.struct_time() nimmt eine 9-Sequenz an" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "" +msgstr "Das Zeitlimit muss 0,0-100,0 Sekunden betragen" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" @@ -3087,24 +3128,24 @@ msgstr "timeout muss >= 0.0 sein" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" -msgstr "" +msgstr "Zeitstempel außerhalb des Bereichs für Plattform time_t" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" -msgstr "" +msgstr "zu viele Argumente mit dem angegebenen Format" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "zu viele Indizes" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "" +msgstr "zu viele Werte zum Auspacken (erwartet %d)" #: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" -msgstr "" +msgstr "Tupelindex außerhalb des Bereichs" #: py/obj.c msgid "tuple/list has wrong length" @@ -3112,9 +3153,10 @@ msgstr "tupel/list hat falsche Länge" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "tuple/list required on RHS" -msgstr "" +msgstr "Tupel / Liste auf RHS erforderlich" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/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 und rx können nicht beide None sein" @@ -3129,15 +3171,15 @@ msgstr "Typ ist kein akzeptierter Basis-Typ" #: py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "" +msgstr "Typ vom Objekt '%q' hat kein Attribut '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" -msgstr "" +msgstr "Typ akzeptiert 1 oder 3 Argumente" #: py/objint_longlong.c msgid "ulonglong too large" -msgstr "" +msgstr "ulonglong zu groß" #: py/emitnative.c msgid "unary op %q not implemented" @@ -3147,7 +3189,7 @@ msgstr "Der unäre Operator %q ist nicht implementiert" msgid "unexpected indent" msgstr "" "unerwarteter Einzug (Einrückung) Bitte Leerzeichen am Zeilenanfang " -"kontrollieren!" +"kontrollieren" #: py/bc.c msgid "unexpected keyword argument" @@ -3159,23 +3201,23 @@ msgstr "unerwartetes Keyword-Argument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "" +msgstr "Unicode Name ausgebrochen (escaped)" #: py/parse.c msgid "unindent does not match any outer indentation level" msgstr "" "Einrückung entspricht keiner äußeren Einrückungsebene. Bitte Leerzeichen am " -"Zeilenanfang kontrollieren!" +"Zeilenanfang kontrollieren" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "" +msgstr "unbekannter Konvertierungs specifier %c" #: py/objstr.c #, c-format msgid "unknown format code '%c' for object of type '%s'" -msgstr "" +msgstr "unbekannter Formatcode '%c' für Objekt vom Typ '%s'" #: py/compile.c msgid "unknown type" @@ -3187,7 +3229,7 @@ msgstr "unbekannter Typ '%q'" #: py/objstr.c msgid "unmatched '{' in format" -msgstr "" +msgstr "'{' ohne passende Zuordnung im Format" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -3206,12 +3248,12 @@ msgstr "nicht unterstützter Thumb-Befehl '%s' mit %d Argumenten" #: py/emitinlinextensa.c #, c-format msgid "unsupported Xtensa instruction '%s' with %d arguments" -msgstr "" +msgstr "nicht unterstützte Xtensa-Anweisung '%s' mit %d Argumenten" #: py/objstr.c #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" -msgstr "" +msgstr "nicht unterstütztes Formatzeichen '%c' (0x%x) bei Index %d" #: py/runtime.c msgid "unsupported type for %q: '%s'" @@ -3236,15 +3278,15 @@ msgstr "value_count muss größer als 0 sein" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "Fenster muss <= Intervall sein" #: extmod/ulab/code/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "falscher Argumenttyp" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "falscher Indextyp" #: py/objstr.c msgid "wrong number of arguments" @@ -3256,7 +3298,7 @@ msgstr "falsche Anzahl zu entpackender Werte" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "falscher Operandentyp" #: shared-module/displayio/Shape.c msgid "x value out of bounds" @@ -3272,7 +3314,7 @@ msgstr "y Wert außerhalb der Grenzen" #: py/objrange.c msgid "zero step" -msgstr "" +msgstr "Nullschritt" #~ msgid "AP required" #~ msgstr "AP erforderlich" diff --git a/locale/nl.po b/locale/nl.po index 5ee1b36646..c0f3ddf378 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" -"PO-Revision-Date: 2020-05-19 17:08+0000\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"PO-Revision-Date: 2020-05-25 13:52+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" "Language: nl\n" @@ -42,7 +42,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"Om te verlatten, herstart de module zonder " +"Om te verlaten, herstart de module zonder " #: py/obj.c msgid " File \"%q\"" @@ -54,7 +54,7 @@ msgstr " Bestand \"%q\", regel %d" #: main.c msgid " output:\n" -msgstr " output\n" +msgstr " uitvoer:\n" #: py/objstr.c #, c-format @@ -143,7 +143,7 @@ msgstr "'%s' verwacht op zijn meest r%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "'%s' verwacht {r0, r1, ...}" +msgstr "'%s' verwacht {r0, r1, …}" #: py/emitinlinextensa.c #, c-format @@ -378,10 +378,6 @@ 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" @@ -823,7 +819,7 @@ msgstr "Groep is vol" msgid "Hardware busy, try alternative pins" msgstr "Hardware bezig, probeer alternatieve pinnen" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/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" @@ -904,11 +900,11 @@ msgstr "Ongeldige I2C pin selectie" msgid "Invalid PWM frequency" msgstr "Ongeldige PWM frequentie" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "Ongeldige SPI pin selectie" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "Ongeldige UART pin selectie" @@ -984,8 +980,7 @@ 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/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Ongeldige pinnen" @@ -1096,6 +1091,10 @@ msgstr "Een meervoud van 6 rgb pinnen moet worden gebruikt, niet %d" msgid "Name too long" msgstr "Naam te lang" +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Negative step not supported" +msgstr "Negatieve stappen niet ondersteund" + #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" msgstr "Geen CCCD voor deze Characteristic" @@ -1267,10 +1266,6 @@ msgstr "Toegang geweigerd" msgid "Pin does not have ADC capabilities" msgstr "Pin heeft geen ADC mogelijkheden" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Pin is input only" -msgstr "" - #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "Pin moet hardware interrupts ondersteunen" @@ -1296,7 +1291,7 @@ msgstr "En iedere module in het bestandssysteem\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "Polygon heeft op zijn minst 3 punten nodig" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" @@ -1453,7 +1448,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/mimxrt10xx/common-hal/busio/UART.c ports/stm/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" @@ -1523,7 +1518,7 @@ msgstr "Tile breedte moet exact de bitmap breedte verdelen" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "" +msgstr "Time-out is te lang. Maximale time-out lengte is %d seconden" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1814,1462 +1809,1471 @@ msgstr "verkeerde compileer modus" #: py/objstr.c msgid "bad conversion specifier" -msgstr "" +msgstr "slechte conversie specificatie" #: py/objstr.c msgid "bad format string" -msgstr "" +msgstr "string met verkeerde indeling" #: py/binary.c msgid "bad typecode" -msgstr "" +msgstr "verkeerde typecode" #: py/emitnative.c msgid "binary op %q not implemented" -msgstr "" +msgstr "binaire op %q niet geïmplementeerd" #: shared-bindings/busio/UART.c msgid "bits must be 7, 8 or 9" -msgstr "" +msgstr "bits moet 7, 8, of 9 zijn" #: extmod/machine_spi.c msgid "bits must be 8" -msgstr "" +msgstr "bits moet 8 zijn" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" -msgstr "" +msgstr "bits_per_sample moet 8 of 16 zijn" #: py/emitinlinethumb.c msgid "branch not in range" -msgstr "" +msgstr "pad (branch) niet binnen bereik" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" -msgstr "" +msgstr "buffer moet een byte-achtig object zijn" #: shared-module/struct/__init__.c msgid "buffer size must match format" -msgstr "" +msgstr "grootte van de buffer moet overeenkomen met het formaat" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "buffer slices must be of equal length" -msgstr "" +msgstr "buffer slices moeten van gelijke grootte zijn" #: py/modstruct.c shared-bindings/struct/__init__.c #: shared-module/struct/__init__.c msgid "buffer too small" -msgstr "" +msgstr "buffer te klein" #: extmod/machine_spi.c msgid "buffers must be the same length" -msgstr "" +msgstr "buffers moeten dezelfde lengte hebben" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" -msgstr "" +msgstr "buttons moeten digitalio.DigitalInOut zijn" #: py/vm.c msgid "byte code not implemented" -msgstr "" +msgstr "byte code niet geïmplementeerd" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "byteorder is geen string" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" -msgstr "" +msgstr "butes > 8 niet ondersteund" #: py/objstr.c msgid "bytes value out of range" -msgstr "" +msgstr "bytes waarde buiten bereik" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" -msgstr "" +msgstr "calibration is buiten bereik" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is read only" -msgstr "" +msgstr "calibration is alleen-lezen" #: ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration value out of range +/-127" -msgstr "" +msgstr "calibration waarde buiten bereik +/-127" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" -msgstr "" +msgstr "kan slechts 4 parameters aan Thumb assembly geven" #: py/emitinlinextensa.c msgid "can only have up to 4 parameters to Xtensa assembly" -msgstr "" +msgstr "kan slechts 4 parameters aan Xtensa assembly geven" #: py/persistentcode.c msgid "can only save bytecode" -msgstr "" +msgstr "kan alleen byte-code opslaan" #: py/objtype.c msgid "can't add special method to already-subclassed class" msgstr "" +"kan geen speciale methode aan een al ge-subkwalificeerde klasse toevoegen" #: py/compile.c msgid "can't assign to expression" -msgstr "" +msgstr "kan niet toewijzen aan expressie" #: py/obj.c #, c-format msgid "can't convert %s to complex" -msgstr "" +msgstr "kan %s niet converteren naar een complex" #: py/obj.c #, c-format msgid "can't convert %s to float" -msgstr "" +msgstr "kan %s niet omzetten naar een float" #: py/obj.c #, c-format msgid "can't convert %s to int" -msgstr "" +msgstr "kan %s niet omzetten naar een int" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" -msgstr "" +msgstr "kan '%q' object niet omzetten naar %q impliciet" #: py/objint.c msgid "can't convert NaN to int" -msgstr "" +msgstr "kan NaN niet omzetten naar int" #: shared-bindings/i2cslave/I2CSlave.c msgid "can't convert address to int" -msgstr "" +msgstr "kan adres niet omzetten naar int" #: py/objint.c msgid "can't convert inf to int" -msgstr "" +msgstr "kan inf niet omzetten naar int" #: py/obj.c msgid "can't convert to complex" -msgstr "" +msgstr "kan niet omzetten naar complex" #: py/obj.c msgid "can't convert to float" -msgstr "" +msgstr "kan niet omzetten naar float" #: py/obj.c msgid "can't convert to int" -msgstr "" +msgstr "kan niet omzetten naar int" #: py/objstr.c msgid "can't convert to str implicitly" -msgstr "" +msgstr "kan niet omzetten naar str impliciet" #: py/compile.c msgid "can't declare nonlocal in outer code" -msgstr "" +msgstr "kan geen nonlocal in buitenste code declareren" #: py/compile.c msgid "can't delete expression" -msgstr "" +msgstr "kan expressie niet verwijderen" #: py/emitnative.c msgid "can't do binary op between '%q' and '%q'" -msgstr "" +msgstr "kan geen een binaire operatie doen tussen '%q' en '%q'" #: py/objcomplex.c msgid "can't do truncated division of a complex number" -msgstr "" +msgstr "kan geen afgekapte deling doen van een comlex nummer" #: py/compile.c msgid "can't have multiple **x" -msgstr "" +msgstr "kan niet meerdere **x hebben" #: py/compile.c msgid "can't have multiple *x" -msgstr "" +msgstr "kan geen meerdere *x hebben" #: py/emitnative.c msgid "can't implicitly convert '%q' to 'bool'" -msgstr "" +msgstr "kan '%q niet impliciet converteren naar 'bool'" #: py/emitnative.c msgid "can't load from '%q'" -msgstr "" +msgstr "kan niet laden van '%q'" #: py/emitnative.c msgid "can't load with '%q' index" -msgstr "" +msgstr "kan niet met '%q' index laden" #: py/objgenerator.c msgid "can't pend throw to just-started generator" -msgstr "" +msgstr "kan throw niet aan net gestartte generator toevoegen" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" -msgstr "" +msgstr "kan geen niet-'None' waarde naar een net gestartte generator sturen" #: py/objnamedtuple.c msgid "can't set attribute" -msgstr "" +msgstr "kan attribute niet instellen" #: py/emitnative.c msgid "can't store '%q'" -msgstr "" +msgstr "kan '%q' niet opslaan" #: py/emitnative.c msgid "can't store to '%q'" -msgstr "" +msgstr "kan niet naar '%q' opslaan" #: py/emitnative.c msgid "can't store with '%q' index" -msgstr "" +msgstr "kan niet opslaan met '%q' als index" #: py/objstr.c msgid "" "can't switch from automatic field numbering to manual field specification" -msgstr "" +msgstr "kan niet schakelen tussen automatische en handmatige veld specificatie" #: py/objstr.c msgid "" "can't switch from manual field specification to automatic field numbering" -msgstr "" +msgstr "kan niet schakelen tussen handmatige en automatische veld specificatie" #: py/objtype.c msgid "cannot create '%q' instances" -msgstr "" +msgstr "kan geen instanties van '%q' creëren" #: py/objtype.c msgid "cannot create instance" -msgstr "" +msgstr "kan geen instantie creëren" #: py/runtime.c msgid "cannot import name %q" -msgstr "" +msgstr "kan naam %q niet importeren" #: py/builtinimport.c msgid "cannot perform relative import" -msgstr "" +msgstr "kan geen relatieve import uitvoeren" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" +msgstr "kan de array niet hervormen (niet verenigbare input/output vorm)" #: py/emitnative.c msgid "casting" -msgstr "" +msgstr "casting" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "" +msgstr "chars buffer te klein" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" -msgstr "" +msgstr "chr() arg niet binnen bereik (0x110000)" #: py/modbuiltins.c msgid "chr() arg not in range(256)" -msgstr "" +msgstr "chr() arg niet binnen bereik (256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" msgstr "" +"cirkel kan slechts bij één object van een hoger niveau worden geregistreerd" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" -msgstr "" +msgstr "kleurbuffer moet 3 bytes (RGB) of 4 bytes (RGB + pad byte) zijn" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "" +msgstr "kleurbuffer moet een buffer, tuple, list, of int zijn" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" -msgstr "" +msgstr "kleurbuffer moet een bytearray of array van type 'b' of 'B' zijn" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" -msgstr "" +msgstr "kleur moet tussen 0x000000 en 0xffffff liggen" #: shared-bindings/displayio/ColorConverter.c msgid "color should be an int" -msgstr "" +msgstr "kleur moet een int zijn" #: py/objcomplex.c msgid "complex division by zero" -msgstr "" +msgstr "complexe deling door 0" #: py/objfloat.c py/parsenum.c msgid "complex values not supported" -msgstr "" +msgstr "complexe waardes niet ondersteund" #: extmod/moduzlib.c msgid "compression header" -msgstr "" +msgstr "compressie header" #: py/parse.c msgid "constant must be an integer" -msgstr "" +msgstr "constant moet een integer zijn" #: py/emitnative.c msgid "conversion to object" -msgstr "" +msgstr "conversie naar object" #: extmod/ulab/code/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "convolutie argumenten moeten lineaire arrays zijn" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "convolutie argumenten moeten ndarrays zijn" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "convolutie argumenten mogen niet leeg zijn" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "kon de invoerarray niet vanuit vorm uitzenden" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "kon de Vandermonde matrix niet omkeren" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "ddof kleiner dan de lengte van de data set" #: py/parsenum.c msgid "decimal numbers not supported" -msgstr "" +msgstr "decimale getallen zijn niet ondersteund" #: py/compile.c msgid "default 'except' must be last" -msgstr "" +msgstr "standaard 'expect' moet laatste zijn" #: shared-bindings/audiobusio/PDMIn.c msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" +"bestemming buffer moet een bytearray of array van het type 'B' voor " +"bit_depth = 8" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "" +msgstr "bestemming buffer moet een array van het type 'H' voor bit_depth = 16" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" -msgstr "" +msgstr "destination_lengte moest een int groter dan of gelijk zijn aan 0 zijn" #: py/objdict.c msgid "dict update sequence has wrong length" -msgstr "" +msgstr "dict update sequence heeft de verkeerde lengte" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "diff argument moet een ndarray zijn" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" -msgstr "" +msgstr "deling door nul" #: py/objdeque.c msgid "empty" -msgstr "" +msgstr "leeg" #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" -msgstr "" +msgstr "lege heap" #: py/objstr.c msgid "empty separator" -msgstr "" +msgstr "lege seperator" #: shared-bindings/random/__init__.c msgid "empty sequence" -msgstr "" +msgstr "lege sequentie" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "" +msgstr "einde van format terwijl zoekend naar conversie-specifier" #: shared-bindings/displayio/Shape.c msgid "end_x should be an int" -msgstr "" +msgstr "end_x moet een int zijn" #: ports/nrf/common-hal/busio/UART.c #, c-format msgid "error = 0x%08lX" -msgstr "" +msgstr "fout = 0x%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" -msgstr "" +msgstr "uitzonderingen moeten afleiden van BaseException" #: py/objstr.c msgid "expected ':' after format specifier" -msgstr "" +msgstr "verwachtte ':' na format specifier" #: py/obj.c msgid "expected tuple/list" -msgstr "" +msgstr "verwachtte een tuple/lijst" #: py/modthread.c msgid "expecting a dict for keyword args" -msgstr "" +msgstr "verwacht een dict voor keyword argumenten" #: py/compile.c msgid "expecting an assembler instruction" -msgstr "" +msgstr "verwacht een assembler instructie" #: py/compile.c msgid "expecting just a value for set" -msgstr "" +msgstr "verwacht alleen een waarde voor set" #: py/compile.c msgid "expecting key:value for dict" -msgstr "" +msgstr "verwacht key:waarde for dict" #: py/argcheck.c msgid "extra keyword arguments given" -msgstr "" +msgstr "extra keyword argumenten gegeven" #: py/argcheck.c msgid "extra positional arguments given" -msgstr "" +msgstr "extra positionele argumenten gegeven" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "f-string expressie deel kan geen '#' bevatten" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "f-string expressie deel kan geen backslash bevatten" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-string: lege expressie niet toegestaan" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: verwacht '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: enkele '}' is niet toegestaan" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" -msgstr "" +msgstr "bestand moet een bestand zijn geopend in byte modus" #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" -msgstr "" +msgstr "bestandssysteem moet een mount methode bieden" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "eerst argument moet een iterabel zijn" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "eerst argument moet een ndarray zijn" #: py/objtype.c msgid "first argument to super() must be type" -msgstr "" +msgstr "eerste argument voor super() moet een type zijn" #: extmod/machine_spi.c msgid "firstbit must be MSB" -msgstr "" +msgstr "het eerste bit moet het MSB zijn" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "De afvlakkingsvolgorde moet ofwel \"C\", ofwel \"F\" zijn" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "flip argumenten moeten een ndarray zijn" #: py/objint.c msgid "float too big" -msgstr "" +msgstr "float is te groot" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" -msgstr "" +msgstr "lettertype moet 2048 bytes lang zijn" #: py/objstr.c msgid "format requires a dict" -msgstr "" +msgstr "format vereist een dict" #: py/objdeque.c msgid "full" -msgstr "" +msgstr "vol" #: py/argcheck.c msgid "function does not take keyword arguments" -msgstr "" +msgstr "functie accepteert geen keyword argumenten" #: py/argcheck.c #, c-format msgid "function expected at most %d arguments, got %d" -msgstr "" +msgstr "functie verwachtte op zijn meest %d argumenten, maar kreeg %d" #: py/bc.c py/objnamedtuple.c msgid "function got multiple values for argument '%q'" -msgstr "" +msgstr "functie kreeg meedere waarden voor argument '%q'" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "funtie is alleen geïmplementeerd voor scalars en ndarrays" #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" -msgstr "" +msgstr "functie mist %d vereist positionele argumenten" #: py/bc.c msgid "function missing keyword-only argument" -msgstr "" +msgstr "functie mist keyword-only argument" #: py/bc.c msgid "function missing required keyword argument '%q'" -msgstr "" +msgstr "functie mist vereist sleutelwoord argument \"%q" #: py/bc.c #, c-format msgid "function missing required positional argument #%d" -msgstr "" +msgstr "functie mist vereist positie-argument #%d" #: py/argcheck.c py/bc.c py/objnamedtuple.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" +"functie vraagt %d argumenten zonder keyword maar %d argumenten werden gegeven" #: shared-bindings/time/__init__.c msgid "function takes exactly 9 arguments" -msgstr "" +msgstr "functie vraagt precies 9 argumenten" #: py/objgenerator.c msgid "generator already executing" -msgstr "" +msgstr "generator wordt al uitgevoerd" #: py/objgenerator.c msgid "generator ignored GeneratorExit" -msgstr "" +msgstr "generator negeerde GeneratorExit" #: shared-bindings/_stage/Layer.c msgid "graphic must be 2048 bytes long" -msgstr "" +msgstr "graphic moet 2048 bytes lang zijn" #: extmod/moduheapq.c msgid "heap must be a list" -msgstr "" +msgstr "heap moet een lijst zijn" #: py/compile.c msgid "identifier redefined as global" -msgstr "" +msgstr "identifier is opnieuw gedefinieerd als global" #: py/compile.c msgid "identifier redefined as nonlocal" -msgstr "" +msgstr "identifier is opnieuw gedefinieerd als nonlocal" #: py/objstr.c msgid "incomplete format" -msgstr "" +msgstr "incompleet formaat" #: py/objstr.c msgid "incomplete format key" -msgstr "" +msgstr "incomplete formaatsleutel" #: extmod/modubinascii.c msgid "incorrect padding" -msgstr "" +msgstr "vulling (padding) is onjuist" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "index is buiten bereik" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" -msgstr "" +msgstr "index is buiten bereik" #: py/obj.c msgid "indices must be integers" -msgstr "" +msgstr "indices moeten integers zijn" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" #: py/compile.c msgid "inline assembler must be a function" -msgstr "" +msgstr "inline assembler moet een functie zijn" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "invoerargument moet een integer of 2-tuple zijn" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "invoer array lengte moet een macht van 2 zijn" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "invoerdata moet itereerbaar zijn" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "invoermatrix is asymmetrisch" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "invoermatrix is singulier" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "invoer moet een vierkante matrix zijn" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "invoer moet een tuple, lijst, bereik of ndarray zijn" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "invoervectors moeten van gelijke lengte zijn" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" +msgstr "int() argument 2 moet >=2 en <= 36 zijn" #: py/objstr.c msgid "integer required" -msgstr "" +msgstr "integer vereist" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "" +msgstr "interval moet binnen bereik %s-%s vallen" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" -msgstr "" +msgstr "onjuist I2C randapparaat" #: extmod/machine_spi.c msgid "invalid SPI peripheral" -msgstr "" +msgstr "onjuist SPI randapparaat" #: lib/netutils/netutils.c msgid "invalid arguments" -msgstr "" +msgstr "ongeldige argumenten" #: extmod/modussl_axtls.c msgid "invalid cert" -msgstr "" +msgstr "ongeldig certificaat" #: extmod/uos_dupterm.c msgid "invalid dupterm index" -msgstr "" +msgstr "ongeldige dupterm index" #: extmod/modframebuf.c msgid "invalid format" -msgstr "" +msgstr "ongeldig formaat" #: py/objstr.c msgid "invalid format specifier" -msgstr "" +msgstr "ongeldige formaatspecificatie" #: extmod/modussl_axtls.c msgid "invalid key" -msgstr "" +msgstr "ongeldige sleutel" #: py/compile.c msgid "invalid micropython decorator" -msgstr "" +msgstr "ongeldige micropython decorator" #: shared-bindings/random/__init__.c msgid "invalid step" -msgstr "" +msgstr "ongeldige stap" #: py/compile.c py/parse.c msgid "invalid syntax" -msgstr "" +msgstr "ongeldige syntax" #: py/parsenum.c msgid "invalid syntax for integer" -msgstr "" +msgstr "ongeldige syntax voor integer" #: py/parsenum.c #, c-format msgid "invalid syntax for integer with base %d" -msgstr "" +msgstr "ongeldige syntax voor integer met grondtal %d" #: py/parsenum.c msgid "invalid syntax for number" -msgstr "" +msgstr "ongeldige syntax voor nummer" #: py/objtype.c msgid "issubclass() arg 1 must be a class" -msgstr "" +msgstr "issubclass() argument 1 moet een klasse zijn" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" -msgstr "" +msgstr "issubclass() argument 2 moet een klasse of tuple van klassen zijn" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "itereerbare objecten hebben niet dezelfde lengte" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "itereerbare objecten convergeren niet" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" +"join verwacht een lijst van str/byte objecten die consistent zijn met het " +"self-object" #: py/argcheck.c msgid "keyword argument(s) not yet implemented - use normal args instead" msgstr "" +"trefwoord argument(en) zijn niet geïmplementeerd, gebruik normale argumenten" #: py/bc.c msgid "keywords must be strings" -msgstr "" +msgstr "trefwoorden moeten van type string zijn" #: py/emitinlinethumb.c py/emitinlinextensa.c msgid "label '%q' not defined" -msgstr "" +msgstr "label '%q' is niet gedefinieerd" #: py/compile.c msgid "label redefined" -msgstr "" +msgstr "label opnieuw gedefinieerd" #: py/stream.c msgid "length argument not allowed for this type" -msgstr "" +msgstr "voor dit type is length niet toegestaan" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "level moet tussen 0 en 1 liggen" #: py/objarray.c msgid "lhs and rhs should be compatible" -msgstr "" +msgstr "lhs en rhs moeten compatibel zijn" #: py/emitnative.c msgid "local '%q' has type '%q' but source is '%q'" -msgstr "" +msgstr "lokale '%q' is van type '%q' maar bron is '%q'" #: py/emitnative.c msgid "local '%q' used before type known" -msgstr "" +msgstr "lokale '%q' gebruikt voordat type bekend is" #: py/vm.c msgid "local variable referenced before assignment" -msgstr "" +msgstr "verwijzing naar een (nog) niet toegewezen lokale variabele" #: py/objint.c msgid "long int not supported in this build" -msgstr "" +msgstr "long int wordt niet ondersteund in deze build" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "onjuist gevormde f-string" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" -msgstr "" +msgstr "map buffer te klein" #: py/modmath.c shared-bindings/math/__init__.c msgid "math domain error" -msgstr "" +msgstr "fout in het wiskundig domein (math domain error)" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "matrix afmetingen komen niet overeen" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "matrix is niet positief-definiet" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format msgid "max_length must be 0-%d when fixed_length is %s" -msgstr "" +msgstr "max_length moet 0-%d zijn als fixed_length %s is" #: py/runtime.c msgid "maximum recursion depth exceeded" -msgstr "" +msgstr "maximale recursiediepte overschreden" #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" -msgstr "" +msgstr "geheugentoewijzing mislukt, %u bytes worden toegewezen" #: py/runtime.c msgid "memory allocation failed, heap is locked" -msgstr "" +msgstr "geheugentoewijzing mislukt, heap is vergrendeld" #: py/builtinimport.c msgid "module not found" -msgstr "" +msgstr "module niet gevonden" #: extmod/ulab/code/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "meer vrijheidsgraden dan datapunten" #: py/compile.c msgid "multiple *x in assignment" -msgstr "" +msgstr "meerdere *x in toewijzing" #: py/objtype.c msgid "multiple bases have instance lay-out conflict" -msgstr "" +msgstr "meerdere grondtallen (bases) hebben instance lay-out conflicten" #: py/objtype.c msgid "multiple inheritance not supported" -msgstr "" +msgstr "meervoudige overerving niet ondersteund" #: py/emitnative.c msgid "must raise an object" -msgstr "" +msgstr "moet een object oproepen (raise)" #: extmod/machine_spi.c msgid "must specify all of sck/mosi/miso" -msgstr "" +msgstr "sck/mosi/miso moeten alle gespecificeerd worden" #: py/modbuiltins.c msgid "must use keyword argument for key function" -msgstr "" +msgstr "voor sleutelfunctie moet een trefwoordargument gebruikt worden" #: extmod/ulab/code/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n moet tussen 0 en 9 liggen" #: py/runtime.c msgid "name '%q' is not defined" -msgstr "" +msgstr "naam '%q' is niet gedefinieerd" #: py/runtime.c msgid "name not defined" -msgstr "" +msgstr "naam is niet gedefinieerd" #: py/compile.c msgid "name reused for argument" -msgstr "" +msgstr "naam hergebruikt voor argument" #: py/emitnative.c msgid "native yield" -msgstr "" +msgstr "natuurlijke opbrengst (native yield)" #: py/runtime.c #, c-format msgid "need more than %d values to unpack" -msgstr "" +msgstr "Om uit te pakken zijn meer dan %d waarden vereist" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "" +msgstr "negatieve macht terwijl er geen ondersteuning is voor float" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "" +msgstr "negatieve verschuivingstelling (shift count)" #: py/vm.c msgid "no active exception to reraise" -msgstr "" +msgstr "geen actieve uitzondering om opnieuw op te werpen (raise)" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c msgid "no available NIC" -msgstr "" +msgstr "geen netwerkadapter (NIC) beschikbaar" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "" +msgstr "geen binding voor nonlocal gevonden" #: py/builtinimport.c msgid "no module named '%q'" -msgstr "" +msgstr "geen module met naam '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "no reset pin available" -msgstr "" +msgstr "geen reset pin beschikbaar" #: py/runtime.c msgid "no such attribute" -msgstr "" +msgstr "niet zo'n attribuut" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "" +msgstr "niet-UUID gevonden in service_uuids_whitelist" #: py/compile.c msgid "non-default argument follows default argument" -msgstr "" +msgstr "niet-standaard argument volgt op een standaard argument" #: extmod/modubinascii.c msgid "non-hex digit found" -msgstr "" +msgstr "er werd een niet-hexadecimaal cijfer gevonden" #: py/compile.c msgid "non-keyword arg after */**" -msgstr "" +msgstr "niet-trefwoord argument na */**" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "" +msgstr "niet-trefwoord argument na trefwoord argument" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" -msgstr "" +msgstr "geen 128-bit UUID" #: py/objstr.c msgid "not all arguments converted during string formatting" -msgstr "" +msgstr "niet alle argumenten omgezet bij formattering van string" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "" +msgstr "niet genoeg argumenten om string te formatteren" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "aantal argumenten moet 2 of 3 zijn" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "aantal punten moet minimaal 2 zijn" #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" -msgstr "" +msgstr "object '%s' is geen tuple of lijst" #: py/obj.c msgid "object does not support item assignment" -msgstr "" +msgstr "object ondersteund toewijzen van elementen niet" #: py/obj.c msgid "object does not support item deletion" -msgstr "" +msgstr "object ondersteund verwijderen van elementen niet" #: py/obj.c msgid "object has no len" -msgstr "" +msgstr "object heeft geen len" #: py/obj.c msgid "object is not subscriptable" -msgstr "" +msgstr "object heeft geen '__getitem__'-methode (not subscriptable)" #: py/runtime.c msgid "object not an iterator" -msgstr "" +msgstr "object is geen iterator" #: py/objtype.c py/runtime.c msgid "object not callable" -msgstr "" +msgstr "object niet aanroepbaar" #: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" -msgstr "" +msgstr "object niet in volgorde (sequence)" #: py/runtime.c msgid "object not iterable" -msgstr "" +msgstr "object niet itereerbaar" #: py/obj.c #, c-format msgid "object of type '%s' has no len()" -msgstr "" +msgstr "object van type '%s' heeft geen len()" #: py/obj.c msgid "object with buffer protocol required" -msgstr "" +msgstr "object met buffer protocol vereist" #: extmod/modubinascii.c msgid "odd-length string" -msgstr "" +msgstr "string met oneven lengte" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" -msgstr "" +msgstr "offset buiten bereik" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" -msgstr "" +msgstr "alleen bit_depth=16 wordt ondersteund" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" -msgstr "" +msgstr "alleen sample_rate=16000 wordt ondersteund" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" -msgstr "" +msgstr "alleen segmenten met step=1 (ook wel None) worden ondersteund" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "operands konden niet samen verzonden worden" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "bewerking is voor ndarrays niet geïmplementeerd" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "bewerking wordt niet ondersteund voor dit type" #: py/modbuiltins.c msgid "ord expects a character" -msgstr "" +msgstr "ord verwacht een teken (char)" #: py/modbuiltins.c #, c-format msgid "ord() expected a character, but string of length %d found" -msgstr "" +msgstr "ord() verwacht een teken (char) maar vond een string van lengte %d" #: py/objint_mpz.c msgid "overflow converting long int to machine word" -msgstr "" +msgstr "overloop bij converteren van long int naar machine word" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" -msgstr "" +msgstr "palette moet 32 bytes lang zijn" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" -msgstr "" +msgstr "palette_index moet een int zijn" #: py/compile.c msgid "parameter annotation must be an identifier" -msgstr "" +msgstr "parameter annotatie moet een identifier zijn" #: py/emitinlinextensa.c msgid "parameters must be registers in sequence a2 to a5" -msgstr "" +msgstr "parameters moeten registers zijn in de volgorde a2 tot a5" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "" +msgstr "parameters moeten registers zijn in de volgorde r0 tot r3" #: shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" -msgstr "" +msgstr "pixel coördinaten buiten bereik" #: shared-bindings/displayio/Bitmap.c msgid "pixel value requires too many bits" -msgstr "" +msgstr "pixel waarde vereist te veel bits" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" -msgstr "" +msgstr "pixel_shader moet displayio.Palette of displayio.ColorConverter zijn" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" msgstr "" +"polygoon kan slechts bij één object van een hoger niveau worden geregistreerd" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" -msgstr "" +msgstr "pop van een lege PulseIn" #: py/objset.c msgid "pop from an empty set" -msgstr "" +msgstr "pop van een lege set" #: py/objlist.c msgid "pop from empty list" -msgstr "" +msgstr "pop van een lege lijst" #: py/objdict.c msgid "popitem(): dictionary is empty" -msgstr "" +msgstr "popitem(): dictionary is leeg" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" -msgstr "" +msgstr "derde argument van pow() mag geen 0 zijn" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "" +msgstr "pow() met 3 argumenten vereist integers" #: extmod/modutimeq.c msgid "queue overflow" -msgstr "" +msgstr "wachtrij overloop" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "ruwe f-strings zijn niet geïmplementeerd" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "reëel en imaginair deel moeten gelijke lengte hebben" #: py/builtinimport.c msgid "relative import" -msgstr "" +msgstr "relatieve import" #: py/obj.c #, c-format msgid "requested length %d but object has length %d" -msgstr "" +msgstr "gevraagde lengte is %d maar object heeft lengte %d" #: py/compile.c msgid "return annotation must be an identifier" -msgstr "" +msgstr "return annotatie moet een identifier zijn" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "" +msgstr "return verwacht '%q' maar ontving '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins[%d] is hetzelfde als een andere pintoewijzing" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins[%d] bevindt zich niet op dezelfde poort als klok" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "de rechterkant moet een ndarray of scalar zijn" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "rsplit(None,n)" #: shared-bindings/audiocore/RawSample.c msgid "" "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " "'B'" msgstr "" +"sample_source buffer moet een bytearray of array van type 'h', 'H', 'b' of " +"'B' zijn" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" -msgstr "" +msgstr "bemonsteringssnelheid buiten bereik" #: py/modmicropython.c msgid "schedule stack full" -msgstr "" +msgstr "schedule stack is vol" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" -msgstr "" +msgstr "scriptcompilatie wordt niet ondersteund" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "vorm moet een 2-tuple zijn" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "" +msgstr "teken niet toegestaan in string formaatspecificatie" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" -msgstr "" +msgstr "teken niet toegestaan bij integer formaatspecificatie 'c'" #: py/objstr.c msgid "single '}' encountered in format string" -msgstr "" +msgstr "enkele '}' aangetroffen in formaat tekenreeks (string)" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "omvang is alleen voor ndarrays gedefinieerd" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" -msgstr "" +msgstr "de slaapduur mag niet negatief zijn" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" -msgstr "" +msgstr "segmentstap mag niet nul zijn" #: py/objint.c py/sequence.c msgid "small int overflow" -msgstr "" +msgstr "small int overloop" #: main.c msgid "soft reboot\n" -msgstr "" +msgstr "zachte herstart\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "sorteerargument moet een ndarray zijn" #: py/objstr.c msgid "start/end indices" -msgstr "" +msgstr "start/stop indices" #: shared-bindings/displayio/Shape.c msgid "start_x should be an int" -msgstr "" +msgstr "start_x moet een int zijn" #: shared-bindings/random/__init__.c msgid "step must be non-zero" -msgstr "" +msgstr "step mag geen nul zijn" #: shared-bindings/busio/UART.c msgid "stop must be 1 or 2" -msgstr "" +msgstr "stop moet 1 of 2 zijn" #: shared-bindings/random/__init__.c msgid "stop not reachable from start" -msgstr "" +msgstr "stop is niet bereikbaar vanaf start" #: py/stream.c msgid "stream operation not supported" -msgstr "" +msgstr "stream operatie niet ondersteund" #: py/objstrunicode.c msgid "string index out of range" -msgstr "" +msgstr "string index buiten bereik" #: py/objstrunicode.c #, c-format msgid "string indices must be integers, not %s" -msgstr "" +msgstr "string indices moeten integer zijn, niet %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" -msgstr "" +msgstr "string niet ondersteund; gebruik bytes of bytearray" #: extmod/moductypes.c msgid "struct: cannot index" -msgstr "" +msgstr "struct: kan niet indexeren" #: extmod/moductypes.c msgid "struct: index out of range" -msgstr "" +msgstr "struct: index buiten bereik" #: extmod/moductypes.c msgid "struct: no fields" -msgstr "" +msgstr "struct: geen velden" #: py/objstr.c msgid "substring not found" -msgstr "" +msgstr "deelreeks niet gevonden" #: py/compile.c msgid "super() can't find self" -msgstr "" +msgstr "super() kan self niet vinden" #: extmod/modujson.c msgid "syntax error in JSON" -msgstr "" +msgstr "syntaxisfout in JSON" #: extmod/moductypes.c msgid "syntax error in uctypes descriptor" -msgstr "" +msgstr "syntaxisfout in uctypes aanduiding" #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" -msgstr "" +msgstr "drempelwaarde moet in het bereik 0-65536 liggen" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" -msgstr "" +msgstr "time.struct_time() accepteert een 9-rij" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "" +msgstr "timeout moet tussen 0.0 en 100.0 seconden zijn" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" -msgstr "" +msgstr "timeout moet groter dan 0.0 zijn" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" -msgstr "" +msgstr "timestamp buiten bereik voor platform time_t" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" -msgstr "" +msgstr "te veel argumenten opgegeven bij dit formaat" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "te veel indices" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "" +msgstr "te veel waarden om uit te pakken (%d verwacht)" #: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" -msgstr "" +msgstr "tuple index buiten bereik" #: py/obj.c msgid "tuple/list has wrong length" -msgstr "" +msgstr "tuple of lijst heeft onjuiste lengte" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "tuple/list required on RHS" -msgstr "" +msgstr "tuple of lijst vereist op RHS" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/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 "" +msgstr "tx en rx kunnen niet beiden None zijn" #: py/objtype.c msgid "type '%q' is not an acceptable base type" -msgstr "" +msgstr "type '%q' is geen aanvaardbaar basistype" #: py/objtype.c msgid "type is not an acceptable base type" -msgstr "" +msgstr "type is geen aanvaardbaar basistype" #: py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "" +msgstr "objecttype '%q' heeft geen attribuut '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" -msgstr "" +msgstr "type accepteert 1 of 3 argumenten" #: py/objint_longlong.c msgid "ulonglong too large" -msgstr "" +msgstr "ulonglong te groot" #: py/emitnative.c msgid "unary op %q not implemented" -msgstr "" +msgstr "unair op %q niet geïmplementeerd" #: py/parse.c msgid "unexpected indent" -msgstr "" +msgstr "onverwachte inspringing" #: py/bc.c msgid "unexpected keyword argument" -msgstr "" +msgstr "onverwacht trefwoordargument" #: py/bc.c py/objnamedtuple.c msgid "unexpected keyword argument '%q'" -msgstr "" +msgstr "onverwacht trefwoordargument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "" +msgstr "op naam gebaseerde unicode escapes zijn niet geïmplementeerd" #: py/parse.c msgid "unindent does not match any outer indentation level" -msgstr "" +msgstr "inspringing komt niet overeen met hoger gelegen inspringingsniveaus" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "" +msgstr "onbekende conversiespecificatie %c" #: py/objstr.c #, c-format msgid "unknown format code '%c' for object of type '%s'" -msgstr "" +msgstr "onbekende formaatcode '%c' voor object van type '%s'" #: py/compile.c msgid "unknown type" -msgstr "" +msgstr "onbekend type" #: py/emitnative.c msgid "unknown type '%q'" -msgstr "" +msgstr "onbekend type '%q'" #: py/objstr.c msgid "unmatched '{' in format" -msgstr "" +msgstr "'{' zonder overeenkomst in formaat" #: py/objtype.c py/runtime.c msgid "unreadable attribute" -msgstr "" +msgstr "onleesbaar attribuut" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c #: shared-module/vectorio/Polygon.c msgid "unsupported %q type" -msgstr "" +msgstr "niet ondersteund %q type" #: py/emitinlinethumb.c #, c-format msgid "unsupported Thumb instruction '%s' with %d arguments" -msgstr "" +msgstr "niet ondersteunde Thumb instructie '%s' met %d argumenten" #: py/emitinlinextensa.c #, c-format msgid "unsupported Xtensa instruction '%s' with %d arguments" -msgstr "" +msgstr "niet ondersteunde Xtensa instructie '%s' met %d argumenten" #: py/objstr.c #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" -msgstr "" +msgstr "niet ondersteund formaatkarakter '%c' (0x%x) op index %d" #: py/runtime.c msgid "unsupported type for %q: '%s'" -msgstr "" +msgstr "niet ondersteund type voor %q: '%s'" #: py/runtime.c msgid "unsupported type for operator" -msgstr "" +msgstr "niet ondersteund type voor operator" #: py/runtime.c msgid "unsupported types for %q: '%s', '%s'" -msgstr "" +msgstr "niet ondersteunde types voor %q: '%s', '%s'" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "" +msgstr "waarde moet in %d byte(s) passen" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" -msgstr "" +msgstr "value_count moet groter dan 0 zijn" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "window moet <= interval zijn" #: extmod/ulab/code/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "onjuist argumenttype" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "onjuist indextype" #: py/objstr.c msgid "wrong number of arguments" -msgstr "" +msgstr "onjuist aantal argumenten" #: py/runtime.c msgid "wrong number of values to unpack" -msgstr "" +msgstr "verkeerd aantal waarden om uit te pakken" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "verkeerd operandtype" #: shared-module/displayio/Shape.c msgid "x value out of bounds" -msgstr "" +msgstr "x-waarde buiten bereik" #: shared-bindings/displayio/Shape.c msgid "y should be an int" -msgstr "" +msgstr "y moet een int zijn" #: shared-module/displayio/Shape.c msgid "y value out of bounds" -msgstr "" +msgstr "y-waarde buiten bereik" #: py/objrange.c msgid "zero step" -msgstr "" - -#~ msgid "Negative step not supported" -#~ msgstr "Negatieve stappen niet ondersteund" +msgstr "nul-stap" From f3ac3ead8d049dd52f2dc6726e42fad730422c37 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 27 May 2020 20:52:07 -0500 Subject: [PATCH 054/131] make translate --- locale/circuitpython.pot | 2 +- locale/cs.po | 28 ++++++++++++++++------------ locale/de_DE.po | 31 +++++++++++++++++++------------ locale/nl.po | 31 +++++++++++++++++++------------ 4 files changed, 55 insertions(+), 37 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index eeaaa0a7a9..3e7fb74e3d 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-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/cs.po b/locale/cs.po index 825b31509a..737beebdac 100644 --- a/locale/cs.po +++ b/locale/cs.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-27 20:51-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -376,6 +376,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 "" @@ -809,7 +813,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 "" @@ -888,11 +892,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 +972,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 "" @@ -1079,10 +1084,6 @@ msgstr "" msgid "Name too long" msgstr "" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "Negative step not supported" -msgstr "" - #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" msgstr "" @@ -1245,6 +1246,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" @@ -1422,7 +1427,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 "" @@ -3069,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/de_DE.po b/locale/de_DE.po index 9c3af7cdb9..bb4a646e51 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-27 20:51-0500\n" "PO-Revision-Date: 2020-05-23 16:13+0000\n" "Last-Translator: Timon \n" "Language-Team: German \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" @@ -819,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" @@ -900,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" @@ -980,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" @@ -1091,10 +1096,6 @@ msgstr "Een meervoud van 6 rgb pinnen moet worden gebruikt, niet %d" msgid "Name too long" msgstr "Naam te lang" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "Negative step not supported" -msgstr "Negatieve stappen niet ondersteund" - #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" msgstr "Geen CCCD voor deze Characteristic" @@ -1266,6 +1267,10 @@ msgstr "Toegang geweigerd" msgid "Pin does not have ADC capabilities" msgstr "Pin heeft geen ADC mogelijkheden" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "Pin moet hardware interrupts ondersteunen" @@ -1448,7 +1453,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" @@ -3121,8 +3126,7 @@ msgstr "tuple of lijst heeft onjuiste lengte" msgid "tuple/list required on RHS" msgstr "tuple of lijst vereist op 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 en rx kunnen niet beiden None zijn" @@ -3277,3 +3281,6 @@ msgstr "y-waarde buiten bereik" #: py/objrange.c msgid "zero step" msgstr "nul-stap" + +#~ msgid "Negative step not supported" +#~ msgstr "Negatieve stappen niet ondersteund" From fe3e8d1589e54de999cccc775f269a39443c82d6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 28 May 2020 07:40:56 -0500 Subject: [PATCH 055/131] string compression: save a few bits per string Length was stored as a 16-bit number always. Most translations have a max length far less. For example, US English translation lengths always fit in just 8 bits. probably all languages fit in 9 bits. This also has the side effect of reducing the alignment of compressed_string_t from 2 bytes to 1. testing performed: ran in german and english on pyruler, printed messages looked right. Firmware size, en_US Before: 3044 bytes free in flash After: 3408 bytes free in flash Firmware size, de_DE (with #2967 merged to restore translations) Before: 1236 bytes free in flash After: 1600 bytes free in flash --- main.c | 2 +- py/builtinhelp.c | 4 +-- py/makeqstrdata.py | 52 +++++++++++++++++++++++++++++------ py/moduerrno.c | 2 +- py/obj.c | 6 ++-- py/objexcept.c | 4 +-- supervisor/shared/translate.c | 26 ++++++++++++------ supervisor/shared/translate.h | 5 ++-- 8 files changed, 74 insertions(+), 27 deletions(-) diff --git a/main.c b/main.c index bb5a7e5cec..c3787122d3 100755 --- a/main.c +++ b/main.c @@ -185,7 +185,7 @@ bool maybe_run_list(const char ** filenames, pyexec_result_t* exec_result) { } mp_hal_stdout_tx_str(filename); const compressed_string_t* compressed = translate(" output:\n"); - char decompressed[compressed->length]; + char decompressed[decompress_length(compressed)]; decompress(compressed, decompressed); mp_hal_stdout_tx_str(decompressed); pyexec_file(filename, exec_result); diff --git a/py/builtinhelp.c b/py/builtinhelp.c index 9a3407a16f..01c0bc84e0 100644 --- a/py/builtinhelp.c +++ b/py/builtinhelp.c @@ -135,7 +135,7 @@ STATIC void mp_help_print_modules(void) { // let the user know there may be other modules available from the filesystem const compressed_string_t* compressed = translate("Plus any modules on the filesystem\n"); - char decompressed[compressed->length]; + char decompressed[decompress_length(compressed)]; decompress(compressed, decompressed); mp_print_str(MP_PYTHON_PRINTER, decompressed); } @@ -181,7 +181,7 @@ STATIC mp_obj_t mp_builtin_help(size_t n_args, const mp_obj_t *args) { // print a general help message. Translate only works on single strings on one line. const compressed_string_t* compressed = translate("Welcome to Adafruit CircuitPython %s!\n\nPlease visit learn.adafruit.com/category/circuitpython for project guides.\n\nTo list built-in modules please do `help(\"modules\")`.\n"); - char decompressed[compressed->length]; + char decompressed[decompress_length(compressed)]; decompress(compressed, decompressed); mp_printf(MP_PYTHON_PRINTER, decompressed, MICROPY_GIT_TAG); } else { diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 0d667959d9..64e4d26f45 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -1,7 +1,7 @@ """ Process raw qstr file and output qstr data with length, hash and data bytes. -This script works with Python 2.6, 2.7, 3.3 and 3.4. +This script works with Python 2.7, 3.3 and 3.4. """ from __future__ import print_function @@ -132,19 +132,37 @@ def compute_huffman_coding(translations, qstrs, compression_filename): print("// estimated total memory size", len(lengths) + 2*len(values) + sum(len(cb[u]) for u in all_strings_concat)) print("//", values, lengths) values_type = "uint16_t" if max(ord(u) for u in values) > 255 else "uint8_t" + max_translation_encoded_length = max(len(translation.encode("utf-8")) for original,translation in translations) with open(compression_filename, "w") as f: f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) f.write("const {} values[] = {{ {} }};\n".format(values_type, ", ".join(str(ord(u)) for u in values))) + f.write("#define compress_max_length_bits ({})\n".format(max_translation_encoded_length.bit_length())) return values, lengths -def decompress(encoding_table, length, encoded): +def decompress(encoding_table, encoded, encoded_length_bits): values, lengths = encoding_table - #print(l, encoded) dec = [] this_byte = 0 this_bit = 7 b = encoded[this_byte] - for i in range(length): + bits = 0 + for i in range(encoded_length_bits): + bits <<= 1 + if 0x80 & b: + bits |= 1 + + b <<= 1 + if this_bit == 0: + this_bit = 7 + this_byte += 1 + if this_byte < len(encoded): + b = encoded[this_byte] + else: + this_bit -= 1 + length = bits + + i = 0 + while i < length: bits = 0 bit_length = 0 max_code = lengths[0] @@ -170,10 +188,11 @@ def decompress(encoding_table, length, encoded): searched_length += lengths[bit_length] v = values[searched_length + bits - max_code] + i += len(v.encode('utf-8')) dec.append(v) return ''.join(dec) -def compress(encoding_table, decompressed): +def compress(encoding_table, decompressed, encoded_length_bits, len_translation_encoded): if not isinstance(decompressed, str): raise TypeError() values, lengths = encoding_table @@ -182,6 +201,19 @@ def compress(encoding_table, decompressed): #print(lengths) current_bit = 7 current_byte = 0 + + code = len_translation_encoded + bits = encoded_length_bits+1 + for i in range(bits - 1, 0, -1): + if len_translation_encoded & (1 << (i - 1)): + enc[current_byte] |= 1 << current_bit + if current_bit == 0: + current_bit = 7 + #print("packed {0:0{width}b}".format(enc[current_byte], width=8)) + current_byte += 1 + else: + current_bit -= 1 + for c in decompressed: #print() #print("char", c, values.index(c)) @@ -342,14 +374,17 @@ def print_qstr_data(encoding_table, qcfgs, qstrs, i18ns): total_text_size = 0 total_text_compressed_size = 0 + max_translation_encoded_length = max(len(translation.encode("utf-8")) for original, translation in i18ns) + encoded_length_bits = max_translation_encoded_length.bit_length() for original, translation in i18ns: translation_encoded = translation.encode("utf-8") - compressed = compress(encoding_table, translation) + compressed = compress(encoding_table, translation, encoded_length_bits, len(translation_encoded)) total_text_compressed_size += len(compressed) - decompressed = decompress(encoding_table, len(translation_encoded), compressed) + decompressed = decompress(encoding_table, compressed, encoded_length_bits) + assert decompressed == translation for c in C_ESCAPES: decompressed = decompressed.replace(c, C_ESCAPES[c]) - print("TRANSLATION(\"{}\", {}, {{ {} }}) // {}".format(original, len(translation_encoded)+1, ", ".join(["0x{:02x}".format(x) for x in compressed]), decompressed)) + print("TRANSLATION(\"{}\", {}) // {}".format(original, ", ".join(["{:d}".format(x) for x in compressed]), decompressed)) total_text_size += len(translation.encode("utf-8")) print() @@ -385,6 +420,7 @@ if __name__ == "__main__": qcfgs, qstrs, i18ns = parse_input_headers(args.infiles) if args.translation: + i18ns = sorted(i18ns) translations = translate(args.translation, i18ns) encoding_table = compute_huffman_coding(translations, qstrs, args.compression_filename) print_qstr_data(encoding_table, qcfgs, qstrs, translations) diff --git a/py/moduerrno.c b/py/moduerrno.c index 7915603e4e..3be5adba1e 100644 --- a/py/moduerrno.c +++ b/py/moduerrno.c @@ -158,7 +158,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) { case ENOSPC: desc = translate("No space left on device"); break; case EROFS: desc = translate("Read-only filesystem"); break; } - if (desc != NULL && desc->length <= len) { + if (desc != NULL && decompress_length(desc) <= len) { decompress(desc, buf); return buf; } diff --git a/py/obj.c b/py/obj.c index f1e00de1a4..4fa2032dc7 100644 --- a/py/obj.c +++ b/py/obj.c @@ -94,17 +94,17 @@ void mp_obj_print_exception(const mp_print_t *print, mp_obj_t exc) { assert(n % 3 == 0); // Decompress the format strings const compressed_string_t* traceback = translate("Traceback (most recent call last):\n"); - char decompressed[traceback->length]; + char decompressed[decompress_length(traceback)]; decompress(traceback, decompressed); #if MICROPY_ENABLE_SOURCE_LINE const compressed_string_t* frame = translate(" File \"%q\", line %d"); #else const compressed_string_t* frame = translate(" File \"%q\""); #endif - char decompressed_frame[frame->length]; + char decompressed_frame[decompress_length(frame)]; decompress(frame, decompressed_frame); const compressed_string_t* block_fmt = translate(", in %q\n"); - char decompressed_block[block_fmt->length]; + char decompressed_block[decompress_length(block_fmt)]; decompress(block_fmt, decompressed_block); // Print the traceback diff --git a/py/objexcept.c b/py/objexcept.c index b7a536c5e3..796be122fe 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -400,7 +400,7 @@ mp_obj_t mp_obj_new_exception_msg_vlist(const mp_obj_type_t *exc_type, const com // Try to allocate memory for the message mp_obj_str_t *o_str = m_new_obj_maybe(mp_obj_str_t); - size_t o_str_alloc = fmt->length + 1; + size_t o_str_alloc = decompress_length(fmt); byte *o_str_buf = m_new_maybe(byte, o_str_alloc); bool used_emg_buf = false; @@ -433,7 +433,7 @@ mp_obj_t mp_obj_new_exception_msg_vlist(const mp_obj_type_t *exc_type, const com // We have some memory to format the string struct _exc_printer_t exc_pr = {!used_emg_buf, o_str_alloc, 0, o_str_buf}; mp_print_t print = {&exc_pr, exc_add_strn}; - char fmt_decompressed[fmt->length]; + char fmt_decompressed[decompress_length(fmt)]; decompress(fmt, fmt_decompressed); mp_vprintf(&print, fmt_decompressed, ap); exc_pr.buf[exc_pr.len] = '\0'; diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index 187d5ff8a5..606f8fa91a 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -37,7 +37,7 @@ #include "supervisor/serial.h" void serial_write_compressed(const compressed_string_t* compressed) { - char decompressed[compressed->length]; + char decompressed[decompress_length(compressed)]; decompress(compressed, decompressed); serial_write(decompressed); } @@ -58,12 +58,22 @@ STATIC int put_utf8(char *buf, int u) { } } +uint16_t decompress_length(const compressed_string_t* compressed) { + if (compress_max_length_bits <= 8) { + return 1 + (compressed->data >> (8 - compress_max_length_bits)); + } else { + return 1 + ((compressed->data * 256 + compressed->tail[0]) >> (16 - compress_max_length_bits)); + } +} + char* decompress(const compressed_string_t* compressed, char* decompressed) { - uint8_t this_byte = 0; - uint8_t this_bit = 7; - uint8_t b = compressed->data[this_byte]; + uint8_t this_byte = compress_max_length_bits / 8; + uint8_t this_bit = 7 - compress_max_length_bits % 8; + uint8_t b = (&compressed->data)[this_byte]; + uint16_t length = decompress_length(compressed); + // Stop one early because the last byte is always NULL. - for (uint16_t i = 0; i < compressed->length - 1;) { + for (uint16_t i = 0; i < length - 1;) { uint32_t bits = 0; uint8_t bit_length = 0; uint32_t max_code = lengths[0]; @@ -78,7 +88,7 @@ char* decompress(const compressed_string_t* compressed, char* decompressed) { if (this_bit == 0) { this_bit = 7; this_byte += 1; - b = compressed->data[this_byte]; // This may read past the end but its never used. + b = (&compressed->data)[this_byte]; // This may read past the end but its never used. } else { this_bit -= 1; } @@ -91,14 +101,14 @@ char* decompress(const compressed_string_t* compressed, char* decompressed) { i += put_utf8(decompressed + i, values[searched_length + bits - max_code]); } - decompressed[compressed->length-1] = '\0'; + decompressed[length-1] = '\0'; return decompressed; } inline __attribute__((always_inline)) const compressed_string_t* translate(const char* original) { #ifndef NO_QSTR #define QDEF(id, str) - #define TRANSLATION(id, len, compressed...) if (strcmp(original, id) == 0) { static const compressed_string_t v = {.length = len, .data = compressed}; return &v; } else + #define TRANSLATION(id, firstbyte, ...) if (strcmp(original, id) == 0) { static const compressed_string_t v = { .data = firstbyte, .tail = { __VA_ARGS__ } }; return &v; } else #include "genhdr/qstrdefs.generated.h" #undef TRANSLATION #undef QDEF diff --git a/supervisor/shared/translate.h b/supervisor/shared/translate.h index 5e8acbb6af..067a44e1fc 100644 --- a/supervisor/shared/translate.h +++ b/supervisor/shared/translate.h @@ -30,12 +30,13 @@ #include typedef struct { - uint16_t length; - const uint8_t data[]; + uint8_t data; + const uint8_t tail[]; } compressed_string_t; const compressed_string_t* translate(const char* c); void serial_write_compressed(const compressed_string_t* compressed); char* decompress(const compressed_string_t* compressed, char* decompressed); +uint16_t decompress_length(const compressed_string_t* compressed); #endif // MICROPY_INCLUDED_SUPERVISOR_TRANSLATE_H From fd00bb8b7faa630f6450feb27ad079f159a7b322 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 28 May 2020 12:15:21 -0400 Subject: [PATCH 056/131] Fix pin reset flash conflict error --- ports/mimxrt10xx/supervisor/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index b6ae002930..d5f99519a9 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -257,8 +257,8 @@ safe_mode_t port_init(void) { // enabled. It won't occur very often so it'll be low overhead. NVIC_EnableIRQ(SNVS_HP_WRAPPER_IRQn); - // Reset everything into a known state before board_init. - reset_port(); + // Note that reset_port CANNOT GO HERE, unlike other ports, since we currently rely on it to + // protect never_reset pins per board. if (board_requests_safe_mode()) { return USER_SAFE_MODE; From d0f9b5901e37a751a0bf5770c2f26a5c6c039dd4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 28 May 2020 11:29:28 -0500 Subject: [PATCH 057/131] translations: document the compressed format --- py/makeqstrdata.py | 3 +++ supervisor/shared/translate.h | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 64e4d26f45..df2c687e5c 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -2,6 +2,9 @@ Process raw qstr file and output qstr data with length, hash and data bytes. This script works with Python 2.7, 3.3 and 3.4. + +For documentation about the format of compressed translated strings, see +supervisor/shared/translate.h """ from __future__ import print_function diff --git a/supervisor/shared/translate.h b/supervisor/shared/translate.h index 067a44e1fc..731b26d123 100644 --- a/supervisor/shared/translate.h +++ b/supervisor/shared/translate.h @@ -29,11 +29,38 @@ #include +// The format of the compressed data is: +// - the size of the uncompressed string in UTF-8 bytes, encoded as a +// (compress_max_length_bits)-bit number. compress_max_length_bits is +// computed during dictionary generation time, and happens to be 8 +// for all current platforms. However, it'll probably end up being +// 9 in some translations sometime in the future. This length excludes +// the trailing NUL, though notably decompress_length includes it. +// +// - followed by the huffman encoding of the individual UTF-16 code +// points that make up the string. The trailing "\0" is not +// represented by a huffman code, but is implied by the length. +// (building the huffman encoding on UTF-16 code points gave better +// compression than building it on UTF-8 bytes) +// +// The "data" / "tail" construct is so that the struct's last member is a +// "flexible array". However, the _only_ member is not permitted to be +// a flexible member, so we have to declare the first byte as a separte +// member of the structure. +// +// For translations where length needs 8 bits, this saves about 1.5 +// bytes per string on average compared to a structure of {uint16_t, +// flexible array}, but is also future-proofed against strings with +// UTF-8 length above 256, with a savings of about 1.375 bytes per +// string. typedef struct { uint8_t data; const uint8_t tail[]; } compressed_string_t; +// Return the compressed, translated version of a source string +// Usually, due to LTO, this is optimized into a load of a constant +// pointer. const compressed_string_t* translate(const char* c); void serial_write_compressed(const compressed_string_t* compressed); char* decompress(const compressed_string_t* compressed, char* decompressed); From a9419b5d46b00bfcb7577ef5ad3149d57308d00a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 May 2020 15:06:24 -0700 Subject: [PATCH 058/131] Update ESP IDF --- ports/esp32s2/esp-idf | 2 +- ports/esp32s2/supervisor/usb.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 0daf6e0e41..7aae7f034b 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 0daf6e0e41f95d22d193d08941a00df9525bc405 +Subproject commit 7aae7f034bab68d2dd6aaa763924c91eb697d87e diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c index 7c508485e4..8bba84015a 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/esp32s2/supervisor/usb.c @@ -29,6 +29,11 @@ #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" +#include "esp-idf/components/soc/soc/esp32s2/include/soc/usb_periph.h" +#include "esp-idf/components/driver/include/driver/periph_ctrl.h" +#include "esp-idf/components/driver/include/driver/gpio.h" +#include "esp-idf/components/esp_rom/include/esp32s2/rom/gpio.h" + #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -64,16 +69,22 @@ void usb_device_task(void* param) } void init_usb_hardware(void) { + periph_module_reset(PERIPH_USB_MODULE); + periph_module_enable(PERIPH_USB_MODULE); usb_hal_context_t hal = { .use_external_phy = false // use built-in PHY }; usb_hal_init(&hal); + // Initialize the pin drive strength. + gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3); + gpio_set_drive_capability(USBPHY_DP_NUM, GPIO_DRIVE_CAP_3); + (void) xTaskCreateStatic(usb_device_task, "usbd", USBD_STACK_SIZE, NULL, - configMAX_PRIORITIES-1, + 5, usb_device_stack, &usb_device_taskdef); } From 796373b8be015644425a1167c5c3b64f7a010c8d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 May 2020 15:43:55 -0700 Subject: [PATCH 059/131] A number of small ESP32S2 fixes: * Fix flash writes that don't end on a sector boundary. Fixes #2944 * Fix enum incompatibility with IDF. * Fix printf output so it goes out debug UART. * Increase stack size to 8k. * Fix sleep of less than a tick so it doesn't crash. --- ports/atmel-samd/Makefile | 4 ++-- ports/esp32s2/Makefile | 2 +- ports/esp32s2/mpconfigport.h | 1 + ports/esp32s2/sdkconfig.defaults | 2 +- ports/esp32s2/supervisor/internal_flash.c | 6 ++++-- ports/esp32s2/supervisor/port.c | 3 +++ ports/litex/Makefile | 4 ++-- ports/mimxrt10xx/Makefile | 4 ++-- ports/nrf/Makefile | 4 ++-- ports/stm/Makefile | 4 ++-- py/circuitpy_defns.mk | 1 - py/circuitpy_mpconfig.h | 2 ++ 12 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 8a5c3309f4..d0ab65e6b7 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -134,7 +134,7 @@ else endif endif -CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) ifeq ($(CHIP_FAMILY), samd21) CFLAGS += \ @@ -157,7 +157,7 @@ endif -LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc # Use toolchain libm if we're not using our own. diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 1104c5289f..5ad5c2f1d3 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -110,7 +110,7 @@ endif CFLAGS += $(INC) -Werror -Wall -mlongcalls -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-Map=$@.map -Wl,-cref +LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-Map=$@.map -Wl,-cref LDFLAGS += -L$(BUILD)/esp-idf/esp-idf/esp32s2 \ -Tesp32s2_out.ld \ -L$(BUILD)/esp-idf/esp-idf/esp32s2/ld \ diff --git a/ports/esp32s2/mpconfigport.h b/ports/esp32s2/mpconfigport.h index c307d47916..d340bb4805 100644 --- a/ports/esp32s2/mpconfigport.h +++ b/ports/esp32s2/mpconfigport.h @@ -32,6 +32,7 @@ #define MICROPY_NLR_THUMB (0) #define MICROPY_PY_UJSON (0) +#define MICROPY_USE_INTERNAL_PRINTF (0) #include "py/circuitpy_mpconfig.h" diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/sdkconfig.defaults index f7deb53fb0..958e1852ea 100644 --- a/ports/esp32s2/sdkconfig.defaults +++ b/ports/esp32s2/sdkconfig.defaults @@ -259,7 +259,7 @@ CONFIG_ESP32S2_RTC_CLK_CAL_CYCLES=576 CONFIG_ESP_ERR_TO_NAME_LOOKUP=y CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index aab7e587ae..ef216c4b1b 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -100,18 +100,20 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 _cache_lba = sector_offset; } for (uint8_t b = block_offset; b < blocks_per_sector; b++) { + // Stop copying after the last block. + if (block >= num_blocks) { + break; + } memcpy(_cache + b * FILESYSTEM_BLOCK_SIZE, src + block * FILESYSTEM_BLOCK_SIZE, FILESYSTEM_BLOCK_SIZE); block++; } result = esp_partition_erase_range(_partition, sector_offset, SECTOR_SIZE); - ESP_EARLY_LOGW(TAG, "erase %d", result); result = esp_partition_write(_partition, sector_offset, _cache, SECTOR_SIZE); - ESP_EARLY_LOGW(TAG, "write %d", result); } return 0; // success diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 9e83e5778c..4c42f11af9 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -152,6 +152,9 @@ void port_sleep_until_interrupt(void) { // FreeRTOS delay here maybe. // Light sleep shuts down BLE and wifi. // esp_light_sleep_start() + if (sleep_time_duration == 0) { + return; + } vTaskDelayUntil(&sleep_time_set, sleep_time_duration); } diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 596eaf2bb3..d75a4da288 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -83,14 +83,14 @@ else ### CFLAGS += -flto endif -CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) # TODO: check this CFLAGS += -D__START=main -DFOMU LD_FILE := boards/$(BOARD)/$(BOARD)-spi.ld -LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs -Wl,-melf32lriscv +LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs -Wl,-melf32lriscv LIBS := -lgcc -lc diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 922978ac2e..78cab0188e 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -90,7 +90,7 @@ else #CFLAGS += -flto -flto-partition=none endif -CFLAGS += $(INC) -ggdb -Wall -Wno-cast-align -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -ggdb -Wall -Wno-cast-align -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) # TODO: add these when -Werror is applied # Disable some warnings, as do most ports. NXP SDK causes undef, tinyusb causes cast-align @@ -112,7 +112,7 @@ LD_FILES = $(wildcard boards/$(BOARD)/*.ld) $(addprefix linking/, flash/$(FLASH) LD_SCRIPT_FLAG := -Wl,-T, -LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib $(addprefix $(LD_SCRIPT_FLAG), $(LD_FILES)) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib $(addprefix $(LD_SCRIPT_FLAG), $(LD_FILES)) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc -lnosys -lm # Use toolchain libm if we're not using our own. diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 8a7b1104b9..44d1f3de2d 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -93,7 +93,7 @@ else endif -CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) # Undo some warnings. # nrfx uses undefined preprocessor variables quite casually, so we can't do warning checks for these. @@ -114,7 +114,7 @@ CFLAGS += \ # TODO: check this CFLAGS += -D__START=main -LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc LDFLAGS += -mthumb -mcpu=cortex-m4 diff --git a/ports/stm/Makefile b/ports/stm/Makefile index b667990bda..bd69d6fd7a 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -94,7 +94,7 @@ endif # MCU Series is defined by the HAL package and doesn't need to be specified here C_DEFS = -D$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_VARIANT) -CFLAGS += $(INC) -Werror -Wall -std=gnu11 $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -nostdlib -nostartfiles +CFLAGS += $(INC) -Werror -Wall -std=gnu11 -fshort-enums $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -nostdlib -nostartfiles # Undo some warnings. # STM32 HAL uses undefined preprocessor variables, shadowed variables, casts that change alignment reqs @@ -136,7 +136,7 @@ ifndef BOOTLOADER_OFFSET BOOTLOADER_OFFSET := 0x8000000 endif -LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-T,$(LD_COMMON) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-T,$(LD_COMMON) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc # Use toolchain libm if we're not using our own. diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 9e36f2e6a2..46e8d43d3c 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -48,7 +48,6 @@ BASE_CFLAGS = \ -D__$(CHIP_VARIANT)__ \ -ffunction-sections \ -fdata-sections \ - -fshort-enums \ -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF \ -DCIRCUITPY_CANARY_WORD=0xADAF00 \ -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 5f2605c92f..62ef9062dd 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -121,7 +121,9 @@ #define MICROPY_REPL_EVENT_DRIVEN (0) #define MICROPY_STACK_CHECK (1) #define MICROPY_STREAMS_NON_BLOCK (1) +#ifndef MICROPY_USE_INTERNAL_PRINTF #define MICROPY_USE_INTERNAL_PRINTF (1) +#endif // fatfs configuration used in ffconf.h // From 2fb4fa328946b07d90bd951d4a134ea8d31be7e8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 May 2020 18:29:11 -0700 Subject: [PATCH 060/131] Spill registers before scanning the stack. From the change: // xtensa has more registers than an instruction can address. The 16 that // can be addressed are called the "window". When a function is called or // returns the window rotates. This allows for more efficient function calls // because ram doesn't need to be used. It's only used if the window wraps // around onto itself. At that point values are "spilled" to empty spots in // the stack that were set aside. When the window rotates back around (on // function return), the values are restored into the register from ram. // So, in order to read the values in the stack scan we must make sure all // of the register values we care about have been spilled to RAM. Luckily, // there is a HAL call to do it. There is a bit of a race condition here // because the register value could change after it's been restored but that // is unlikely to happen with a heap pointer while we do a GC. Fixes #2907 --- ports/esp32s2/mphalport.c | 20 +++++++++++++++++++- ports/esp32s2/tools/decode_backtrace.py | 23 +++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 ports/esp32s2/tools/decode_backtrace.py diff --git a/ports/esp32s2/mphalport.c b/ports/esp32s2/mphalport.c index 772b61c9e0..da5258b0e2 100644 --- a/ports/esp32s2/mphalport.c +++ b/ports/esp32s2/mphalport.c @@ -37,6 +37,24 @@ void mp_hal_delay_us(mp_uint_t delay) { mp_hal_delay_ms(delay / 1000); } -mp_uint_t cpu_get_regs_and_sp(mp_uint_t *regs) { +// This is provided by the esp-idf/components/xtensa/esp32s2/libhal.a binary +// blob. +extern void xthal_window_spill(void); + +mp_uint_t cpu_get_regs_and_sp(mp_uint_t *regs, uint8_t reg_count) { + // xtensa has more registers than an instruction can address. The 16 that + // can be addressed are called the "window". When a function is called or + // returns the window rotates. This allows for more efficient function calls + // because ram doesn't need to be used. It's only used if the window wraps + // around onto itself. At that point values are "spilled" to empty spots in + // the stack that were set aside. When the window rotates back around (on + // function return), the values are restored into the register from ram. + + // So, in order to read the values in the stack scan we must make sure all + // of the register values we care about have been spilled to RAM. Luckily, + // there is a HAL call to do it. There is a bit of a race condition here + // because the register value could change after it's been restored but that + // is unlikely to happen with a heap pointer while we do a GC. + xthal_window_spill(); return (mp_uint_t) __builtin_frame_address(0); } diff --git a/ports/esp32s2/tools/decode_backtrace.py b/ports/esp32s2/tools/decode_backtrace.py new file mode 100644 index 0000000000..3f078895af --- /dev/null +++ b/ports/esp32s2/tools/decode_backtrace.py @@ -0,0 +1,23 @@ +"""Simple script that translates "Backtrace:" lines from the ESP output to files + and line numbers. + + Run with: python3 tools/decode_backtrace.py + + Enter the backtrace line at the "? " prompt. CTRL-C to exit the script. + """ + +import subprocess +import sys + +board = sys.argv[1] +print(board) + +while True: + addresses = input("? ") + if addresses.startswith("Backtrace:"): + addresses = addresses[len("Backtrace:"):] + addresses = addresses.strip().split() + addresses = [address.split(":")[0] for address in addresses] + print('got', addresses) + subprocess.run(["xtensa-esp32s2-elf-addr2line", + "-e", "build-{}/firmware.elf".format(board)] + addresses) From 0d2fee95e25602ba12921e8ca7a4a288a684078d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 29 May 2020 11:06:30 -0400 Subject: [PATCH 061/131] enable aesio on all nRF52840 boards --- ports/nrf/mpconfigport.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index a9ad11bd44..474446f5cd 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -45,6 +45,9 @@ MCU_SERIES = m4 MCU_VARIANT = nrf52 MCU_SUB_VARIANT = nrf52840 +# Fits on nrf52840 but space is tight on nrf52833. +CIRCUITPY_AESIO ?= 1 + SD ?= s140 SOFTDEV_VERSION ?= 6.1.0 From fe75c7793c9b7e18c35935befabdfa3892acc364 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 29 May 2020 12:19:37 -0400 Subject: [PATCH 062/131] Fix SWO/Analog overlap, style changes --- ports/mimxrt10xx/boards/imxrt1010_evk/board.c | 1 - .../boards/imxrt1010_evk/mpconfigboard.h | 4 ++++ ports/mimxrt10xx/boards/imxrt1010_evk/pins.c | 14 ++++++++++---- ports/mimxrt10xx/boards/imxrt1020_evk/board.c | 1 - ports/mimxrt10xx/boards/imxrt1060_evk/board.c | 1 - ports/mimxrt10xx/supervisor/port.c | 4 ++-- ports/stm/common-hal/busio/I2C.c | 2 +- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c index b94e6055e4..ba3498581c 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c @@ -33,7 +33,6 @@ void board_init(void) { // SWD Pins common_hal_never_reset_pin(&pin_GPIO_AD_13); //SWDIO common_hal_never_reset_pin(&pin_GPIO_AD_12); //SWCLK - common_hal_never_reset_pin(&pin_GPIO_AD_09); //SWO // FLEX flash common_hal_never_reset_pin(&pin_GPIO_SD_12); common_hal_never_reset_pin(&pin_GPIO_SD_11); diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/mpconfigboard.h b/ports/mimxrt10xx/boards/imxrt1010_evk/mpconfigboard.h index 128e33111e..77d458d75b 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/mpconfigboard.h @@ -7,6 +7,10 @@ #define BOARD_FLASH_SIZE (16 * 1024 * 1024) +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO_AD_06) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO_AD_04) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO_AD_03) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO_02) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO_01) diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c b/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c index a5a598760b..a0221a2ad2 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c @@ -4,9 +4,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_09) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_09) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_10) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_AD_05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_AD_06) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_08) }, @@ -20,9 +18,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_AD_03) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_AD_06) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_01) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_07) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_09) }, @@ -31,6 +27,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_01) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_10) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_AD_04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_AD_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_AD_06) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_USER_LED), MP_ROM_PTR(&pin_GPIO_11) }, { MP_OBJ_NEW_QSTR(MP_QSTR_USER_SW), MP_ROM_PTR(&pin_GPIO_SD_05) }, diff --git a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c index aaa7b382c0..d5166b3560 100644 --- a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c @@ -33,7 +33,6 @@ void board_init(void) { // SWD Pins common_hal_never_reset_pin(&pin_GPIO_AD_B0_00);//SWDIO common_hal_never_reset_pin(&pin_GPIO_AD_B0_01);//SWCLK - common_hal_never_reset_pin(&pin_GPIO_AD_B0_04);//SWO // FLEX flash common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); diff --git a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c index c3895473ef..25bc4e8c9d 100644 --- a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c @@ -33,7 +33,6 @@ void board_init(void) { // SWD Pins common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);//SWDIO common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);//SWCLK - common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);//SWO // FLEX flash common_hal_never_reset_pin(&pin_GPIO_SD_B1_00); diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index d5f99519a9..acec3cf727 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -257,8 +257,8 @@ safe_mode_t port_init(void) { // enabled. It won't occur very often so it'll be low overhead. NVIC_EnableIRQ(SNVS_HP_WRAPPER_IRQn); - // Note that reset_port CANNOT GO HERE, unlike other ports, since we currently rely on it to - // protect never_reset pins per board. + // Note that `reset_port` CANNOT GO HERE, unlike other ports, because `board_init` hasn't been + // run yet, which uses `never_reset` to protect critical pins from being reset by `reset_port`. if (board_requests_safe_mode()) { return USER_SAFE_MODE; diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index e3c59e7e05..48c4c1933a 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -122,7 +122,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, #if (CPY_STM32H7 || CPY_STM32F7) self->handle.Init.Timing = 0x40604E73; //Taken from STCube examples #else - self->handle.Init.ClockSpeed = 100000; + self->handle.Init.ClockSpeed = frequency; self->handle.Init.DutyCycle = I2C_DUTYCYCLE_2; #endif From 0e6813d084233580774eb7dc043f54999998c223 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 29 May 2020 10:17:42 -0700 Subject: [PATCH 063/131] Fix merge-translate by starting with 'theirs' --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b642175969..f6146bfe48 100644 --- a/Makefile +++ b/Makefile @@ -213,7 +213,7 @@ translate: locale/circuitpython.pot merge-translate: git merge HEAD 1>&2 2> /dev/null; test $$? -eq 128 rm locale/*~ || true - git checkout --ours -- locale/* + git checkout --theirs -- locale/* make translate check-translate: locale/circuitpython.pot $(wildcard locale/*.po) From 0fe7efdf36a4432a3127ede6a08d00911036f873 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 29 May 2020 14:01:34 -0400 Subject: [PATCH 064/131] Set correct crystal settings on Discovery boards --- ports/stm/boards/nucleo_f746zg/mpconfigboard.h | 1 + ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h | 1 - ports/stm/boards/stm32f4_discovery/mpconfigboard.h | 3 +-- ports/stm/boards/stm32f746g_discovery/mpconfigboard.h | 2 ++ 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index b1abd140fa..1fc5d37ee6 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -34,6 +34,7 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h index 112d2a83c6..c0590b80c1 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h @@ -33,7 +33,6 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) - #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) #define DEFAULT_I2C_BUS_SCL (&pin_PB10) diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h index 28a370afda..6274345ade 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h @@ -33,5 +33,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) - -#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 28784f6ab9..ae21176aee 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -39,5 +39,7 @@ #define BOARD_OSC_PLLN (400) #define BOARD_OSC_PLLQ (9) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) + #define BOARD_FLASH_LATENCY FLASH_LATENCY_6 #define BOARD_NO_VBUS_SENSE 1 From 2303291f38b959c3ad74590627a9a9ab4f1ac697 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 28 May 2020 20:52:28 +0200 Subject: [PATCH 065/131] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/ --- locale/ID.po | 2 +- locale/es.po | 2 +- locale/fil.po | 2 +- locale/fr.po | 2 +- locale/it_IT.po | 2 +- locale/ko.po | 2 +- locale/pl.po | 2 +- locale/pt_BR.po | 2 +- locale/sv.po | 2 +- locale/zh_Latn_pinyin.po | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index e070d0642e..60c4cbd416 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-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/es.po b/locale/es.po index 08a2db6ce4..b4f86face8 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: \n" diff --git a/locale/fil.po b/locale/fil.po index 3f0b7f97ac..08052a9beb 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-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" diff --git a/locale/fr.po b/locale/fr.po index aa37383af7..fe16dbdc74 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-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2020-05-26 19:37+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language-Team: \n" diff --git a/locale/ko.po b/locale/ko.po index 8e4eb76a5c..af4fd3e7e6 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-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" diff --git a/locale/pl.po b/locale/pl.po index cf0e0f5648..b218a7b7c1 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-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a0c0d9638e..7223c2e026 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-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/locale/sv.po b/locale/sv.po index 3e50a34d8f..18c4708f2c 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-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2020-05-20 18:32+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 87b6787c30..289fd03a57 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-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" From 1616f7cf95a103bd1cc6e65fca0055c987dd7ead Mon Sep 17 00:00:00 2001 From: Thomas Friehoff Date: Fri, 29 May 2020 15:37:01 +0000 Subject: [PATCH 066/131] Translated using Weblate (German) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/de/ --- locale/de_DE.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index bb4a646e51..429aedc296 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" -"PO-Revision-Date: 2020-05-23 16:13+0000\n" -"Last-Translator: Timon \n" +"PO-Revision-Date: 2020-05-29 17:42+0000\n" +"Last-Translator: Thomas Friehoff \n" "Language-Team: German \n" "Language: de_DE\n" @@ -383,7 +383,7 @@ msgstr "Bit depth muss ein Vielfaches von 8 sein." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "Sowohl RX als auch TX sind zu Flusssteuerung erforderlich" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -652,7 +652,7 @@ msgstr "DAC Kanal Intialisierungs Fehler" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "DAC Device Init Error" +msgstr "DAC Device Initialisierungs-Fehler" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -1275,7 +1275,7 @@ msgstr "Pin hat keine ADC Funktionalität" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "Pin kann nur als Eingang verwendet werden" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" @@ -2965,7 +2965,7 @@ msgstr "die ersuchte Länge ist %d, aber das Objekt hat eine Länge von %d" #: py/compile.c msgid "return annotation must be an identifier" -msgstr "return annotation muss ein identifier sein" +msgstr "Rückgabewert-Beschreibung muss ein Identifier sein" #: py/emitnative.c msgid "return expected '%q' but got '%q'" From cf888dc02bf0409cbe6e6ecf3a03a3278a6ec0b2 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Fri, 29 May 2020 15:40:56 -0400 Subject: [PATCH 067/131] .../devices.h: Add GigaDevices GD25S512MD 64 MiB flash chip support. --- supervisor/shared/external_flash/devices.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h index f99fad4e70..466ab49eb8 100644 --- a/supervisor/shared/external_flash/devices.h +++ b/supervisor/shared/external_flash/devices.h @@ -187,6 +187,24 @@ typedef struct { .single_status_byte = false, \ } +// Settings for the Gigadevice GD25S512MD 64MiB SPI flash. +// Datasheet: http://www.gigadevice.com/datasheet/gd25s512md/ +#define GD25S512MD {\ + .total_size = (1 << 26), /* 64 MiB */ \ + .start_up_time_us = 5000, \ + .manufacturer_id = 0xc8, \ + .memory_type = 0x40, \ + .capacity = 0x19, \ + .max_clock_speed_mhz = 104, /* if we need 120 then we can turn on high performance mode */ \ + .quad_enable_bit_mask = 0x02, \ + .has_sector_protection = false, \ + .supports_fast_read = true, \ + .supports_qspi = true, \ + .supports_qspi_writes = true, \ + .write_status_register_split = true, \ + .single_status_byte = false, \ +} + // Settings for the Cypress (was Spansion) S25FL064L 8MiB SPI flash. // Datasheet: http://www.cypress.com/file/316661/download #define S25FL064L {\ From a76447ea6ced99d3ec516e5240938057de1da442 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Fri, 29 May 2020 22:49:31 +0000 Subject: [PATCH 068/131] Translated using Weblate (Swedish) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 18c4708f2c..a0f0494bab 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" -"PO-Revision-Date: 2020-05-20 18:32+0000\n" +"PO-Revision-Date: 2020-05-30 02:52+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -380,7 +380,7 @@ 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 "" +msgstr "Både RX och TX krävs för handskakning" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -1267,7 +1267,7 @@ msgstr "Pinnen har inte ADC-funktionalitet" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "Pinnen är enbart ingång" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" From b354c9e2e8dbbf3ec81e699f13553199df61ef17 Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Sat, 30 May 2020 11:03:46 +0000 Subject: [PATCH 069/131] Translated using Weblate (Dutch) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index aca8fbb8d8..55241b3bd0 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" -"PO-Revision-Date: 2020-05-25 13:52+0000\n" -"Last-Translator: Dustin Watts \n" +"PO-Revision-Date: 2020-05-31 11:41+0000\n" +"Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" "MIME-Version: 1.0\n" @@ -380,7 +380,7 @@ 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 "" +msgstr "RX en TX zijn beide vereist voor stroomregeling" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -1269,7 +1269,7 @@ msgstr "Pin heeft geen ADC mogelijkheden" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "Pin kan alleen voor invoer gebruikt worden" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" From 89bd87d9fca62e3d8255d9435937280a11e857e6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 31 May 2020 10:35:42 -0500 Subject: [PATCH 070/131] shared-bindings: Fix docs of storage.VfsFat This is almost, but not entirely, a whitespace change. "..." was missing or mis-placed in several places The invalid syntax 'def f(self, ):' was used in several places. --- shared-bindings/storage/__init__.c | 97 +++++++++++++++--------------- 1 file changed, 49 insertions(+), 48 deletions(-) diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 8ac08d8c9b..3abc5512c9 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -167,54 +167,55 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_getmount), MP_ROM_PTR(&storage_getmount_obj) }, { MP_ROM_QSTR(MP_QSTR_erase_filesystem), MP_ROM_PTR(&storage_erase_filesystem_obj) }, - //| class VfsFat: - //| def __init__(self, block_device: Any): ... - //| """Create a new VfsFat filesystem around the given block device. - //| - //| :param block_device: Block device the the filesystem lives on""" - //| - //| label: Any = ... - //| """The filesystem label, up to 11 case-insensitive bytes. Note that - //| this property can only be set when the device is writable by the - //| microcontroller.""" - //| - //| def mkfs(self, ) -> Any: - //| """Format the block device, deleting any data that may have been there""" - //| ... - //| - //| def open(self, path: Any, mode: Any) -> Any: - //| """Like builtin ``open()``""" - //| ... - //| - //| def ilistdir(self, path: Any) -> Any: - //| """Return an iterator whose values describe files and folders within - //| ``path``""" - //| ... - //| - //| def mkdir(self, path: Any) -> Any: - //| """Like `os.mkdir`""" - //| ... - //| - //| def rmdir(self, path: Any) -> Any: - //| """Like `os.rmdir`""" - //| ... - //| - //| def stat(self, path: Any) -> Any: - //| """Like `os.stat`""" - //| ... - //| - //| def statvfs(self, path: Any) -> Any: - //| """Like `os.statvfs`""" - //| ... - //| - //| def mount(self, readonly: Any, mkfs: Any) -> Any: - //| """Don't call this directly, call `storage.mount`.""" - //| ... - //| - //| def umount(self, ) -> Any: - //| """Don't call this directly, call `storage.umount`.""" - //| ... - //| +//| class VfsFat: +//| def __init__(self, block_device: Any): +//| """Create a new VfsFat filesystem around the given block device. +//| +//| :param block_device: Block device the the filesystem lives on""" +//| +//| label: Any = ... +//| """The filesystem label, up to 11 case-insensitive bytes. Note that +//| this property can only be set when the device is writable by the +//| microcontroller.""" +//| ... +//| +//| def mkfs(self) -> Any: +//| """Format the block device, deleting any data that may have been there""" +//| ... +//| +//| def open(self, path: Any, mode: Any) -> Any: +//| """Like builtin ``open()``""" +//| ... +//| +//| def ilistdir(self, path: Any) -> Any: +//| """Return an iterator whose values describe files and folders within +//| ``path``""" +//| ... +//| +//| def mkdir(self, path: Any) -> Any: +//| """Like `os.mkdir`""" +//| ... +//| +//| def rmdir(self, path: Any) -> Any: +//| """Like `os.rmdir`""" +//| ... +//| +//| def stat(self, path: Any) -> Any: +//| """Like `os.stat`""" +//| ... +//| +//| def statvfs(self, path: Any) -> Any: +//| """Like `os.statvfs`""" +//| ... +//| +//| def mount(self, readonly: Any, mkfs: Any) -> Any: +//| """Don't call this directly, call `storage.mount`.""" +//| ... +//| +//| def umount(self) -> Any: +//| """Don't call this directly, call `storage.umount`.""" +//| ... +//| { MP_ROM_QSTR(MP_QSTR_VfsFat), MP_ROM_PTR(&mp_fat_vfs_type) }, }; From e0ca70119c420be8d6a65b4b9b7371fb6459af1b Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Mon, 1 Jun 2020 07:13:45 +0000 Subject: [PATCH 071/131] include uf2 firmware for nrf52840 mdk usb dongle which has a uf2 bootloader now --- tools/build_board_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 7eed2c70cc..4433023305 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -53,7 +53,7 @@ extension_by_board = { # nRF52840 dev kits that may not have UF2 bootloaders, "makerdiary_nrf52840_mdk": HEX, - "makerdiary_nrf52840_mdk_usb_dongle": HEX, + "makerdiary_nrf52840_mdk_usb_dongle": HEX_UF2, "pca10056": BIN_UF2, "pca10059": BIN_UF2, "electronut_labs_blip": HEX From ce337eaa27805428b1245502b75e56ae63b8422d Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Mon, 1 Jun 2020 11:35:46 +0200 Subject: [PATCH 072/131] Fix port_get_raw_ticks --- ports/cxd56/supervisor/port.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index 9ec9dbfdf2..a7e9c30a3d 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -29,6 +29,8 @@ #include #include +#include + #include "sched/sched.h" #include "boards/board.h" @@ -45,7 +47,8 @@ safe_mode_t port_init(void) { boardctl(BOARDIOC_INIT, 0); - board_init(); + // Wait until RTC is available + while (g_rtc_enabled == false); if (board_requests_safe_mode()) { return USER_SAFE_MODE; @@ -121,14 +124,10 @@ void board_timerhook(void) } uint64_t port_get_raw_ticks(uint8_t* subticks) { - struct timeval tv; - gettimeofday(&tv, NULL); - long computed_subticks = tv.tv_usec * 1024 * 32 / 1000000; - if (subticks != NULL) { - *subticks = computed_subticks % 32; - } + uint64_t count = cxd56_rtc_count(); + *subticks = count % 32; - return tv.tv_sec * 1024 + computed_subticks / 32; + return count / 32; } // Enable 1/1024 second tick. From 79e2ede7c1f4c712ba159400e10282c8f28fb033 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 07:51:32 -0500 Subject: [PATCH 073/131] Makefile: "make translate" will only update circuitpython.pot We can now rely on weblate to regularly update the individual language files from the template, so "make translate" only needs to update the template file circuitpython.pot. This is advantageous because updating the other files in locale/ was a frequent source of merge conflicts; resolving the conflict incorrectly was something that could easily occur (and did). --- Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f6146bfe48..55f64b17df 100644 --- a/Makefile +++ b/Makefile @@ -202,12 +202,25 @@ pseudoxml: @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." # phony target so we always run +.PHONY: all-source all-source: locale/circuitpython.pot: all-source find $(TRANSLATE_SOURCES) -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale +# Historically, `make translate` updated the .pot file and ran msgmerge. +# However, this was a frequent source of merge conflicts. Weblate can perform +# msgmerge, so make translate merely update the translation template file. +.PHONY: translate translate: locale/circuitpython.pot + +# Note that normally we rely on weblate to perform msgmerge. This reduces the +# chance of a merge conflict between developer changes (that only add and +# remove source strings) and weblate changes (that only add and remove +# translated strings from po files). However, in case this is legitimately +# needed we preserve a rule to do it. +.PHONY: msgmerge +msgmerge: for po in $(shell ls locale/*.po); do msgmerge -U $$po -s --no-fuzzy-matching --add-location=file locale/circuitpython.pot; done merge-translate: @@ -216,8 +229,10 @@ merge-translate: git checkout --theirs -- locale/* make translate -check-translate: locale/circuitpython.pot $(wildcard locale/*.po) - $(PYTHON) tools/check_translations.py $^ +.PHONY: check-translate +check-translate: + find $(TRANSLATE_SOURCES) -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot.tmp -p locale + $(PYTHON) tools/check_translations.py locale/circuitpython.pot.tmp locale/circuitpython.pot; status=$$?; rm -f locale/circuitpython.pot.tmp; exit $$status stubs: @mkdir -p circuitpython-stubs From 9cffe28ae77d1203308c0eed03160ab91e007064 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 31 May 2020 14:20:47 +0000 Subject: [PATCH 074/131] Translated using Weblate (French) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index fe16dbdc74..1c536ab53c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" -"PO-Revision-Date: 2020-05-26 19:37+0000\n" +"PO-Revision-Date: 2020-06-01 13:17+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French \n" @@ -388,7 +388,7 @@ msgstr "La profondeur de bit doit être un multiple de 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "RX et TX requis pour le contrôle de flux" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -1281,7 +1281,7 @@ msgstr "La broche ne peut être utilisée pour l'ADC" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "La broche est entrée uniquement" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" From c909b733a82385a8661ce54fa3ed0b793a0cfffb Mon Sep 17 00:00:00 2001 From: David Glaude Date: Sun, 31 May 2020 14:21:38 +0000 Subject: [PATCH 075/131] Translated using Weblate (French) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 1c536ab53c..9de062b544 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2020-06-01 13:17+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: David Glaude \n" "Language-Team: French \n" "Language: fr\n" @@ -190,12 +190,12 @@ msgstr "l'objet '%s' n'est pas un itérateur" #: py/objtype.c py/runtime.c #, c-format msgid "'%s' object is not callable" -msgstr "objet '%s' n'est pas appelable" +msgstr "l'objet '%s' n'est pas appelable" #: py/runtime.c #, c-format msgid "'%s' object is not iterable" -msgstr "objet '%s' n'est pas itérable" +msgstr "l'objet '%s' n'est pas itérable" #: py/obj.c #, c-format From 81452475e4ce3d3005f7eeb9990c25aa5a378ef2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 31 May 2020 14:27:55 +0000 Subject: [PATCH 076/131] Translated using Weblate (Swedish) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index a0f0494bab..e9c7c7fdf6 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" -"PO-Revision-Date: 2020-05-30 02:52+0000\n" -"Last-Translator: Jonny Bergdahl \n" +"PO-Revision-Date: 2020-06-01 13:17+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: LANGUAGE \n" "Language: sv\n" "MIME-Version: 1.0\n" @@ -3166,7 +3166,7 @@ msgstr "oväntat nyckelordsargument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "unicode name escapes" +msgstr "unicode-namn flyr" #: py/parse.c msgid "unindent does not match any outer indentation level" From 1cc281b6a49ab4021be92fed7c2975c9d0fa9697 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 08:20:23 -0500 Subject: [PATCH 077/131] py.mk: Assume we want all C files from ulab --- py/py.mk | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/py/py.mk b/py/py.mk index a5c8a7dc65..f77e8a201a 100644 --- a/py/py.mk +++ b/py/py.mk @@ -106,19 +106,7 @@ $(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS) endif ifeq ($(CIRCUITPY_ULAB),1) -SRC_MOD += $(addprefix extmod/ulab/code/, \ -compare.c \ -create.c \ -extras.c \ -fft.c \ -filter.c \ -linalg.c \ -ndarray.c \ -numerical.c \ -poly.c \ -ulab.c \ -vectorise.c \ - ) +SRC_MOD += $(wildcard extmod/ulab/code/*.c) CFLAGS_MOD += -DCIRCUITPY_ULAB=1 -DMODULE_ULAB_ENABLED=1 $(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-float-equal -Wno-sign-compare -DCIRCUITPY endif From f211a090e297a71a8a512487aa8a2051caecdc95 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 08:26:23 -0500 Subject: [PATCH 078/131] py.mk: Assume we want all C source files in ulab --- py/py.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/py.mk b/py/py.mk index f77e8a201a..3cb505920c 100644 --- a/py/py.mk +++ b/py/py.mk @@ -106,7 +106,7 @@ $(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS) endif ifeq ($(CIRCUITPY_ULAB),1) -SRC_MOD += $(wildcard extmod/ulab/code/*.c) +SRC_MOD += $(patsubst $(TOP)/%,%,$(wildcard $(TOP)/extmod/ulab/code/*.c)) CFLAGS_MOD += -DCIRCUITPY_ULAB=1 -DMODULE_ULAB_ENABLED=1 $(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-float-equal -Wno-sign-compare -DCIRCUITPY endif From 18c659780eeb6cf04430cdf9899197f4851d1bf6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 08:56:15 -0500 Subject: [PATCH 079/131] ulab: update .. add new modules and functions to our shared-bindings stubs --- extmod/ulab | 2 +- shared-bindings/ulab/approx/__init__.pyi | 52 ++++++++++ shared-bindings/ulab/compare/__init__.pyi | 8 ++ shared-bindings/ulab/vector/__init__.pyi | 116 ++++++++++++---------- 4 files changed, 124 insertions(+), 54 deletions(-) create mode 100644 shared-bindings/ulab/approx/__init__.pyi diff --git a/extmod/ulab b/extmod/ulab index cf61d728e7..cbdd1295c1 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit cf61d728e70b9ec57e5711b40540793a89296f5d +Subproject commit cbdd1295c11e9b810a2712ac5bdfd51381967bf0 diff --git a/shared-bindings/ulab/approx/__init__.pyi b/shared-bindings/ulab/approx/__init__.pyi new file mode 100644 index 0000000000..89f136f690 --- /dev/null +++ b/shared-bindings/ulab/approx/__init__.pyi @@ -0,0 +1,52 @@ +"""Numerical approximation methods""" + +def bisect(fun, a, b, *, xtol=2.4e-7, maxiter=100) -> float: + """ + :param callable f: The function to bisect + :param float a: The left side of the interval + :param float b: The right side of the interval + :param float xtol: The tolerance value + :param float maxiter: The maximum number of iterations to perform + + Find a solution (zero) of the function ``f(x)`` on the interval + (``a``..``b``) using the bisection method. The result is accurate to within + ``xtol`` unless more than ``maxiter`` steps are required.""" + ... + +def newton(fun, x0, *, xtol=2.4e-7, rtol=0.0, maxiter=50) -> float: + """ + :param callable f: The function to bisect + :param float x0: The initial x value + :param float xtol: The absolute tolerance value + :param float rtol: The relative tolerance value + :param float maxiter: The maximum number of iterations to perform + + Find a solution (zero) of the function ``f(x)`` using Newton's Method. + The result is accurate to within ``xtol * rtol * |f(x)|`` unless more than + ``maxiter`` steps are requried.""" + ... + +def fmin(fun, x0, *, xatol=2.4e-7, fatol=2.4e-7, maxiter=200) -> float: + """ + :param callable f: The function to bisect + :param float x0: The initial x value + :param float xatol: The absolute tolerance value + :param float fatol: The relative tolerance value + + Find a minimum of the function ``f(x)`` using the downhill simplex method. + The located ``x`` is within ``fxtol`` of the actual minimum, and ``f(x)`` + is within ``fatol`` of the actual minimum unless more than ``maxiter`` + steps are requried.""" + ... + +def interp(x: ulab.array, xp:ulab.array, fp:ulab.array, *, left=None, right=None) -> ulab.array: + """ + :param ulab.array x: The x-coordinates at which to evaluate the interpolated values. + :param ulab.array xp: The x-coordinates of the data points, must be increasing + :param ulab.array fp: The y-coordinates of the data points, same length as xp + :param left: Value to return for ``x < xp[0]``, default is ``fp[0]``. + :param right: Value to return for ``x > xp[-1]``, default is ``fp[-1]``. + + Returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, fp), evaluated at x.""" + ... + diff --git a/shared-bindings/ulab/compare/__init__.pyi b/shared-bindings/ulab/compare/__init__.pyi index 00a9eae1e6..1606e43c20 100644 --- a/shared-bindings/ulab/compare/__init__.pyi +++ b/shared-bindings/ulab/compare/__init__.pyi @@ -28,3 +28,11 @@ def minimum(x1, x2): must be the same size. If the inputs are both scalars, a number is returned""" ... + +def equal(x1, x2): + """Return an array of bool which is true where x1[i] == x2[i] and false elsewhere""" + ... + +def not_equal(x1, x2): + """Return an array of bool which is false where x1[i] == x2[i] and true elsewhere""" + ... diff --git a/shared-bindings/ulab/vector/__init__.pyi b/shared-bindings/ulab/vector/__init__.pyi index 2c7a804463..0e590f3c83 100644 --- a/shared-bindings/ulab/vector/__init__.pyi +++ b/shared-bindings/ulab/vector/__init__.pyi @@ -5,104 +5,114 @@ applying the function to every element in the array. This is typically much more efficient than expressing the same operation as a Python loop.""" def acos(): - """Computes the inverse cosine function""" - ... + """Computes the inverse cosine function""" + ... def acosh(): - """Computes the inverse hyperbolic cosine function""" - ... + """Computes the inverse hyperbolic cosine function""" + ... def asin(): - """Computes the inverse sine function""" - ... + """Computes the inverse sine function""" + ... def asinh(): - """Computes the inverse hyperbolic sine function""" - ... + """Computes the inverse hyperbolic sine function""" + ... def around(a, *, decimals): - """Returns a new float array in which each element is rounded to - ``decimals`` places.""" - ... + """Returns a new float array in which each element is rounded to + ``decimals`` places.""" + ... def atan(): - """Computes the inverse tangent function; the return values are in the - range [-pi/2,pi/2].""" - ... + """Computes the inverse tangent function; the return values are in the + range [-pi/2,pi/2].""" + ... def atan2(y,x): - """Computes the inverse tangent function of y/x; the return values are in - the range [-pi, pi].""" - ... + """Computes the inverse tangent function of y/x; the return values are in + the range [-pi, pi].""" + ... def atanh(): - """Computes the inverse hyperbolic tangent function""" - ... + """Computes the inverse hyperbolic tangent function""" + ... def ceil(): - """Rounds numbers up to the next whole number""" - ... + """Rounds numbers up to the next whole number""" + ... def cos(): - """Computes the cosine function""" - ... + """Computes the cosine function""" + ... def erf(): - """Computes the error function, which has applications in statistics""" - ... + """Computes the error function, which has applications in statistics""" + ... def erfc(): - """Computes the complementary error function, which has applications in statistics""" - ... + """Computes the complementary error function, which has applications in statistics""" + ... def exp(): - """Computes the exponent function.""" - ... + """Computes the exponent function.""" + ... def expm1(): - """Computes $e^x-1$. In certain applications, using this function preserves numeric accuracy better than the `exp` function.""" - ... + """Computes $e^x-1$. In certain applications, using this function preserves numeric accuracy better than the `exp` function.""" + ... def floor(): - """Rounds numbers up to the next whole number""" - ... + """Rounds numbers up to the next whole number""" + ... def gamma(): - """Computes the gamma function""" - ... + """Computes the gamma function""" + ... def lgamma(): - """Computes the natural log of the gamma function""" - ... + """Computes the natural log of the gamma function""" + ... def log(): - """Computes the natural log""" - ... + """Computes the natural log""" + ... def log10(): - """Computes the log base 10""" - ... + """Computes the log base 10""" + ... def log2(): - """Computes the log base 2""" - ... + """Computes the log base 2""" + ... def sin(): - """Computes the sine""" - ... + """Computes the sine""" + ... def sinh(): - """Computes the hyperbolic sine""" - ... + """Computes the hyperbolic sine""" + ... def sqrt(): - """Computes the square root""" - ... + """Computes the square root""" + ... def tan(): - """Computes the tangent""" - ... + """Computes the tangent""" + ... def tanh(): - """Computes the hyperbolic tangent""" - ... + """Computes the hyperbolic tangent""" + ... + +def vectorise(f, *, otypes=None): + """ + :param callable f: The function to wrap + :param otypes: List of array types that may be returned by the function. None is intepreted to mean the return value is float. + + Wrap a Python function `f` so that it can be applied to arrays. + + The callable must return only values of the types specified by otypes, or the result is undefined.""" + ... From 9f7a874d029afd5b44f5fbcfa05209184d298513 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 08:56:31 -0500 Subject: [PATCH 080/131] make translate --- locale/ID.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/circuitpython.pot | 46 ++++++++++++++++++++++++++++++++++++---- locale/cs.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/de_DE.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/en_US.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/en_x_pirate.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/es.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/fil.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/fr.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/it_IT.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/ko.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/nl.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/pl.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/pt_BR.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/sv.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/zh_Latn_pinyin.po | 46 ++++++++++++++++++++++++++++++++++++---- 16 files changed, 672 insertions(+), 64 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 60c4cbd416..17d54d3a1f 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -885,7 +885,7 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C 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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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" @@ -1372,7 +1373,8 @@ msgid "Running in safe mode! Not running saved code.\n" msgstr "" "Berjalan di mode aman(safe mode)! tidak menjalankan kode yang tersimpan.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA atau SCL membutuhkan pull up" @@ -2109,6 +2111,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2241,6 +2251,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2294,6 +2312,10 @@ msgstr "fungsi diharapkan setidaknya %d argumen, hanya mendapatkan %d" msgid "function got multiple values for argument '%q'" msgstr "fungsi mendapatkan nilai ganda untuk argumen '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2380,6 +2402,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler harus sebuah fungsi" @@ -2424,6 +2450,10 @@ msgstr "" msgid "integer required" msgstr "" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3220,6 +3250,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3232,6 +3266,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3e7fb74e3d..8ccfe64bd6 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -874,7 +874,7 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C 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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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 "" @@ -1356,7 +1357,8 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -2085,6 +2087,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2217,6 +2227,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2270,6 +2288,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2356,6 +2378,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2400,6 +2426,10 @@ msgstr "" msgid "integer required" msgstr "" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3194,6 +3224,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3206,6 +3240,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 737beebdac..38cc92fccd 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -882,7 +882,7 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -972,7 +972,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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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 "" @@ -1364,7 +1365,8 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -2093,6 +2095,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2225,6 +2235,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2278,6 +2296,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2364,6 +2386,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2408,6 +2434,10 @@ msgstr "" msgid "integer required" msgstr "" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3202,6 +3232,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3214,6 +3248,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 429aedc296..69948e690b 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-05-29 17:42+0000\n" "Last-Translator: Thomas Friehoff \n" "Language-Team: German = 2 und <= 36 sein" msgid "integer required" msgstr "integer erforderlich" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3292,6 +3322,10 @@ msgstr "falscher Argumenttyp" msgid "wrong index type" msgstr "falscher Indextyp" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "falsche Anzahl an Argumenten" @@ -3304,6 +3338,10 @@ msgstr "falsche Anzahl zu entpackender Werte" msgid "wrong operand type" msgstr "falscher Operandentyp" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x Wert außerhalb der Grenzen" diff --git a/locale/en_US.po b/locale/en_US.po index 5f2ea4ea5b..579fc6501e 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -874,7 +874,7 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C 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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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 "" @@ -1356,7 +1357,8 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -2085,6 +2087,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2217,6 +2227,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2270,6 +2288,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2356,6 +2378,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2400,6 +2426,10 @@ msgstr "" msgid "integer required" msgstr "" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3194,6 +3224,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3206,6 +3240,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 5428d69021..b240ab689b 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-03-30 22:11+0000\n" "Last-Translator: Tannewt \n" "Language-Team: English \n" "Language-Team: \n" @@ -883,7 +883,7 @@ msgstr "Archivo BMP inválido" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C 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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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" @@ -1374,7 +1375,8 @@ msgstr "Ejecutando en modo seguro! La auto-recarga esta deshabilitada.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necesitan una pull up" @@ -2116,6 +2118,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2250,6 +2260,14 @@ msgstr "el archivo deberia ser una archivo abierto en modo byte" msgid "filesystem must provide mount method" msgstr "sistema de archivos debe proporcionar método de montaje" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2303,6 +2321,10 @@ msgstr "la función esperaba minimo %d argumentos, tiene %d" msgid "function got multiple values for argument '%q'" msgstr "la función tiene múltiples valores para el argumento '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2389,6 +2411,10 @@ msgstr "indices deben ser enteros" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "ensamblador en línea debe ser una función" @@ -2433,6 +2459,10 @@ msgstr "int() arg 2 debe ser >= 2 y <= 36" msgid "integer required" msgstr "Entero requerido" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3237,6 +3267,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "numero erroneo de argumentos" @@ -3249,6 +3283,10 @@ msgstr "numero erroneo de valores a descomprimir" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/fil.po b/locale/fil.po index 08052a9beb..e4c52dced6 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -890,7 +890,7 @@ msgstr "Mali ang BMP file" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C 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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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" @@ -1379,7 +1380,8 @@ msgstr "Tumatakbo sa safe mode! Awtomatikong pag re-reload ay OFF.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "Kailangan ng pull up resistors ang SDA o SCL" @@ -2125,6 +2127,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2262,6 +2272,14 @@ msgstr "file ay dapat buksan sa byte mode" msgid "filesystem must provide mount method" msgstr "ang filesystem dapat mag bigay ng mount method" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2315,6 +2333,10 @@ msgstr "function na inaasahang %d ang argumento, ngunit %d ang nakuha" msgid "function got multiple values for argument '%q'" msgstr "ang function ay nakakuha ng maraming values para sa argument '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2402,6 +2424,10 @@ msgstr "ang mga indeks ay dapat na integer" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler ay dapat na function" @@ -2446,6 +2472,10 @@ msgstr "int() arg 2 ay dapat >=2 at <= 36" msgid "integer required" msgstr "kailangan ng int" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3250,6 +3280,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "mali ang bilang ng argumento" @@ -3262,6 +3296,10 @@ msgstr "maling number ng value na i-unpack" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/fr.po b/locale/fr.po index fe16dbdc74..82208da6ac 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-05-26 19:37+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French =2 et <=36" msgid "integer required" msgstr "entier requis" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3290,6 +3320,10 @@ msgstr "type d'argument incorrect" msgid "wrong index type" msgstr "type d'index incorrect" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "mauvais nombres d'arguments" @@ -3302,6 +3336,10 @@ msgstr "mauvais nombre de valeurs à dégrouper" msgid "wrong operand type" msgstr "type d'opérande incorrect" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "valeur x hors limites" diff --git a/locale/it_IT.po b/locale/it_IT.po index 4225fe3371..960542a04e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -890,7 +890,7 @@ msgstr "File BMP non valido" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C 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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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" @@ -1388,7 +1389,8 @@ msgstr "Modalità sicura in esecuzione! Auto-reload disattivato.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necessitano un pull-up" @@ -2127,6 +2129,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2263,6 +2273,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "il filesystem deve fornire un metodo di mount" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2316,6 +2334,10 @@ msgstr "la funzione prevede al massimo %d argmoneti, ma ne ha ricevuti %d" msgid "function got multiple values for argument '%q'" msgstr "la funzione ha ricevuto valori multipli per l'argomento '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2403,6 +2425,10 @@ msgstr "gli indici devono essere interi" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler deve essere una funzione" @@ -2447,6 +2473,10 @@ msgstr "il secondo argomanto di int() deve essere >= 2 e <= 36" msgid "integer required" msgstr "intero richiesto" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3257,6 +3287,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "numero di argomenti errato" @@ -3269,6 +3303,10 @@ msgstr "numero di valori da scompattare non corretto" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/ko.po b/locale/ko.po index af4fd3e7e6..4f31e320df 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -878,7 +878,7 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C 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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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 "핀이 유효하지 않습니다" @@ -1360,7 +1361,8 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -2090,6 +2092,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2222,6 +2232,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2275,6 +2293,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2361,6 +2383,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2405,6 +2431,10 @@ msgstr "" msgid "integer required" msgstr "정수가 필요합니다" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3199,6 +3229,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3211,6 +3245,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 55241b3bd0..13ca26261e 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-05-31 11:41+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -894,7 +894,7 @@ msgstr "Ongeldig BMP bestand" msgid "Invalid DAC pin supplied" msgstr "Ongeldige DAC pin opgegeven" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "Ongeldige I2C 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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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" @@ -1390,7 +1391,8 @@ msgstr "Draaiende in veilige modus! Auto-herlaad is uit.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Draaiende in veilige modus! Opgeslagen code wordt niet uitgevoerd.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA of SCL hebben een pullup nodig" @@ -2136,6 +2138,14 @@ msgstr "kon de invoerarray niet vanuit vorm uitzenden" msgid "could not invert Vandermonde matrix" msgstr "kon de Vandermonde matrix niet omkeren" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof kleiner dan de lengte van de data set" @@ -2270,6 +2280,14 @@ msgstr "bestand moet een bestand zijn geopend in byte modus" msgid "filesystem must provide mount method" msgstr "bestandssysteem moet een mount methode bieden" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "eerst argument moet een iterabel zijn" @@ -2323,6 +2341,10 @@ msgstr "functie verwachtte op zijn meest %d argumenten, maar kreeg %d" msgid "function got multiple values for argument '%q'" msgstr "functie kreeg meedere waarden voor argument '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "funtie is alleen geïmplementeerd voor scalars en ndarrays" @@ -2410,6 +2432,10 @@ msgstr "indices moeten integers zijn" msgid "indices must be integers, slices, or Boolean lists" msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler moet een functie zijn" @@ -2454,6 +2480,10 @@ msgstr "int() argument 2 moet >=2 en <= 36 zijn" msgid "integer required" msgstr "integer vereist" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3254,6 +3284,10 @@ msgstr "onjuist argumenttype" msgid "wrong index type" msgstr "onjuist indextype" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "onjuist aantal argumenten" @@ -3266,6 +3300,10 @@ msgstr "verkeerd aantal waarden om uit te pakken" msgid "wrong operand type" msgstr "verkeerd operandtype" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x-waarde buiten bereik" diff --git a/locale/pl.po b/locale/pl.po index b218a7b7c1..694e1d3519 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -879,7 +879,7 @@ msgstr "Zły BMP" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C 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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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" @@ -1361,7 +1362,8 @@ msgstr "Uruchomiony tryb bezpieczeństwa! Samo-przeładowanie wyłączone.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA lub SCL wymagają podciągnięcia" @@ -2093,6 +2095,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2226,6 +2236,14 @@ msgstr "file musi być otwarte w trybie bajtowym" msgid "filesystem must provide mount method" msgstr "system plików musi mieć metodę mount" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2279,6 +2297,10 @@ msgstr "funkcja bierze najwyżej %d argumentów, jest %d" msgid "function got multiple values for argument '%q'" msgstr "funkcja dostała wiele wartości dla argumentu '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2365,6 +2387,10 @@ msgstr "indeksy muszą być całkowite" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "wtrącony asembler musi być funkcją" @@ -2409,6 +2435,10 @@ msgstr "argument 2 do int() busi być pomiędzy 2 a 36" msgid "integer required" msgstr "wymagana liczba całkowita" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3205,6 +3235,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "zła liczba argumentów" @@ -3217,6 +3251,10 @@ msgstr "zła liczba wartości do rozpakowania" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x poza zakresem" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 7223c2e026..e8e42fa20a 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -883,7 +883,7 @@ msgstr "Arquivo BMP inválido" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C 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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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" @@ -1373,7 +1374,8 @@ msgstr "Rodando em modo seguro! Atualização automática está desligada.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL precisa de um pull up" @@ -2106,6 +2108,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2239,6 +2249,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "sistema de arquivos deve fornecer método de montagem" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2292,6 +2310,10 @@ msgstr "função esperada na maioria dos %d argumentos, obteve %d" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2378,6 +2400,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2422,6 +2448,10 @@ msgstr "" msgid "integer required" msgstr "inteiro requerido" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3218,6 +3248,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3230,6 +3264,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index a0f0494bab..768ec21bfa 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-05-30 02:52+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -893,7 +893,7 @@ msgstr "Ogiltig BMP-fil" msgid "Invalid DAC pin supplied" msgstr "Ogiltig DAC-pinne angiven" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "Ogiltigt val av I2C-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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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" @@ -1387,7 +1388,8 @@ msgstr "Kör i säkert läge! Autoladdning är avstängd.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Kör i säkert läge! Sparad kod körs inte.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA eller SCL behöver en pullup" @@ -2133,6 +2135,14 @@ msgstr "Kan inte sända indatamatris från form" msgid "could not invert Vandermonde matrix" msgstr "kan inte invertera Vandermonde-matris" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof måste vara mindre än längden på datauppsättningen" @@ -2268,6 +2278,14 @@ msgstr "filen måste vara en fil som öppnats i byte-läge" msgid "filesystem must provide mount method" msgstr "filsystemet måste tillhandahålla mount-metod" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "första argumentet måste vara en iterable" @@ -2321,6 +2339,10 @@ msgstr "funktionen förväntar som mest %d argument, fick %d" msgid "function got multiple values for argument '%q'" msgstr "funktionen fick flera värden för argumentet '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "funktionen är endast implementerad för scalar och ndarray" @@ -2407,6 +2429,10 @@ msgstr "index måste vara heltal" msgid "indices must be integers, slices, or Boolean lists" msgstr "index måste vara heltal, slices, eller Boolean-listor" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler måste vara en funktion" @@ -2451,6 +2477,10 @@ msgstr "int() arg 2 måste vara >= 2 och <= 36" msgid "integer required" msgstr "heltal krävs" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3251,6 +3281,10 @@ msgstr "fel typ av argument" msgid "wrong index type" msgstr "fel indextyp" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "fel antal argument" @@ -3263,6 +3297,10 @@ msgstr "fel antal värden för att packa upp" msgid "wrong operand type" msgstr "fel operandtyp" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x-värde utanför intervall" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 289fd03a57..d2fb379dbf 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -887,7 +887,7 @@ msgstr "Wúxiào de BMP wénjiàn" msgid "Invalid DAC pin supplied" msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "Wúxiào de I2C 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/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.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" @@ -1375,7 +1376,8 @@ msgstr "Zài ānquán móshì xià yùnxíng! Zìdòng chóngxīn jiāzài yǐ g msgid "Running in safe mode! Not running saved code.\n" msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dàimǎ.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA huò SCL xūyào lādòng" @@ -2121,6 +2123,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2254,6 +2264,14 @@ msgstr "wénjiàn bìxū shì zài zì jié móshì xià dǎkāi de wénjiàn" msgid "filesystem must provide mount method" msgstr "wénjiàn xìtǒng bìxū tígōng guà zài fāngfǎ" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2307,6 +2325,10 @@ msgstr "hánshù yùjì zuìduō %d cānshù, huòdé %d" msgid "function got multiple values for argument '%q'" msgstr "hánshù huòdé cānshù '%q' de duōchóng zhí" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2393,6 +2415,10 @@ msgstr "suǒyǐn bìxū shì zhěngshù" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "nèi lián jíhé bìxū shì yīgè hánshù" @@ -2437,6 +2463,10 @@ msgstr "zhěngshù() cānshù 2 bìxū > = 2 qiě <= 36" msgid "integer required" msgstr "xūyào zhěngshù" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3235,6 +3265,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "cānshù shù cuòwù" @@ -3247,6 +3281,10 @@ msgstr "wúfǎ jiě bāo de zhí shù" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x zhí chāochū biānjiè" From 5061405eb3c231473cada799884285c5bd46f8ba Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 09:16:55 -0500 Subject: [PATCH 081/131] fix spelling --- shared-bindings/ulab/vector/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/ulab/vector/__init__.pyi b/shared-bindings/ulab/vector/__init__.pyi index 0e590f3c83..ea2f729aa7 100644 --- a/shared-bindings/ulab/vector/__init__.pyi +++ b/shared-bindings/ulab/vector/__init__.pyi @@ -107,7 +107,7 @@ def tanh(): """Computes the hyperbolic tangent""" ... -def vectorise(f, *, otypes=None): +def vectorize(f, *, otypes=None): """ :param callable f: The function to wrap :param otypes: List of array types that may be returned by the function. None is intepreted to mean the return value is float. From 8af77cb91fa848540e52740e9ed21b969be9cf4f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 11:02:51 -0500 Subject: [PATCH 082/131] ulab: docs: Fix markup error --- shared-bindings/ulab/vector/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/ulab/vector/__init__.pyi b/shared-bindings/ulab/vector/__init__.pyi index ea2f729aa7..bf57e419cd 100644 --- a/shared-bindings/ulab/vector/__init__.pyi +++ b/shared-bindings/ulab/vector/__init__.pyi @@ -112,7 +112,7 @@ def vectorize(f, *, otypes=None): :param callable f: The function to wrap :param otypes: List of array types that may be returned by the function. None is intepreted to mean the return value is float. - Wrap a Python function `f` so that it can be applied to arrays. + Wrap a Python function ``f`` so that it can be applied to arrays. The callable must return only values of the types specified by otypes, or the result is undefined.""" ... From 7f3fd20ea9c6aa6f04ff8901d9fb316fa24194af Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 11:03:38 -0500 Subject: [PATCH 083/131] ulab: update submodule again --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index cbdd1295c1..0394801933 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit cbdd1295c11e9b810a2712ac5bdfd51381967bf0 +Subproject commit 0394801933f6e68a5bc7cdb0da76c7884e8cf70a From 75eb44f234f53767df359c2b1b7651b017352ef1 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 1 Jun 2020 12:20:37 -0400 Subject: [PATCH 084/131] Note temporary issue with Nucleo boards --- ports/stm/boards/nucleo_f746zg/mpconfigboard.h | 2 +- ports/stm/boards/nucleo_f767zi/mpconfigboard.h | 2 +- ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h | 2 +- ports/stm/boards/stm32f746g_discovery/mpconfigboard.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index 1fc5d37ee6..cd2c61b919 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -34,7 +34,7 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 314c96cb5a..1dcb26f49e 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -33,4 +33,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 8909cc5be1..14c2dfe308 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -32,4 +32,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index ae21176aee..cace54e9b0 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -39,7 +39,7 @@ #define BOARD_OSC_PLLN (400) #define BOARD_OSC_PLLQ (9) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 #define BOARD_FLASH_LATENCY FLASH_LATENCY_6 #define BOARD_NO_VBUS_SENSE 1 From 7e632c9414073a36db0b74d891ee0408a2fdb565 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 1 Jun 2020 17:11:20 -0700 Subject: [PATCH 085/131] Update translations --- locale/circuitpython.pot | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0167992b5d..11ecb99e8c 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-06-01 16:52-0700\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2107,6 +2107,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2239,6 +2247,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2292,6 +2308,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2378,6 +2398,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2422,6 +2446,10 @@ msgstr "" msgid "integer required" msgstr "" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3224,6 +3252,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3236,6 +3268,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" From 0722dafc2464b414e680fab700f3f84cd54879df Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 19:10:35 -0500 Subject: [PATCH 086/131] audiomixer: Fix garbled playback when voice 0 is stopped, audio pops There were two main problems - word_buffer was being filled as though with unsigned samples, but during mixing all samples are kept in signed mode - If the first buffer was stopped, the voices_active flag got set anyway, even though the output buffer wasn't initialized yet, so the samples were mixed with indeterminate data We also cover the case where no buffer was playing, and ensure the output buffer is filled. This now works much better. Tested on neotrellis m4 playing back 4 mp3 streams at a time in signed-16, 22050Hz --- shared-module/audiomixer/Mixer.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/shared-module/audiomixer/Mixer.c b/shared-module/audiomixer/Mixer.c index 4a72dab28d..6c1ba1973e 100644 --- a/shared-module/audiomixer/Mixer.c +++ b/shared-module/audiomixer/Mixer.c @@ -143,19 +143,17 @@ static inline uint32_t pack8(uint32_t val) { static void mix_down_one_voice(audiomixer_mixer_obj_t* self, audiomixer_mixervoice_obj_t* voice, bool voices_active, uint32_t* word_buffer, uint32_t length) { - bool voice_done = voice->sample == NULL; - while (!voice_done && length != 0) { + while (length != 0) { if (voice->buffer_length == 0) { if (!voice->more_data) { if (voice->loop) { audiosample_reset_buffer(voice->sample, false, 0); } else { voice->sample = NULL; - voice_done = true; break; } } - if (!voice_done) { + if (voice->sample) { // Load another buffer audioio_get_buffer_result_t result = audiosample_get_buffer(voice->sample, false, 0, (uint8_t**) &voice->remaining_buffer, &voice->buffer_length); // Track length in terms of words. @@ -230,10 +228,8 @@ static void mix_down_one_voice(audiomixer_mixer_obj_t* self, } if (length && !voices_active) { - uint32_t sample_value = self->bits_per_sample == 8 - ? 0x80808080 : 0x80008000; for (uint32_t i = 0; ivoice_count; v++) { audiomixer_mixervoice_obj_t* voice = MP_OBJ_TO_PTR(self->voice[v]); + if(voice->sample) { + mix_down_one_voice(self, voice, voices_active, word_buffer, length); + voices_active = true; + } + } - mix_down_one_voice(self, voice, voices_active, word_buffer, length); - voices_active = true; + if (!voices_active) { + for (uint32_t i = 0; isamples_signed) { From ed8a52d1db09930e2edcf434ca45e8f682ddd4b8 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 2 Jun 2020 10:19:40 +0800 Subject: [PATCH 087/131] litex: remove call to `board_init()` These calls were all moved into `main.c`, however this call was not removed from litex. As a result, litex was calling `board_init()` twice. This is currently not a problem, as `fomu` is able to be initialized twice without issue, however future boards may have issue with this. This fixes #2991. Signed-off-by: Sean Cross --- ports/litex/supervisor/port.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c index 4721d82fad..3125072e60 100644 --- a/ports/litex/supervisor/port.c +++ b/ports/litex/supervisor/port.c @@ -68,7 +68,6 @@ safe_mode_t port_init(void) { irq_setmask(0); irq_setie(1); tick_init(); - board_init(); return NO_SAFE_MODE; } From 96c6fbd10b6592aa2282111f3a9a7b498a20435e Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 2 Jun 2020 01:51:02 +0200 Subject: [PATCH 088/131] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/ --- locale/fr.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/fr.po b/locale/fr.po index 1dcf5f0042..7e9f3b4381 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-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-06-01 13:17+0000\n" "Last-Translator: David Glaude \n" "Language-Team: French Date: Tue, 2 Jun 2020 17:23:43 +0000 Subject: [PATCH 089/131] Translated using Weblate (Dutch) Currently translated at 100.0% (757 of 757 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 13ca26261e..febfa39dae 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 08:56-0500\n" -"PO-Revision-Date: 2020-05-31 11:41+0000\n" +"PO-Revision-Date: 2020-06-02 17:33+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" @@ -1771,7 +1771,7 @@ msgstr "argsort argument moet een ndarray zijn" #: py/runtime.c msgid "argument has wrong type" -msgstr "argument heeft het verkeerde type" +msgstr "argument heeft onjuist type" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -2140,11 +2140,11 @@ msgstr "kon de Vandermonde matrix niet omkeren" #: extmod/ulab/code/approx.c msgid "data must be iterable" -msgstr "" +msgstr "data moet itereerbaar zijn" #: extmod/ulab/code/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "data moet van gelijke lengte zijn" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" @@ -2282,11 +2282,11 @@ msgstr "bestandssysteem moet een mount methode bieden" #: extmod/ulab/code/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "eerste argument moet een aanroepbare (callable) zijn" #: extmod/ulab/code/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "eerste argument moet een functie zijn" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" @@ -2343,7 +2343,7 @@ msgstr "functie kreeg meedere waarden voor argument '%q'" #: extmod/ulab/code/approx.c msgid "function has the same sign at the ends of interval" -msgstr "" +msgstr "functie heeft hetzelfde teken aan beide uiteinden van het interval" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" @@ -2434,7 +2434,7 @@ msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" #: extmod/ulab/code/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "oorspronkelijke waarden moeten itereerbaar zijn" #: py/compile.c msgid "inline assembler must be a function" @@ -2482,7 +2482,7 @@ msgstr "integer vereist" #: extmod/ulab/code/approx.c msgid "interp is defined for 1D arrays of equal length" -msgstr "" +msgstr "interp is gedefinieerd for eendimensionale arrays van gelijke lengte" #: shared-bindings/_bleio/Adapter.c #, c-format @@ -3286,7 +3286,7 @@ msgstr "onjuist indextype" #: extmod/ulab/code/vectorise.c msgid "wrong input type" -msgstr "" +msgstr "onjuist invoertype" #: py/objstr.c msgid "wrong number of arguments" @@ -3302,7 +3302,7 @@ msgstr "verkeerd operandtype" #: extmod/ulab/code/vectorise.c msgid "wrong output type" -msgstr "" +msgstr "onjuist uitvoer type" #: shared-module/displayio/Shape.c msgid "x value out of bounds" From 3f26a56fff80844924ea0adc876f35218e263514 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 2 Jun 2020 19:33:38 +0200 Subject: [PATCH 090/131] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/ --- locale/ID.po | 30 +++++++++++++++++++++++++++++- locale/cs.po | 30 +++++++++++++++++++++++++++++- locale/de_DE.po | 30 +++++++++++++++++++++++++++++- locale/es.po | 30 +++++++++++++++++++++++++++++- locale/fil.po | 30 +++++++++++++++++++++++++++++- locale/fr.po | 30 +++++++++++++++++++++++++++++- locale/it_IT.po | 30 +++++++++++++++++++++++++++++- locale/ko.po | 30 +++++++++++++++++++++++++++++- locale/nl.po | 30 +++++++++++++++++++++++++++++- locale/pl.po | 30 +++++++++++++++++++++++++++++- locale/pt_BR.po | 30 +++++++++++++++++++++++++++++- locale/sv.po | 30 +++++++++++++++++++++++++++++- locale/zh_Latn_pinyin.po | 30 +++++++++++++++++++++++++++++- 13 files changed, 377 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 17d54d3a1f..c40ac105c5 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-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1669,6 +1669,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "PERINGATAN: Nama file kode anda mempunyai dua ekstensi\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3084,6 +3104,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3238,6 +3262,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 38cc92fccd..39bf51af8e 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -1660,6 +1660,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3067,6 +3087,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3220,6 +3244,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 69948e690b..76a0eec831 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-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-05-29 17:42+0000\n" "Last-Translator: Thomas Friehoff \n" "Language-Team: German 0" msgstr "value_count muss größer als 0 sein" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "Fenster muss <= Intervall sein" diff --git a/locale/es.po b/locale/es.po index b41121c4d3..5fe0f945ad 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: \n" @@ -1671,6 +1671,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "ADVERTENCIA: El nombre de archivo de tu código tiene dos extensiones\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3102,6 +3122,10 @@ msgstr "limite debe ser en el rango 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() toma un sequencio 9" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3255,6 +3279,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index e4c52dced6..66ccc711ac 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-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1679,6 +1679,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "BABALA: Ang pangalan ng file ay may dalawang extension\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3114,6 +3134,10 @@ msgstr "ang threshold ay dapat sa range 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kumukuha ng 9-sequence" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3268,6 +3292,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 7e9f3b4381..6a3e08bab5 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-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-06-01 13:17+0000\n" "Last-Translator: David Glaude \n" "Language-Team: French 0" msgstr "'value_count' doit être > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "la fenêtre doit être <= intervalle" diff --git a/locale/it_IT.po b/locale/it_IT.po index 960542a04e..01368e88a8 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1688,6 +1688,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "ATTENZIONE: Il nome del sorgente ha due estensioni\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3121,6 +3141,10 @@ msgstr "la soglia deve essere nell'intervallo 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3275,6 +3299,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 4f31e320df..27f8216f83 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-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1657,6 +1657,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3064,6 +3084,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3217,6 +3241,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index febfa39dae..52a8bdc960 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-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-06-02 17:33+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -1696,6 +1696,26 @@ msgstr "Voltage lees time-out" msgid "WARNING: Your code filename has two extensions\n" msgstr "WAARSCHUWING: De bestandsnaam van de code heeft twee extensies\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3119,6 +3139,10 @@ msgstr "drempelwaarde moet in het bereik 0-65536 liggen" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() accepteert een 9-rij" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "timeout moet tussen 0.0 en 100.0 seconden zijn" @@ -3272,6 +3296,10 @@ msgstr "waarde moet in %d byte(s) passen" msgid "value_count must be > 0" msgstr "value_count moet groter dan 0 zijn" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "window moet <= interval zijn" diff --git a/locale/pl.po b/locale/pl.po index 694e1d3519..0e82359f9b 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-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -1657,6 +1657,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "UWAGA: Nazwa pliku ma dwa rozszerzenia\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3070,6 +3090,10 @@ msgstr "threshold musi być w zakresie 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() wymaga 9-elementowej sekwencji" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3223,6 +3247,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "value_count musi być > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e8e42fa20a..308809a2be 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-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -1670,6 +1670,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "AVISO: Seu arquivo de código tem duas extensões\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3082,6 +3102,10 @@ msgstr "Limite deve estar no alcance de 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3236,6 +3260,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 1f41b3fec8..7823cc05bf 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-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-05-30 02:52+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1693,6 +1693,26 @@ msgstr "Avläsning av spänning tog för lång tid" msgid "WARNING: Your code filename has two extensions\n" msgstr "VARNING: Ditt filnamn för kod har två tillägg\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3116,6 +3136,10 @@ msgstr "tröskelvärdet måste ligga i intervallet 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kräver en 9-sekvens" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "timeout måste vara 0.0-100.0 sekunder" @@ -3269,6 +3293,10 @@ msgstr "värdet måste passa i %d byte(s)" msgid "value_count must be > 0" msgstr "value_count måste vara > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "window måste vara <= interval" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index d2fb379dbf..9f44fbd9ef 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-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1680,6 +1680,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "Jǐnggào: Nǐ de dàimǎ wénjiàn míng yǒu liǎng gè kuòzhǎn míng\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3100,6 +3120,10 @@ msgstr "yùzhí bìxū zài fànwéi 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() xūyào 9 xùliè" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo" @@ -3253,6 +3277,10 @@ msgstr "Zhí bìxū fúhé %d zì jié" msgid "value_count must be > 0" msgstr "zhí jìshù bìxū wèi > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "Chuāngkǒu bìxū shì <= jiàngé" From 048b30d65419f217c122a17572ae1fcfa72efbbf Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 2 Jun 2020 18:04:27 +0000 Subject: [PATCH 091/131] Translated using Weblate (French) Currently translated at 99.8% (763 of 764 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 6a3e08bab5..9c7adb7e00 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-01 13:17+0000\n" -"Last-Translator: David Glaude \n" +"PO-Revision-Date: 2020-06-02 19:50+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1716,18 +1716,22 @@ msgstr "ATTENTION : le nom de fichier de votre code a deux extensions\n" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" +"WatchDogTimer ne peut pas être désinitialisé une fois que le mode est réglé " +"sur RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimer n'est pas en cours d'exécution" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" +"WatchDogTimer.mode ne peut pas être changé une fois réglé pour WatchDogMode." +"RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" +msgstr "WatchDogTimer.timeout doit être supérieur à 0" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." @@ -2187,11 +2191,11 @@ msgstr "n'a pas pu inverser la matrice Vandermonde" #: extmod/ulab/code/approx.c msgid "data must be iterable" -msgstr "" +msgstr "les données doivent être les objets iterables" #: extmod/ulab/code/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "les données doivent être de longueur égale" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" @@ -2331,11 +2335,11 @@ msgstr "le system de fichier doit fournir une méthode 'mount'" #: extmod/ulab/code/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "le premier argument doit être un appelable" #: extmod/ulab/code/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "le premier argument doit être une fonction" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" @@ -2392,7 +2396,7 @@ msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" #: extmod/ulab/code/approx.c msgid "function has the same sign at the ends of interval" -msgstr "" +msgstr "la fonction a le même signe aux extrémités de l’intervalle" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" @@ -2484,7 +2488,7 @@ msgstr "" #: extmod/ulab/code/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "les valeurs initiales doivent être itérables" #: py/compile.c msgid "inline assembler must be a function" @@ -2532,7 +2536,7 @@ msgstr "entier requis" #: extmod/ulab/code/approx.c msgid "interp is defined for 1D arrays of equal length" -msgstr "" +msgstr "interp est défini pour les tableaux 1D de longueur égale" #: shared-bindings/_bleio/Adapter.c #, c-format @@ -3177,7 +3181,7 @@ msgstr "time.struct_time() prend une séquence de longueur 9" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "" +msgstr "le délai d'expiration a dépassé la valeur maximale prise en charge" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" @@ -3334,7 +3338,7 @@ msgstr "'value_count' doit être > 0" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" -msgstr "" +msgstr "watchdog timeout doit être supérieur à 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" @@ -3350,7 +3354,7 @@ msgstr "type d'index incorrect" #: extmod/ulab/code/vectorise.c msgid "wrong input type" -msgstr "" +msgstr "type d'entrée incorrect" #: py/objstr.c msgid "wrong number of arguments" @@ -3366,7 +3370,7 @@ msgstr "type d'opérande incorrect" #: extmod/ulab/code/vectorise.c msgid "wrong output type" -msgstr "" +msgstr "type de sortie incorrect" #: shared-module/displayio/Shape.c msgid "x value out of bounds" From fa8890f7ba4709c1657f2913f487b50d9808a999 Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Tue, 2 Jun 2020 17:33:42 +0000 Subject: [PATCH 092/131] Translated using Weblate (Dutch) Currently translated at 100.0% (764 of 764 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 52a8bdc960..5be371d83f 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-02 17:33+0000\n" +"PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" @@ -1699,22 +1699,26 @@ msgstr "WAARSCHUWING: De bestandsnaam van de code heeft twee extensies\n" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" +"WatchDogTimer kan niet worden gedeïnitialiseerd zodra de modus in ingesteld " +"op RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimer is momenteel niet actief" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" +"WatchDogTimer.mode kan niet worden gewijzigd zodra de modus is ingesteld op " +"WatchDogMode.RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" +msgstr "WatchDogTimer.timeout moet groter dan 0 zijn" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "" +msgstr "Watchdog-timer verstreken." #: py/builtinhelp.c #, c-format @@ -3141,7 +3145,7 @@ msgstr "time.struct_time() accepteert een 9-rij" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "" +msgstr "time-outduur is groter dan de ondersteunde maximale waarde" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" @@ -3298,7 +3302,7 @@ msgstr "value_count moet groter dan 0 zijn" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" -msgstr "" +msgstr "watchdog time-out moet groter zijn dan 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From cc1e5d29c7348fee9edd91ff17515d2c98726e81 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 2 Jun 2020 20:59:34 +0000 Subject: [PATCH 093/131] Translated using Weblate (Swedish) Currently translated at 100.0% (764 of 764 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 7823cc05bf..58e810c4c2 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-05-30 02:52+0000\n" +"PO-Revision-Date: 2020-06-02 21:42+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -33,7 +33,7 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" "\n" -"Skapa ett ärende med innehållet i din CIRCUITPY på\n" +"Vänligen skapa ett ärende med innehållet i din CIRCUITPY-enhet på\n" "https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c @@ -42,7 +42,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"För att avsluta, resetta kortet utan " +"För att avsluta, gör reset på kortet utan " #: py/obj.c msgid " File \"%q\"" @@ -108,7 +108,7 @@ msgstr "'%q' argument krävs" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" -msgstr "'%s' förväntar sig en etikett" +msgstr "'%s' förväntar sig en label" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -1695,23 +1695,24 @@ msgstr "VARNING: Ditt filnamn för kod har två tillägg\n" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" -msgstr "" +msgstr "WatchDogTimer kan inte avinitialiseras när läget är inställt på RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimer körs för närvarande inte" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" +"WatchDogTimer.mode kan inte ändras när den är inställd på WatchDogMode.RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" +msgstr "WatchDogTimer.timeout måste vara större än 0" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "" +msgstr "Watchdog-timern har löpt ut." #: py/builtinhelp.c #, c-format @@ -2157,11 +2158,11 @@ msgstr "kan inte invertera Vandermonde-matris" #: extmod/ulab/code/approx.c msgid "data must be iterable" -msgstr "" +msgstr "data måste vara itererbar" #: extmod/ulab/code/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "data måste vara av samma längd" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" @@ -2300,11 +2301,11 @@ msgstr "filsystemet måste tillhandahålla mount-metod" #: extmod/ulab/code/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "första argumentet måste vara en callable" #: extmod/ulab/code/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "första argumentet måste vara en funktion" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" @@ -2361,7 +2362,7 @@ msgstr "funktionen fick flera värden för argumentet '%q'" #: extmod/ulab/code/approx.c msgid "function has the same sign at the ends of interval" -msgstr "" +msgstr "funktionen har samma teckenvärden vid slutet av intervall" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" @@ -2451,7 +2452,7 @@ msgstr "index måste vara heltal, slices, eller Boolean-listor" #: extmod/ulab/code/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "initialvärden måste vara iterable" #: py/compile.c msgid "inline assembler must be a function" @@ -2499,7 +2500,7 @@ msgstr "heltal krävs" #: extmod/ulab/code/approx.c msgid "interp is defined for 1D arrays of equal length" -msgstr "" +msgstr "interp är definierad för 1D-matriser med samma längd" #: shared-bindings/_bleio/Adapter.c #, c-format @@ -3138,7 +3139,7 @@ msgstr "time.struct_time() kräver en 9-sekvens" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "" +msgstr "timeout-längd överskred det maximala värde som stöds" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" @@ -3295,7 +3296,7 @@ msgstr "value_count måste vara > 0" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" -msgstr "" +msgstr "watchdog timeout måste vara större än 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" @@ -3311,7 +3312,7 @@ msgstr "fel indextyp" #: extmod/ulab/code/vectorise.c msgid "wrong input type" -msgstr "" +msgstr "fel indatatyp" #: py/objstr.c msgid "wrong number of arguments" @@ -3327,7 +3328,7 @@ msgstr "fel operandtyp" #: extmod/ulab/code/vectorise.c msgid "wrong output type" -msgstr "" +msgstr "fel utdatatyp" #: shared-module/displayio/Shape.c msgid "x value out of bounds" From b5b9a569185efa434aae6fae463bfb8ebd3104b4 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 2 Jun 2020 18:05:59 -0400 Subject: [PATCH 094/131] Update teensy 4.0/4.1 pin protections --- ports/mimxrt10xx/boards/teensy40/board.c | 18 ++++++++++-------- ports/mimxrt10xx/boards/teensy41/board.c | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ports/mimxrt10xx/boards/teensy40/board.c b/ports/mimxrt10xx/boards/teensy40/board.c index a16e901037..28786ab902 100644 --- a/ports/mimxrt10xx/boards/teensy40/board.c +++ b/ports/mimxrt10xx/boards/teensy40/board.c @@ -30,11 +30,6 @@ #include "shared-bindings/microcontroller/Pin.h" void board_init(void) { - // SWD Pins - common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);//SWDIO - common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);//SWCLK - common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);//SWO - // FLEX flash common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); @@ -43,9 +38,16 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); - // USB Pins - common_hal_never_reset_pin(&pin_GPIO_AD_B0_01); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_03); + // FLEX flash 2 + common_hal_never_reset_pin(&pin_GPIO_AD_B0_04); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_06); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_07); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_08); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_09); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_10); + common_hal_never_reset_pin(&pin_GPIO_EMC_01); + common_hal_never_reset_pin(&pin_GPIO_B0_13); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/teensy41/board.c b/ports/mimxrt10xx/boards/teensy41/board.c index 52dd498b3f..f9dea01f70 100644 --- a/ports/mimxrt10xx/boards/teensy41/board.c +++ b/ports/mimxrt10xx/boards/teensy41/board.c @@ -29,6 +29,24 @@ #include "mpconfigboard.h" void board_init(void) { + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + + // FLEX flash 2 + common_hal_never_reset_pin(&pin_GPIO_AD_B0_04); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_06); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_07); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_08); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_09); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_10); + common_hal_never_reset_pin(&pin_GPIO_EMC_01); + common_hal_never_reset_pin(&pin_GPIO_B0_13); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); } bool board_requests_safe_mode(void) { From 60df6170cc5d0e495fde9613c05c55b64189b425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 30 May 2020 10:42:29 +0100 Subject: [PATCH 095/131] Update CODE_OF_CONDUCT.md from source-of-truth repository. --- CODE_OF_CONDUCT.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 7eb8d93eae..be1966ce1e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,9 @@ + # Adafruit Community Code of Conduct ## Our Pledge @@ -43,7 +49,7 @@ Examples of unacceptable behavior by participants include: The goal of the standards and moderation guidelines outlined here is to build and maintain a respectful community. We ask that you don’t just aim to be -"technically unimpeachable", but rather try to be your best self. +"technically unimpeachable", but rather try to be your best self. We value many things beyond technical expertise, including collaboration and supporting others within our community. Providing a positive experience for @@ -74,9 +80,9 @@ You may report in the following ways: In any situation, you may send an email to . On the Adafruit Discord, you may send an open message from any channel -to all Community Moderators by tagging @community moderators. You may -also send an open message from any channel, or a direct message to -@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442, +to all Community Moderators by tagging @community moderators. You may +also send an open message from any channel, or a direct message to +@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442, @sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175. Email and direct message reports will be kept confidential. From dd5d7c86d22807c021dd1711eb7dd3daebc5cfcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 30 May 2020 10:44:13 +0100 Subject: [PATCH 096/131] Fix up end of file and trailing whitespace. This can be enforced by pre-commit, but correct it separately to make it easier to review. --- .github/workflows/create_website_pr.yml | 2 +- BUILDING.md | 6 +- docs/README.md | 4 +- drivers/wiznet5k/ethernet/socket.c | 104 +++--- drivers/wiznet5k/ethernet/socket.h | 102 +++--- drivers/wiznet5k/ethernet/w5200/w5200.c | 38 +-- drivers/wiznet5k/ethernet/w5200/w5200.h | 82 ++--- drivers/wiznet5k/ethernet/w5500/w5500.c | 47 ++- drivers/wiznet5k/ethernet/w5500/w5500.h | 82 ++--- drivers/wiznet5k/ethernet/wizchip_conf.c | 80 ++--- drivers/wiznet5k/ethernet/wizchip_conf.h | 162 +++++----- drivers/wiznet5k/internet/dhcp/dhcp.h | 54 ++-- drivers/wiznet5k/internet/dns/dns.c | 42 +-- drivers/wiznet5k/internet/dns/dns.h | 40 +-- extmod/font_petme128_8x8.h | 2 +- lib/libm/ef_rem_pio2.c | 50 +-- lib/libm/ef_sqrt.c | 14 +- lib/libm/erf_lgamma.c | 14 +- lib/libm/fdlibm.h | 20 +- lib/libm/kf_cos.c | 8 +- lib/libm/kf_rem_pio2.c | 32 +- lib/libm/kf_sin.c | 6 +- lib/libm/kf_tan.c | 8 +- lib/libm/sf_cos.c | 2 +- lib/libm/sf_erf.c | 16 +- lib/libm/sf_frexp.c | 2 +- lib/libm/sf_ldexp.c | 2 +- lib/libm/sf_modf.c | 2 +- lib/libm/sf_sin.c | 2 +- lib/libm/sf_tan.c | 2 +- lib/libm/wf_lgamma.c | 8 +- lib/libm_dbl/__signbit.c | 2 - lib/memzip/README.md | 1 - lib/memzip/lexermemzip.c | 1 - lib/memzip/make-memzip.py | 1 - lib/oofatfs/option/ccsbcs.c | 1 - lib/tinytest/README | 1 - lib/tinytest/tinytest.c | 1 - logo/adafruit_blinka_angles-back.svg | 2 +- logo/adafruit_blinka_angles-front.svg | 2 +- logo/adafruit_blinka_angles-left.svg | 2 +- logo/adafruit_blinka_angles-right.svg | 2 +- logo/adafruit_blinka_computer.svg | 2 +- ...adafruit_circuit_python_ourboros_color.svg | 2 +- ...it_circuit_python_ouroboros_logo_final.svg | 2 +- .../adafruit_circuit_python_sitting_color.svg | 2 +- ...rcuit_python_stacked_lockup_logo_final.svg | 2 +- logo/awesome_circuitpython.svg | 2 +- logo/blinka_colorform-cooking.svg | 2 +- logo/blinka_colorform-first-birthday.svg | 2 +- logo/blinka_colorform-painting.svg | 2 +- logo/blinka_colorform-reading.svg | 2 +- logo/blinka_colorform-singing.svg | 2 +- logo/blinka_colorform-telescope.svg | 2 +- logo/blinka_colorform-test_tubes.svg | 2 +- mpy-cross/mpconfigport.h | 2 +- ports/atmel-samd/boards/8086_commander/pins.c | 2 +- .../boards/aloriumtech_evo_m51/board.c | 2 +- .../boards/capablerobot_usbhub/pins.c | 2 +- .../circuitbrains_basic_m0/mpconfigboard.h | 2 +- .../circuitbrains_basic_m0/mpconfigboard.mk | 1 - ports/atmel-samd/boards/datum_distance/pins.c | 2 +- ports/atmel-samd/boards/datum_imu/pins.c | 2 +- ports/atmel-samd/boards/datum_light/pins.c | 2 +- ports/atmel-samd/boards/datum_weather/pins.c | 2 +- .../boards/escornabot_makech/pins.c | 12 +- .../feather_m4_express/mpconfigboard.mk | 1 - .../mpconfigboard.mk | 1 - .../boards/hallowing_m4_express/pins.c | 2 +- .../atmel-samd/boards/kicksat-sprite/board.c | 2 +- ports/atmel-samd/boards/kicksat-sprite/pins.c | 6 +- .../boards/monster_m4sk/mpconfigboard.h | 3 - .../boards/ndgarage_ndbit6/mpconfigboard.h | 1 - .../boards/ndgarage_ndbit6/mpconfigboard.mk | 1 - .../atmel-samd/boards/ndgarage_ndbit6/pins.c | 2 +- ports/atmel-samd/boards/pycubed/board.c | 2 +- .../atmel-samd/boards/pycubed/mpconfigboard.h | 2 +- ports/atmel-samd/boards/pycubed/pins.c | 8 +- ports/atmel-samd/boards/pycubed_mram/board.c | 2 +- ports/atmel-samd/boards/pygamer/pins.c | 2 +- .../atmel-samd/boards/pygamer_advance/pins.c | 2 +- ports/atmel-samd/boards/robohatmm1_m4/pins.c | 2 +- ports/atmel-samd/boards/sam32/board.c | 2 +- .../atmel-samd/boards/sam32/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/sam32/pins.c | 10 +- ports/atmel-samd/boards/serpente/pins.c | 1 - .../sparkfun_qwiic_micro_no_flash/pins.c | 4 +- .../sparkfun_qwiic_micro_with_flash/pins.c | 4 +- ports/atmel-samd/common-hal/countio/Counter.c | 14 +- .../common-hal/neopixel_write/__init__.c | 1 - .../common-hal/supervisor/__init__.c | 2 +- ports/cxd56/boards/spresense/mpconfigboard.h | 1 - ports/cxd56/common-hal/busio/I2C.c | 2 +- ports/cxd56/common-hal/busio/SPI.c | 2 +- ports/cxd56/common-hal/pulseio/PulseOut.c | 2 +- ports/cxd56/mkspk/.gitignore | 1 - ports/cxd56/supervisor/port.c | 1 - ports/esp32s2/common-hal/supervisor/Runtime.c | 1 - .../esp32s2/common-hal/supervisor/__init__.c | 2 +- ports/esp32s2/supervisor/internal_flash.c | 1 - ports/esp32s2/supervisor/usb.c | 1 - ports/litex/common-hal/supervisor/Runtime.c | 1 - ports/litex/common-hal/supervisor/__init__.c | 2 +- ports/litex/hw/common.h | 2 +- ports/litex/irq.h | 2 +- ports/litex/supervisor/internal_flash.c | 1 - .../boards/imxrt1020_evk/flash_config.c | 2 +- ports/mimxrt10xx/common-hal/busio/SPI.c | 2 +- ports/mimxrt10xx/common-hal/busio/UART.c | 4 +- .../common-hal/microcontroller/Pin.c | 8 +- .../common-hal/supervisor/__init__.c | 2 +- .../mimxrt10xx/MIMXRT1011/periph.c | 2 +- .../mimxrt10xx/MIMXRT1021/periph.c | 2 +- .../mimxrt10xx/MIMXRT1062/periph.c | 4 +- ports/mimxrt10xx/supervisor/internal_flash.c | 1 - ports/mimxrt10xx/supervisor/port.c | 2 +- ports/mimxrt10xx/supervisor/serial.c | 1 - .../s140_nrf52_6.1.0_API/doc/ble_api.dox | 23 +- .../s140_nrf52_6.1.0_API/include/ble.h | 2 +- .../s140_nrf52_6.1.0_API/include/ble_gap.h | 2 +- .../s140_nrf52_7.0.1_API/doc/ble_api.dox | 39 ++- .../s140_nrf52_7.0.1_API/include/ble.h | 12 +- .../boards/electronut_labs_papyr/README.md | 2 +- .../nrf/boards/hiibot_bluefi/mpconfigboard.h | 3 - .../nrf/boards/hiibot_bluefi/mpconfigboard.mk | 1 - .../boards/particle_argon/mpconfigboard.mk | 2 +- .../boards/particle_boron/mpconfigboard.mk | 2 +- .../boards/particle_xenon/mpconfigboard.mk | 2 +- .../boards/sparkfun_nrf52840_mini/README.md | 2 +- .../nrf/common-hal/neopixel_write/__init__.h | 2 +- .../common-hal/rotaryio/IncrementalEncoder.c | 6 +- ports/nrf/common-hal/rtc/RTC.c | 1 - ports/nrf/common-hal/supervisor/Runtime.c | 1 - ports/nrf/common-hal/supervisor/__init__.c | 2 +- ports/nrf/examples/ubluepy_eddystone.py | 4 +- ports/nrf/examples/ubluepy_scan.py | 8 +- ports/nrf/examples/ubluepy_temp.py | 9 +- ports/nrf/gccollect.c | 2 +- ports/stm/.gitignore | 2 +- ports/stm/README.md | 20 +- ports/stm/boards/STM32F401xe_boot.ld | 3 +- ports/stm/boards/STM32F405_boot.ld | 1 - ports/stm/boards/STM32F405_default.ld | 1 - ports/stm/boards/STM32F405_fs.ld | 1 - ports/stm/boards/STM32F407_fs.ld | 1 - ports/stm/boards/STM32F411_fs.ld | 1 - ports/stm/boards/STM32F412_fs.ld | 1 - ports/stm/boards/STM32F746xG_fs.ld | 1 - ports/stm/boards/STM32F767_fs.ld | 1 - ports/stm/boards/STM32H743_fs.ld | 1 - ports/stm/boards/common_default.ld | 3 +- ports/stm/boards/common_nvm.ld | 1 - ports/stm/boards/common_tcm.ld | 2 +- ports/stm/boards/espruino_pico/README.md | 8 +- .../stm/boards/espruino_pico/mpconfigboard.h | 1 - ports/stm/boards/espruino_wifi/README.MD | 8 +- .../stm/boards/espruino_wifi/mpconfigboard.mk | 3 +- .../mpconfigboard.mk | 5 +- .../stm/boards/meowbit_v121/mpconfigboard.mk | 5 +- .../stm/boards/nucleo_f746zg/mpconfigboard.mk | 2 +- .../stm/boards/nucleo_f767zi/mpconfigboard.mk | 3 +- .../boards/nucleo_h743zi_2/mpconfigboard.mk | 3 +- ports/stm/boards/openmv_h7/mpconfigboard.h | 1 - ports/stm/boards/openmv_h7/mpconfigboard.mk | 3 +- ports/stm/boards/openmv_h7/openmv.csv | 2 +- ports/stm/boards/pyb_nano_v2/mpconfigboard.mk | 3 +- ports/stm/boards/pyboard_v11/mpconfigboard.mk | 3 +- .../stm32f411ce_blackpill/mpconfigboard.mk | 3 +- ports/stm/boards/stm32f411ce_blackpill/pins.c | 4 +- .../stm32f411ve_discovery/mpconfigboard.mk | 1 - .../stm32f412zg_discovery/mpconfigboard.mk | 2 - .../boards/stm32f4_discovery/mpconfigboard.mk | 1 - .../stm32f746g_discovery/mpconfigboard.mk | 2 +- ports/stm/boards/system_stm32f4xx.c | 298 +++++++++--------- ports/stm/boards/system_stm32f7xx.c | 60 ++-- ports/stm/boards/system_stm32h7xx.c | 2 +- ports/stm/boards/thunderpack/pins.c | 2 +- ports/stm/common-hal/busio/UART.c | 2 +- ports/stm/common-hal/nvm/ByteArray.c | 2 +- ports/stm/common-hal/os/__init__.c | 2 +- ports/stm/common-hal/supervisor/Runtime.c | 1 - ports/stm/common-hal/supervisor/__init__.c | 2 +- ports/stm/packages/LQFP100_f4.c | 2 +- ports/stm/packages/LQFP100_x7.c | 2 +- ports/stm/packages/LQFP144.c | 4 +- ports/stm/packages/LQFP64.c | 2 +- ports/stm/packages/UFQFPN48.c | 4 +- ports/stm/peripherals/periph.h | 4 +- ports/stm/peripherals/pins.h | 8 +- .../peripherals/stm32f4/stm32f401xe/gpio.c | 1 - .../peripherals/stm32f4/stm32f401xe/periph.h | 2 +- .../peripherals/stm32f4/stm32f401xe/pins.c | 2 +- .../peripherals/stm32f4/stm32f405xx/gpio.c | 4 +- .../peripherals/stm32f4/stm32f405xx/periph.h | 2 +- .../peripherals/stm32f4/stm32f405xx/pins.c | 38 +-- .../peripherals/stm32f4/stm32f405xx/pins.h | 36 +-- .../peripherals/stm32f4/stm32f407xx/gpio.c | 4 +- .../peripherals/stm32f4/stm32f407xx/periph.h | 2 +- .../peripherals/stm32f4/stm32f407xx/pins.c | 38 +-- .../peripherals/stm32f4/stm32f407xx/pins.h | 36 +-- .../peripherals/stm32f4/stm32f411xe/gpio.c | 2 - .../peripherals/stm32f4/stm32f411xe/periph.h | 2 +- .../peripherals/stm32f4/stm32f411xe/pins.c | 2 +- .../peripherals/stm32f4/stm32f412zx/gpio.c | 2 +- .../peripherals/stm32f4/stm32f412zx/periph.h | 2 +- .../peripherals/stm32f4/stm32f412zx/pins.c | 36 +-- .../peripherals/stm32f4/stm32f412zx/pins.h | 36 +-- .../peripherals/stm32f7/stm32f746xx/gpio.c | 1 - .../peripherals/stm32f7/stm32f746xx/pins.c | 2 +- .../peripherals/stm32f7/stm32f767xx/gpio.c | 2 - .../peripherals/stm32f7/stm32f767xx/periph.h | 2 +- .../peripherals/stm32f7/stm32f767xx/pins.c | 2 +- .../peripherals/stm32h7/stm32h743xx/gpio.c | 2 - .../peripherals/stm32h7/stm32h743xx/periph.h | 2 +- .../peripherals/stm32h7/stm32h743xx/pins.c | 2 +- ports/stm/supervisor/internal_flash.c | 1 - ports/stm/supervisor/port.c | 1 - ports/stm/supervisor/serial.c | 1 - ports/stm/tools/examples/nucleo_h743.csv | 2 +- ports/stm/tools/parse_af_csv.py | 8 +- ports/stm/tools/parse_pins_csv.py | 8 +- py/proto.h | 1 - py/stackctrl.c | 4 +- py/stream.h | 2 +- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- shared-bindings/aesio/__init__.c | 1 - shared-bindings/displayio/ColorConverter.c | 1 - shared-bindings/framebufferio/__init__.c | 1 - shared-bindings/nvm/__init__.c | 2 +- shared-bindings/supervisor/__init__.h | 2 +- shared-bindings/ulab/approx/__init__.pyi | 5 +- shared-bindings/vectorio/Circle.c | 1 - shared-bindings/vectorio/Polygon.c | 1 - shared-bindings/wiznet/__init__.c | 1 - shared-module/_bleio/ScanResults.c | 4 +- shared-module/_eve/__init__.c | 1 - shared-module/displayio/ColorConverter.c | 5 +- shared-module/displayio/Display.c | 4 +- shared-module/displayio/TileGrid.c | 2 +- .../framebufferio/FramebufferDisplay.c | 2 +- shared-module/network/__init__.c | 6 +- shared-module/rgbmatrix/RGBMatrix.c | 1 - shared-module/ustack/__init__.c | 1 - shared-module/vectorio/Circle.c | 1 - shared-module/vectorio/Circle.h | 1 - shared-module/vectorio/Polygon.c | 3 +- shared-module/vectorio/Rectangle.c | 1 - shared-module/vectorio/Rectangle.h | 1 - shared-module/vectorio/VectorShape.c | 4 +- shared-module/vectorio/__init__.c | 1 - shared-module/vectorio/__init__.h | 1 - supervisor/shared/bluetooth.h | 2 +- supervisor/shared/tick.c | 1 - supervisor/stub/internal_flash.c | 1 - tests/basics/assign1.py | 1 - tests/basics/builtin_chr.py | 1 - tests/basics/dict_popitem.py | 1 - tests/basics/dict_setdefault.py | 2 - tests/basics/gen_yield_from_throw.py | 2 +- tests/basics/gen_yield_from_throw2.py | 2 +- tests/basics/int_big_and2.py | 4 +- tests/basics/int_big_and3.py | 4 +- tests/basics/int_big_or.py | 8 +- tests/basics/int_big_or2.py | 4 +- tests/basics/int_big_or3.py | 4 +- tests/basics/int_big_xor.py | 8 +- tests/basics/int_big_xor2.py | 4 +- tests/basics/int_big_xor3.py | 4 +- tests/basics/set_iter.py | 1 - tests/basics/string_cr_conversion.py | 2 +- tests/basics/subscr_tuple.py | 1 - tests/extmod/uctypes_array_assign_le.py | 1 - tests/extmod/uctypes_byteat.py | 4 +- tests/extmod/uctypes_error.py | 10 +- tests/extmod/ujson_dump_iobase.py | 2 +- tests/extmod/ure_sub.py | 6 +- tests/feature_check/complex.py | 1 - tests/float/builtin_float_minmax.py | 1 - tests/float/float_struct.py | 1 - tests/float/math_fun_bool.py | 2 +- tests/inlineasm/asmfpaddsub.py | 1 - tests/inlineasm/asmfpldrstr.py | 1 - tests/inlineasm/asmfpmuldiv.py | 1 - tests/inlineasm/asmfpsqrt.py | 1 - tests/inlineasm/asmspecialregs.py | 1 - tests/jni/README | 1 - tests/misc/features.py | 6 +- tests/thread/mutate_bytearray.py | 1 - tests/wipy/i2c.py | 1 - tests/wipy/pin.py | 7 +- tests/wipy/sd.py | 1 - tests/wipy/uart.py | 6 +- tests/wipy/wlan/wlan.py | 1 - tools/codestats.sh | 2 +- 294 files changed, 1101 insertions(+), 1227 deletions(-) diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index da4dad1790..79a6c68a75 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -18,7 +18,7 @@ jobs: python-version: 3.8 - name: Install deps run: | - pip install requests sh click + pip install requests sh click - name: Versions run: | gcc --version diff --git a/BUILDING.md b/BUILDING.md index 73499d65d5..bc60026785 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,7 +1,7 @@ # Building CircuitPython -Welcome to CircuitPython! +Welcome to CircuitPython! This document is a quick-start guide only. @@ -28,7 +28,7 @@ This project has a bunch of git submodules. You will need to update them regula As part of the build process, mpy-cross is needed to compile .py files into .mpy files. To compile (or recompile) mpy-cross: - make -C mpy-cross + make -C mpy-cross # Building @@ -68,7 +68,7 @@ A successful run will say something like # Debugging -The easiest way to debug CircuitPython on hardware is with a JLink device, JLinkGDBServer, and an appropriate GDB. +The easiest way to debug CircuitPython on hardware is with a JLink device, JLinkGDBServer, and an appropriate GDB. Instructions can be found at https://learn.adafruit.com/debugging-the-samd21-with-gdb If using JLink, you'll need both the `JLinkGDBServer` and `arm-none-eabi-gdb` running. diff --git a/docs/README.md b/docs/README.md index b01ae9d491..e98b46f67b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -34,10 +34,10 @@ All commands will, by default, run with `-E` (forces a rebuild from scratch of d # will turn OFF the force rebuild make html FORCE= - + # will turn OFF the verbosity make html VERBOSE= - + # will turn OFF the force rebuild and make it doubly verbose when running make html FORCE= VERBOSE="-v -v" diff --git a/drivers/wiznet5k/ethernet/socket.c b/drivers/wiznet5k/ethernet/socket.c index bea98601de..7a114aa1bc 100644 --- a/drivers/wiznet5k/ethernet/socket.c +++ b/drivers/wiznet5k/ethernet/socket.c @@ -2,7 +2,7 @@ // //! \file socket.c //! \brief SOCKET APIs Implements file. -//! \details SOCKET APIs like as Berkeley Socket APIs. +//! \details SOCKET APIs like as Berkeley Socket APIs. //! \version 1.0.3 //! \date 2013/10/21 //! \par Revision history @@ -10,7 +10,7 @@ //! <2014/05/01> V1.0.3. Refer to M20140501 //! 1. Implicit type casting -> Explicit type casting. //! 2. replace 0x01 with PACK_REMAINED in recvfrom() -//! 3. Validation a destination ip in connect() & sendto(): +//! 3. Validation a destination ip in connect() & sendto(): //! It occurs a fatal error on converting unint32 address if uint8* addr parameter is not aligned by 4byte address. //! Copy 4 byte addr value into temporary uint32 variable and then compares it. //! <2013/12/20> V1.0.2 Refer to M20131220 @@ -23,30 +23,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -123,7 +123,7 @@ int8_t WIZCHIP_EXPORT(socket)(uint8_t sn, uint8_t protocol, uint16_t port, uint8 #if _WIZCHIP_ == 5200 if(flag & 0x10) return SOCKERR_SOCKFLAG; #endif - + if(flag != 0) { switch(protocol) @@ -154,7 +154,7 @@ int8_t WIZCHIP_EXPORT(socket)(uint8_t sn, uint8_t protocol, uint16_t port, uint8 port = sock_any_port++; if(sock_any_port == 0xFFF0) sock_any_port = SOCK_ANY_PORT_NUM; } - setSn_PORT(sn,port); + setSn_PORT(sn,port); setSn_CR(sn,Sn_CR_OPEN); while(getSn_CR(sn)); sock_io_mode |= ((flag & SF_IO_NONBLOCK) << sn); @@ -163,12 +163,12 @@ int8_t WIZCHIP_EXPORT(socket)(uint8_t sn, uint8_t protocol, uint16_t port, uint8 sock_pack_info[sn] = 0; while(getSn_SR(sn) == SOCK_CLOSED); return (int8_t)sn; -} +} int8_t WIZCHIP_EXPORT(close)(uint8_t sn) { CHECK_SOCKNUM(); - + setSn_CR(sn,Sn_CR_CLOSE); /* wait to process the command... */ while( getSn_CR(sn) ); @@ -216,18 +216,18 @@ int8_t WIZCHIP_EXPORT(connect)(uint8_t sn, uint8_t * addr, uint16_t port) if (taddr == 0xFFFFFFFF || taddr == 0) return SOCKERR_IPINVALID; } // - + if(port == 0) return SOCKERR_PORTZERO; setSn_DIPR(sn,addr); setSn_DPORT(sn,port); - #if _WIZCHIP_ == 5200 // for W5200 ARP errata + #if _WIZCHIP_ == 5200 // for W5200 ARP errata setSUBR(wizchip_getsubn()); #endif setSn_CR(sn,Sn_CR_CONNECT); while(getSn_CR(sn)); if(sock_io_mode & (1< freesize) len = freesize; // check size not to exceed MAX size. while(1) @@ -413,7 +413,7 @@ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t }; wiz_send_data(sn, buf, len); - #if _WIZCHIP_ == 5200 // for W5200 ARP errata + #if _WIZCHIP_ == 5200 // for W5200 ARP errata setSUBR(wizchip_getsubn()); #endif @@ -433,7 +433,7 @@ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t else if(tmp & Sn_IR_TIMEOUT) { setSn_IR(sn, Sn_IR_TIMEOUT); - #if _WIZCHIP_ == 5200 // for W5200 ARP errata + #if _WIZCHIP_ == 5200 // for W5200 ARP errata setSUBR((uint8_t*)"\x00\x00\x00\x00"); #endif return SOCKERR_TIMEOUT; @@ -441,7 +441,7 @@ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t //////////// MICROPY_THREAD_YIELD(); } - #if _WIZCHIP_ == 5200 // for W5200 ARP errata + #if _WIZCHIP_ == 5200 // for W5200 ARP errata setSUBR((uint8_t*)"\x00\x00\x00\x00"); #endif return len; @@ -462,7 +462,7 @@ int32_t WIZCHIP_EXPORT(recvfrom)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_ case Sn_MR_UDP: case Sn_MR_MACRAW: break; - #if ( _WIZCHIP_ < 5200 ) + #if ( _WIZCHIP_ < 5200 ) case Sn_MR_IPRAW: case Sn_MR_PPPoE: break; @@ -519,7 +519,7 @@ int32_t WIZCHIP_EXPORT(recvfrom)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_ sock_remained_size[sn] = head[0]; sock_remained_size[sn] = (sock_remained_size[sn] <<8) + head[1]; sock_remained_size[sn] -= 2; // len includes 2 len bytes - if(sock_remained_size[sn] > 1514) + if(sock_remained_size[sn] > 1514) { WIZCHIP_EXPORT(close)(sn); return SOCKFATAL_PACKLEN; @@ -582,7 +582,7 @@ int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg) else if(tmp == SOCK_IO_BLOCK) sock_io_mode &= ~(1< explict type casting //*((uint8_t*)arg) = (sock_io_mode >> sn) & 0x0001; *((uint8_t*)arg) = (uint8_t)((sock_io_mode >> sn) & 0x0001); @@ -591,7 +591,7 @@ int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg) case CS_GET_MAXTXBUF: *((uint16_t*)arg) = getSn_TxMAX(sn); break; - case CS_GET_MAXRXBUF: + case CS_GET_MAXRXBUF: *((uint16_t*)arg) = getSn_RxMAX(sn); break; case CS_CLR_INTERRUPT: @@ -601,11 +601,11 @@ int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg) case CS_GET_INTERRUPT: *((uint8_t*)arg) = getSn_IR(sn); break; - case CS_SET_INTMASK: + case CS_SET_INTMASK: if( (*(uint8_t*)arg) > SIK_ALL) return SOCKERR_ARG; setSn_IMR(sn,*(uint8_t*)arg); break; - case CS_GET_INTMASK: + case CS_GET_INTMASK: *((uint8_t*)arg) = getSn_IMR(sn); default: return SOCKERR_ARG; @@ -658,11 +658,11 @@ int8_t WIZCHIP_EXPORT(setsockopt)(uint8_t sn, sockopt_type sotype, void* arg) CHECK_SOCKMODE(Sn_MR_TCP); setSn_KPALVTR(sn,*(uint8_t*)arg); break; - #endif -#endif + #endif +#endif default: return SOCKERR_ARG; - } + } return SOCK_OK; } @@ -680,20 +680,20 @@ int8_t WIZCHIP_EXPORT(getsockopt)(uint8_t sn, sockopt_type sotype, void* arg) case SO_TOS: *(uint8_t*) arg = getSn_TOS(sn); break; - case SO_MSS: + case SO_MSS: *(uint8_t*) arg = getSn_MSSR(sn); case SO_DESTIP: getSn_DIPR(sn, (uint8_t*)arg); break; - case SO_DESTPORT: + case SO_DESTPORT: *(uint16_t*) arg = getSn_DPORT(sn); break; - #if _WIZCHIP_ > 5200 + #if _WIZCHIP_ > 5200 case SO_KEEPALIVEAUTO: CHECK_SOCKMODE(Sn_MR_TCP); *(uint16_t*) arg = getSn_KPALVTR(sn); break; - #endif + #endif case SO_SENDBUF: *(uint16_t*) arg = getSn_TX_FSR(sn); case SO_RECVBUF: diff --git a/drivers/wiznet5k/ethernet/socket.h b/drivers/wiznet5k/ethernet/socket.h index 2f03a34eba..4f602e429c 100644 --- a/drivers/wiznet5k/ethernet/socket.h +++ b/drivers/wiznet5k/ethernet/socket.h @@ -2,43 +2,43 @@ // //! \file socket.h //! \brief SOCKET APIs Header file. -//! \details SOCKET APIs like as berkeley socket api. +//! \details SOCKET APIs like as berkeley socket api. //! \version 1.0.2 //! \date 2013/10/21 //! \par Revision history //! <2014/05/01> V1.0.2. Refer to M20140501 //! 1. Modify the comment : SO_REMAINED -> PACK_REMAINED -//! 2. Add the comment as zero byte udp data reception in getsockopt(). +//! 2. Add the comment as zero byte udp data reception in getsockopt(). //! <2013/10/21> 1st Release //! \author MidnightCow //! \copyright //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -92,7 +92,7 @@ #define SOCK_BUSY 0 ///< Socket is busy on processing the operation. Valid only Non-block IO Mode. #define SOCK_FATAL -1000 ///< Result is fatal error about socket process. -#define SOCK_ERROR 0 +#define SOCK_ERROR 0 #define SOCKERR_SOCKNUM (SOCK_ERROR - 1) ///< Invalid socket number #define SOCKERR_SOCKOPT (SOCK_ERROR - 2) ///< Invalid socket option #define SOCKERR_SOCKINIT (SOCK_ERROR - 3) ///< Socket is not initialized @@ -113,7 +113,7 @@ * SOCKET FLAG */ #define SF_ETHER_OWN (Sn_MR_MFEN) ///< In \ref Sn_MR_MACRAW, Receive only the packet as broadcast, multicast and own packet -#define SF_IGMP_VER2 (Sn_MR_MC) ///< In \ref Sn_MR_UDP with \ref SF_MULTI_ENABLE, Select IGMP version 2. +#define SF_IGMP_VER2 (Sn_MR_MC) ///< In \ref Sn_MR_UDP with \ref SF_MULTI_ENABLE, Select IGMP version 2. #define SF_TCP_NODELAY (Sn_MR_ND) ///< In \ref Sn_MR_TCP, Use to nodelayed ack. #define SF_MULTI_ENABLE (Sn_MR_MULTI) ///< In \ref Sn_MR_UDP, Enable multicast mode. @@ -184,7 +184,7 @@ int8_t WIZCHIP_EXPORT(listen)(uint8_t sn); * @ingroup WIZnet_socket_APIs * @brief Try to connect a server. * @details It requests connection to the server with destination IP address and port number passed as parameter.\n - * @note It is valid only in TCP client mode. + * @note It is valid only in TCP client mode. * In block io mode, it does not return until connection is completed. * In Non-block io mode, it return @ref SOCK_BUSY immediately. * @@ -286,7 +286,7 @@ int32_t WIZCHIP_EXPORT(recv)(uint8_t sn, uint8_t * buf, uint16_t len); * @ref SOCKERR_PORTZERO - Server port zero\n * @ref SOCKERR_SOCKCLOSED - Socket unexpectedly closed \n * @ref SOCKERR_TIMEOUT - Timeout occurred \n - * @ref SOCK_BUSY - Socket is busy. + * @ref SOCK_BUSY - Socket is busy. */ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port); @@ -294,7 +294,7 @@ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * @ingroup WIZnet_socket_APIs * @brief Receive datagram of UDP or MACRAW * @details This function is an application I/F function which is used to receive the data in other then TCP mode. \n - * This function is used to receive UDP and MAC_RAW mode, and handle the header as well. + * This function is used to receive UDP and MAC_RAW mode, and handle the header as well. * This function can divide to received the packet data. * On the MACRAW SOCKET, the addr and port parameters are ignored. * @note In block io mode, it doesn't return until data reception is completed - data is filled as len in socket buffer @@ -302,7 +302,7 @@ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * * @param sn Socket number. It should be 0 ~ @ref \_WIZCHIP_SOCK_NUM_. * @param buf Pointer buffer to read incoming data. - * @param len The max data length of data in buf. + * @param len The max data length of data in buf. * When the received packet size <= len, receives data as packet sized. * When others, receives data as len. * @param addr Pointer variable of destination IP address. It should be allocated 4 bytes. @@ -366,7 +366,7 @@ typedef enum /** * @ingroup DATA_TYPE * @brief The type of socket option in @ref setsockopt() or @ref getsockopt() - */ + */ typedef enum { SO_FLAG, ///< Valid only in getsockopt(), For set flag of socket refer to flag in @ref socket(). @@ -375,11 +375,11 @@ typedef enum SO_MSS, ///< Set/Get MSS. @ref Sn_MSSR ( @ref setSn_MSSR(), @ref getSn_MSSR() ) SO_DESTIP, ///< Set/Get the destination IP address. @ref Sn_DIPR ( @ref setSn_DIPR(), @ref getSn_DIPR() ) SO_DESTPORT, ///< Set/Get the destination Port number. @ref Sn_DPORT ( @ref setSn_DPORT(), @ref getSn_DPORT() ) -#if _WIZCHIP_ != 5100 +#if _WIZCHIP_ != 5100 SO_KEEPALIVESEND, ///< Valid only in setsockopt. Manually send keep-alive packet in TCP mode - #if _WIZCHIP_ > 5200 + #if _WIZCHIP_ > 5200 SO_KEEPALIVEAUTO, ///< Set/Get keep-alive auto transmission timer in TCP mode - #endif + #endif #endif SO_SENDBUF, ///< Valid only in getsockopt. Get the free data size of Socekt TX buffer. @ref Sn_TX_FSR, @ref getSn_TX_FSR() SO_RECVBUF, ///< Valid only in getsockopt. Get the received data size in socket RX buffer. @ref Sn_RX_RSR, @ref getSn_RX_RSR() @@ -400,34 +400,34 @@ typedef enum * @b cstype @b data type@b value * @ref CS_SET_IOMODE \n @ref CS_GET_IOMODE uint8_t @ref SOCK_IO_BLOCK @ref SOCK_IO_NONBLOCK * @ref CS_GET_MAXTXBUF \n @ref CS_GET_MAXRXBUF uint16_t 0 ~ 16K - * @ref CS_CLR_INTERRUPT \n @ref CS_GET_INTERRUPT \n @ref CS_SET_INTMASK \n @ref CS_GET_INTMASK @ref sockint_kind @ref SIK_CONNECTED, etc. + * @ref CS_CLR_INTERRUPT \n @ref CS_GET_INTERRUPT \n @ref CS_SET_INTMASK \n @ref CS_GET_INTMASK @ref sockint_kind @ref SIK_CONNECTED, etc. * * @return @b Success @ref SOCK_OK \n * @b fail @ref SOCKERR_ARG - Invalid argument\n */ int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg); -/** +/** * @ingroup WIZnet_socket_APIs * @brief set socket options * @details Set socket option like as TTL, MSS, TOS, and so on. Refer to @ref sockopt_type. - * + * * @param sn socket number * @param sotype socket option type. refer to @ref sockopt_type * @param arg Data type and value is determined according to sotype. \n * - * + * * * * - * - * - * - * + * + * + * + * *
@b sotype @b data type@b value
@b sotype @b data type@b value
@ref SO_TTL uint8_t 0 ~ 255
@ref SO_TOS uint8_t 0 ~ 255
@ref SO_MSS uint16_t 0 ~ 65535
@ref SO_DESTIP uint8_t[4]
@ref SO_DESTPORT uint16_t 0 ~ 65535
@ref SO_KEEPALIVESEND null null
@ref SO_KEEPALIVEAUTO uint8_t 0 ~ 255
@ref SO_DESTIP uint8_t[4]
@ref SO_DESTPORT uint16_t 0 ~ 65535
@ref SO_KEEPALIVESEND null null
@ref SO_KEEPALIVEAUTO uint8_t 0 ~ 255
- * @return + * @return * - @b Success : @ref SOCK_OK \n - * - @b Fail + * - @b Fail * - @ref SOCKERR_SOCKNUM - Invalid Socket number \n * - @ref SOCKERR_SOCKMODE - Invalid socket mode \n * - @ref SOCKERR_SOCKOPT - Invalid socket option or its value \n @@ -435,7 +435,7 @@ int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg); */ int8_t WIZCHIP_EXPORT(setsockopt)(uint8_t sn, sockopt_type sotype, void* arg); -/** +/** * @ingroup WIZnet_socket_APIs * @brief get socket options * @details Get socket option like as FLAG, TTL, MSS, and so on. Refer to @ref sockopt_type @@ -447,24 +447,24 @@ int8_t WIZCHIP_EXPORT(setsockopt)(uint8_t sn, sockopt_type sotype, void* arg); * @ref SO_FLAG uint8_t @ref SF_ETHER_OWN, etc... * @ref SO_TOS uint8_t 0 ~ 255 * @ref SO_MSS uint16_t 0 ~ 65535 - * @ref SO_DESTIP uint8_t[4] - * @ref SO_DESTPORT uint16_t - * @ref SO_KEEPALIVEAUTO uint8_t 0 ~ 255 - * @ref SO_SENDBUF uint16_t 0 ~ 65535 - * @ref SO_RECVBUF uint16_t 0 ~ 65535 - * @ref SO_STATUS uint8_t @ref SOCK_ESTABLISHED, etc.. + * @ref SO_DESTIP uint8_t[4] + * @ref SO_DESTPORT uint16_t + * @ref SO_KEEPALIVEAUTO uint8_t 0 ~ 255 + * @ref SO_SENDBUF uint16_t 0 ~ 65535 + * @ref SO_RECVBUF uint16_t 0 ~ 65535 + * @ref SO_STATUS uint8_t @ref SOCK_ESTABLISHED, etc.. * @ref SO_REMAINSIZE uint16_t 0~ 65535 * @ref SO_PACKINFO uint8_t @ref PACK_FIRST, etc... * - * @return + * @return * - @b Success : @ref SOCK_OK \n - * - @b Fail + * - @b Fail * - @ref SOCKERR_SOCKNUM - Invalid Socket number \n * - @ref SOCKERR_SOCKOPT - Invalid socket option or its value \n * - @ref SOCKERR_SOCKMODE - Invalid socket mode \n * @note * The option as PACK_REMAINED and SO_PACKINFO is valid only in NON-TCP mode and after call @ref recvfrom(). \n - * When SO_PACKINFO value is PACK_FIRST and the return value of recvfrom() is zero, + * When SO_PACKINFO value is PACK_FIRST and the return value of recvfrom() is zero, * This means the zero byte UDP data(UDP Header only) received. */ int8_t WIZCHIP_EXPORT(getsockopt)(uint8_t sn, sockopt_type sotype, void* arg); diff --git a/drivers/wiznet5k/ethernet/w5200/w5200.c b/drivers/wiznet5k/ethernet/w5200/w5200.c index 8c3780792e..cbcb136091 100644 --- a/drivers/wiznet5k/ethernet/w5200/w5200.c +++ b/drivers/wiznet5k/ethernet/w5200/w5200.c @@ -22,30 +22,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** diff --git a/drivers/wiznet5k/ethernet/w5200/w5200.h b/drivers/wiznet5k/ethernet/w5200/w5200.h index 63561940f8..988c8827fc 100644 --- a/drivers/wiznet5k/ethernet/w5200/w5200.h +++ b/drivers/wiznet5k/ethernet/w5200/w5200.h @@ -13,30 +13,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -66,8 +66,8 @@ * - @ref WIZCHIP_register : @ref Common_register_group and @ref Socket_register_group * - @ref WIZCHIP_IO_Functions : @ref Basic_IO_function, @ref Common_register_access_function and @ref Socket_register_access_function */ - - + + /** * @defgroup WIZCHIP_register WIZCHIP register * @ingroup W5500 @@ -138,9 +138,9 @@ * @sa UIPR, UPORTR : ICMP message. * @sa PHYCFGR, VERSIONR : etc. */ - - - + + + /** * @defgroup Socket_register_group Socket register * @ingroup WIZCHIP_register @@ -153,9 +153,9 @@ * @sa Sn_MSSR, Sn_TOS, Sn_TTL, Sn_KPALVTR, Sn_FRAG : Internet protocol. * @sa Sn_RXBUF_SIZE, Sn_TXBUF_SIZE, Sn_TX_FSR, Sn_TX_RD, Sn_TX_WR, Sn_RX_RSR, Sn_RX_RD, Sn_RX_WR : Data communication */ - - - + + + /** * @defgroup Basic_IO_function Basic I/O function * @ingroup WIZCHIP_IO_Functions @@ -173,7 +173,7 @@ * @ingroup WIZCHIP_IO_Functions * @brief These are functions to access socket registers. */ - + //------------------------------- defgroup end -------------------------------------------- //----------------------------- W5500 Common Registers IOMAP ----------------------------- /** @@ -276,7 +276,7 @@ * @brief Socket Interrupt Mask Register(R/W) * @details Each bit of @ref SIMR corresponds to each bit of @ref SIR. * When a bit of @ref SIMR is and the corresponding bit of @ref SIR is Interrupt will be issued. - * In other words, if a bit of @ref SIMR is an interrupt will be not issued even if the corresponding bit of @ref SIR is + * In other words, if a bit of @ref SIMR is an interrupt will be not issued even if the corresponding bit of @ref SIR is */ //#define SIMR (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_CREG_BLOCK << 3)) @@ -531,7 +531,7 @@ */ #define Sn_TTL(N) WIZCHIP_SREG_ADDR(N, 0x0016) // Reserved (_W5500_IO_BASE_ + (0x0017 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) -// Reserved (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) +// Reserved (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x0019 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x001A << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x001B << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) @@ -633,8 +633,8 @@ * @ingroup Socket_register_group * @brief socket interrupt mask register(R) * @details @ref Sn_IMR masks the interrupt of Socket n. - * Each bit corresponds to each bit of @ref Sn_IR. When a Socket n Interrupt is occurred and the corresponding bit of @ref Sn_IMR is - * the corresponding bit of @ref Sn_IR becomes When both the corresponding bit of @ref Sn_IMR and @ref Sn_IR are and the n-th bit of @ref IR is + * Each bit corresponds to each bit of @ref Sn_IR. When a Socket n Interrupt is occurred and the corresponding bit of @ref Sn_IMR is + * the corresponding bit of @ref Sn_IR becomes When both the corresponding bit of @ref Sn_IMR and @ref Sn_IR are and the n-th bit of @ref IR is * Host is interrupted by asserted INTn PIN to low. */ //#define Sn_IMR(N) (_W5500_IO_BASE_ + (0x002C << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) @@ -694,7 +694,7 @@ * @brief Enable PPPoE * @details 0 : DisablePPPoE mode\n * 1 : EnablePPPoE mode\n - * If you use ADSL, this bit should be + * If you use ADSL, this bit should be */ #define MR_PPPOE 0x08 @@ -715,7 +715,7 @@ /** * @brief Get the destination unreachable message in UDP sending. - * @details When receiving the ICMP (Destination port unreachable) packet, this bit is set as + * @details When receiving the ICMP (Destination port unreachable) packet, this bit is set as * When this bit is Destination Information such as IP address and Port number may be checked with the corresponding @ref UIPR & @ref UPORTR. */ #define IR_UNREACH 0x40 @@ -743,7 +743,7 @@ #define PHYCFGR_OPMDC_100F (3<<3) #define PHYCFGR_OPMDC_100H (2<<3) #define PHYCFGR_OPMDC_10F (1<<3) -#define PHYCFGR_OPMDC_10H (0<<3) +#define PHYCFGR_OPMDC_10H (0<<3) #define PHYCFGR_DPX_FULL (1<<2) #define PHYCFGR_DPX_HALF (0<<2) #define PHYCFGR_SPD_100 (1<<1) @@ -818,7 +818,7 @@ * @brief Unicast Block in UDP Multicasting * @details 0 : disable Unicast Blocking\n * 1 : enable Unicast Blocking\n - * This bit blocks receiving the unicast packet during UDP mode(P[3:0] = 010 and MULTI = + * This bit blocks receiving the unicast packet during UDP mode(P[3:0] = 010 and MULTI = */ //#define Sn_MR_UCASTB 0x10 @@ -866,7 +866,7 @@ * @brief Multicast Blocking in @ref Sn_MR_MACRAW mode * @details 0 : using IGMP version 2\n * 1 : using IGMP version 1\n - * This bit is applied only during UDP mode(P[3:0] = 010 and MULTI = + * This bit is applied only during UDP mode(P[3:0] = 010 and MULTI = * It configures the version for IGMP messages (Join/Leave/Report). */ #define Sn_MR_MMB Sn_MR_ND @@ -921,7 +921,7 @@ * In this mode, Socket n operates as a �TCP serverand waits for connection-request (SYN packet) from any �TCP client * The @ref Sn_SR changes the state from SOCK_INIT to SOCKET_LISTEN. * When a �TCP clientconnection request is successfully established, - * the @ref Sn_SR changes from SOCK_LISTEN to SOCK_ESTABLISHED and the Sn_IR(0) becomes + * the @ref Sn_SR changes from SOCK_LISTEN to SOCK_ESTABLISHED and the Sn_IR(0) becomes * But when a �TCP clientconnection request is failed, Sn_IR(3) becomes and the status of @ref Sn_SR changes to SOCK_CLOSED. */ #define Sn_CR_LISTEN 0x02 @@ -1132,7 +1132,7 @@ //#define SOCK_PPPOE 0x5F /* IP PROTOCOL */ -#define IPPROTO_IP 0 //< Dummy for IP +#define IPPROTO_IP 0 //< Dummy for IP #define IPPROTO_ICMP 1 //< Control message protocol #define IPPROTO_IGMP 2 //< Internet group management protocol #define IPPROTO_GGP 3 //< Gateway^2 (deprecated) @@ -2027,7 +2027,7 @@ uint16_t getSn_RX_RSR(uint8_t sn); ///////////////////////////////////// // Sn_TXBUF & Sn_RXBUF IO function // ///////////////////////////////////// -/** +/** * @brief Gets the max buffer size of socket sn passed as parameter. * @param (uint8_t)sn Socket number. It should be 0 ~ 7. * @return uint16_t. Value of Socket n RX max buffer size. @@ -2035,7 +2035,7 @@ uint16_t getSn_RX_RSR(uint8_t sn); #define getSn_RxMAX(sn) \ (getSn_RXBUF_SIZE(sn) << 10) -/** +/** * @brief Gets the max buffer size of socket sn passed as parameters. * @param (uint8_t)sn Socket number. It should be 0 ~ 7. * @return uint16_t. Value of Socket n TX max buffer size. diff --git a/drivers/wiznet5k/ethernet/w5500/w5500.c b/drivers/wiznet5k/ethernet/w5500/w5500.c index 3107b1b71a..fef08e2e3e 100644 --- a/drivers/wiznet5k/ethernet/w5500/w5500.c +++ b/drivers/wiznet5k/ethernet/w5500/w5500.c @@ -20,30 +20,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -114,7 +114,7 @@ void WIZCHIP_WRITE(uint32_t AddrSel, uint8_t wb ) WIZCHIP.CS._deselect(); WIZCHIP_CRITICAL_EXIT(); } - + void WIZCHIP_READ_BUF (uint32_t AddrSel, uint8_t* pBuf, uint16_t len) { uint8_t spi_data[3]; @@ -213,7 +213,7 @@ void wiz_send_data(uint8_t sn, uint8_t *wizdata, uint16_t len) addrsel = ((uint32_t)ptr << 8) + (WIZCHIP_TXBUF_BLOCK(sn) << 3); // WIZCHIP_WRITE_BUF(addrsel,wizdata, len); - + ptr += len; setSn_TX_WR(sn,ptr); } @@ -222,7 +222,7 @@ void wiz_recv_data(uint8_t sn, uint8_t *wizdata, uint16_t len) { uint16_t ptr = 0; uint32_t addrsel = 0; - + if(len == 0) return; ptr = getSn_RX_RD(sn); //M20140501 : implict type casting -> explict type casting @@ -231,7 +231,7 @@ void wiz_recv_data(uint8_t sn, uint8_t *wizdata, uint16_t len) // WIZCHIP_READ_BUF(addrsel, wizdata, len); ptr += len; - + setSn_RX_RD(sn,ptr); } @@ -244,4 +244,3 @@ void wiz_recv_ignore(uint8_t sn, uint16_t len) ptr += len; setSn_RX_RD(sn,ptr); } - diff --git a/drivers/wiznet5k/ethernet/w5500/w5500.h b/drivers/wiznet5k/ethernet/w5500/w5500.h index c2afb180eb..f94eed3aff 100644 --- a/drivers/wiznet5k/ethernet/w5500/w5500.h +++ b/drivers/wiznet5k/ethernet/w5500/w5500.h @@ -11,30 +11,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -76,8 +76,8 @@ * - @ref WIZCHIP_register : @ref Common_register_group and @ref Socket_register_group * - @ref WIZCHIP_IO_Functions : @ref Basic_IO_function, @ref Common_register_access_function and @ref Socket_register_access_function */ - - + + /** * @defgroup WIZCHIP_register WIZCHIP register * @ingroup W5500 @@ -148,9 +148,9 @@ * @sa UIPR, UPORTR : ICMP message. * @sa PHYCFGR, VERSIONR : etc. */ - - - + + + /** * @defgroup Socket_register_group Socket register * @ingroup WIZCHIP_register @@ -163,9 +163,9 @@ * @sa Sn_MSSR, Sn_TOS, Sn_TTL, Sn_KPALVTR, Sn_FRAG : Internet protocol. * @sa Sn_RXBUF_SIZE, Sn_TXBUF_SIZE, Sn_TX_FSR, Sn_TX_RD, Sn_TX_WR, Sn_RX_RSR, Sn_RX_RD, Sn_RX_WR : Data communication */ - - - + + + /** * @defgroup Basic_IO_function Basic I/O function * @ingroup WIZCHIP_IO_Functions @@ -183,7 +183,7 @@ * @ingroup WIZCHIP_IO_Functions * @brief These are functions to access socket registers. */ - + //------------------------------- defgroup end -------------------------------------------- //----------------------------- W5500 Common Registers IOMAP ----------------------------- /** @@ -286,7 +286,7 @@ * @brief Socket Interrupt Mask Register(R/W) * @details Each bit of @ref SIMR corresponds to each bit of @ref SIR. * When a bit of @ref SIMR is and the corresponding bit of @ref SIR is Interrupt will be issued. - * In other words, if a bit of @ref SIMR is an interrupt will be not issued even if the corresponding bit of @ref SIR is + * In other words, if a bit of @ref SIMR is an interrupt will be not issued even if the corresponding bit of @ref SIR is */ #define SIMR (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_CREG_BLOCK << 3)) @@ -540,7 +540,7 @@ */ #define Sn_TTL(N) (_W5500_IO_BASE_ + (0x0016 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x0017 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) -// Reserved (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) +// Reserved (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x0019 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x001A << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x001B << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) @@ -642,8 +642,8 @@ * @ingroup Socket_register_group * @brief socket interrupt mask register(R) * @details @ref Sn_IMR masks the interrupt of Socket n. - * Each bit corresponds to each bit of @ref Sn_IR. When a Socket n Interrupt is occurred and the corresponding bit of @ref Sn_IMR is - * the corresponding bit of @ref Sn_IR becomes When both the corresponding bit of @ref Sn_IMR and @ref Sn_IR are and the n-th bit of @ref IR is + * Each bit corresponds to each bit of @ref Sn_IR. When a Socket n Interrupt is occurred and the corresponding bit of @ref Sn_IMR is + * the corresponding bit of @ref Sn_IR becomes When both the corresponding bit of @ref Sn_IMR and @ref Sn_IR are and the n-th bit of @ref IR is * Host is interrupted by asserted INTn PIN to low. */ #define Sn_IMR(N) (_W5500_IO_BASE_ + (0x002C << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) @@ -703,7 +703,7 @@ * @brief Enable PPPoE * @details 0 : DisablePPPoE mode\n * 1 : EnablePPPoE mode\n - * If you use ADSL, this bit should be + * If you use ADSL, this bit should be */ #define MR_PPPOE 0x08 @@ -724,7 +724,7 @@ /** * @brief Get the destination unreachable message in UDP sending. - * @details When receiving the ICMP (Destination port unreachable) packet, this bit is set as + * @details When receiving the ICMP (Destination port unreachable) packet, this bit is set as * When this bit is Destination Information such as IP address and Port number may be checked with the corresponding @ref UIPR & @ref UPORTR. */ #define IR_UNREACH 0x40 @@ -752,7 +752,7 @@ #define PHYCFGR_OPMDC_100F (3<<3) #define PHYCFGR_OPMDC_100H (2<<3) #define PHYCFGR_OPMDC_10F (1<<3) -#define PHYCFGR_OPMDC_10H (0<<3) +#define PHYCFGR_OPMDC_10H (0<<3) #define PHYCFGR_DPX_FULL (1<<2) #define PHYCFGR_DPX_HALF (0<<2) #define PHYCFGR_SPD_100 (1<<1) @@ -823,7 +823,7 @@ * @brief Unicast Block in UDP Multicasting * @details 0 : disable Unicast Blocking\n * 1 : enable Unicast Blocking\n - * This bit blocks receiving the unicast packet during UDP mode(P[3:0] = 010 and MULTI = + * This bit blocks receiving the unicast packet during UDP mode(P[3:0] = 010 and MULTI = */ #define Sn_MR_UCASTB 0x10 @@ -871,7 +871,7 @@ * @brief Multicast Blocking in @ref Sn_MR_MACRAW mode * @details 0 : using IGMP version 2\n * 1 : using IGMP version 1\n - * This bit is applied only during UDP mode(P[3:0] = 010 and MULTI = + * This bit is applied only during UDP mode(P[3:0] = 010 and MULTI = * It configures the version for IGMP messages (Join/Leave/Report). */ #define Sn_MR_MMB Sn_MR_ND @@ -926,7 +926,7 @@ * In this mode, Socket n operates as a �TCP serverand waits for connection-request (SYN packet) from any �TCP client * The @ref Sn_SR changes the state from SOCK_INIT to SOCKET_LISTEN. * When a �TCP clientconnection request is successfully established, - * the @ref Sn_SR changes from SOCK_LISTEN to SOCK_ESTABLISHED and the Sn_IR(0) becomes + * the @ref Sn_SR changes from SOCK_LISTEN to SOCK_ESTABLISHED and the Sn_IR(0) becomes * But when a �TCP clientconnection request is failed, Sn_IR(3) becomes and the status of @ref Sn_SR changes to SOCK_CLOSED. */ #define Sn_CR_LISTEN 0x02 @@ -1137,7 +1137,7 @@ //#define SOCK_PPPOE 0x5F /* IP PROTOCOL */ -#define IPPROTO_IP 0 //< Dummy for IP +#define IPPROTO_IP 0 //< Dummy for IP #define IPPROTO_ICMP 1 //< Control message protocol #define IPPROTO_IGMP 2 //< Internet group management protocol #define IPPROTO_GGP 3 //< Gateway^2 (deprecated) @@ -1994,7 +1994,7 @@ uint16_t getSn_RX_RSR(uint8_t sn); ///////////////////////////////////// // Sn_TXBUF & Sn_RXBUF IO function // ///////////////////////////////////// -/** +/** * @brief Gets the max buffer size of socket sn passed as parameter. * @param (uint8_t)sn Socket number. It should be 0 ~ 7. * @return uint16_t. Value of Socket n RX max buffer size. @@ -2002,7 +2002,7 @@ uint16_t getSn_RX_RSR(uint8_t sn); #define getSn_RxMAX(sn) \ (getSn_RXBUF_SIZE(sn) << 10) -/** +/** * @brief Gets the max buffer size of socket sn passed as parameters. * @param (uint8_t)sn Socket number. It should be 0 ~ 7. * @return uint16_t. Value of Socket n TX max buffer size. diff --git a/drivers/wiznet5k/ethernet/wizchip_conf.c b/drivers/wiznet5k/ethernet/wizchip_conf.c index 3e54d2c90b..c7a2f50f04 100644 --- a/drivers/wiznet5k/ethernet/wizchip_conf.c +++ b/drivers/wiznet5k/ethernet/wizchip_conf.c @@ -1,4 +1,4 @@ -//****************************************************************************/ +//****************************************************************************/ //! //! \file wizchip_conf.c //! \brief WIZCHIP Config Header File. @@ -17,30 +17,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //*****************************************************************************/ @@ -88,7 +88,7 @@ uint8_t wizchip_bus_readbyte(uint32_t AddrSel) { return * ((volatile uint8_t *)( * @note This function help not to access wrong address. If you do not describe this function or register any functions, * null function is called. */ - + //M20140501 : Explict pointer type casting //void wizchip_bus_writebyte(uint32_t AddrSel, uint8_t wb) { *((volatile uint8_t*) AddrSel) = wb; }; void wizchip_bus_writebyte(uint32_t AddrSel, uint8_t wb) { *((volatile uint8_t*)((ptrdiff_t)AddrSel)) = wb; }; @@ -160,7 +160,7 @@ void reg_wizchip_cs_cbfunc(void(*cs_sel)(void), void(*cs_desel)(void)) void reg_wizchip_bus_cbfunc(uint8_t(*bus_rb)(uint32_t addr), void (*bus_wb)(uint32_t addr, uint8_t wb)) { while(!(WIZCHIP.if_mode & _WIZCHIP_IO_MODE_BUS_)); - + if(!bus_rb || !bus_wb) { WIZCHIP.IF.BUS._read_byte = wizchip_bus_readbyte; @@ -176,7 +176,7 @@ void reg_wizchip_bus_cbfunc(uint8_t(*bus_rb)(uint32_t addr), void (*bus_wb)(uint void reg_wizchip_spi_cbfunc(void (*spi_rb)(uint8_t *, uint32_t), void (*spi_wb)(const uint8_t *, uint32_t)) { while(!(WIZCHIP.if_mode & _WIZCHIP_IO_MODE_SPI_)); - + if(!spi_rb || !spi_wb) { WIZCHIP.IF.SPI._read_bytes = wizchip_spi_readbytes; @@ -199,7 +199,7 @@ int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg) wizchip_sw_reset(); break; case CW_INIT_WIZCHIP: - if(arg != 0) + if(arg != 0) { ptmp[0] = (uint8_t*)arg; ptmp[1] = ptmp[0] + _WIZCHIP_SOCK_NUM_; @@ -213,7 +213,7 @@ int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg) break; case CW_SET_INTRMASK: wizchip_setinterruptmask(*((intr_kind*)arg)); - break; + break; case CW_GET_INTRMASK: *((intr_kind*)arg) = wizchip_getinterruptmask(); break; @@ -267,7 +267,7 @@ int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg) int8_t ctlnetwork(ctlnetwork_type cntype, void* arg) { - + switch(cntype) { case CN_SET_NETINFO: @@ -346,7 +346,7 @@ void wizchip_clrinterrupt(intr_kind intr) #if _WIZCHIP_ == 5200 ir |= (1 << 6); #endif - + #if _WIZCHIP_ < 5200 sir &= 0x0F; #endif @@ -357,7 +357,7 @@ void wizchip_clrinterrupt(intr_kind intr) #else setIR(ir); setSIR(sir); -#endif +#endif } intr_kind wizchip_getinterrupt(void) @@ -371,7 +371,7 @@ intr_kind wizchip_getinterrupt(void) #else ir = getIR(); sir = getSIR(); -#endif +#endif #if _WIZCHIP_ < 5500 ir &= ~(1<<4); // IK_WOL @@ -394,7 +394,7 @@ void wizchip_setinterruptmask(intr_kind intr) #if _WIZCHIP_ == 5200 imr &= ~(1 << 6); #endif - + #if _WIZCHIP_ < 5200 simr &= 0x0F; #endif @@ -405,7 +405,7 @@ void wizchip_setinterruptmask(intr_kind intr) #else setIMR(imr); setSIMR(simr); -#endif +#endif } intr_kind wizchip_getinterruptmask(void) @@ -419,7 +419,7 @@ intr_kind wizchip_getinterruptmask(void) #else imr = getIMR(); simr = getSIMR(); -#endif +#endif #if _WIZCHIP_ < 5500 imr &= ~(1<<4); // IK_WOL @@ -459,12 +459,12 @@ int8_t wizphy_getphypmode(void) #if _WIZCHIP_ == 5200 if(getPHYSTATUS() & PHYSTATUS_POWERDOWN) tmp = PHY_POWER_DOWN; - else + else tmp = PHY_POWER_NORM; #elif _WIZCHIP_ == 5500 if(getPHYCFGR() & PHYCFGR_OPMDC_PDOWN) tmp = PHY_POWER_DOWN; - else + else tmp = PHY_POWER_NORM; #else tmp = -1; @@ -479,7 +479,7 @@ void wizphy_reset(void) uint8_t tmp = getPHYCFGR(); tmp &= PHYCFGR_RST; setPHYCFGR(tmp); - tmp = getPHYCFGR(); + tmp = getPHYCFGR(); tmp |= ~PHYCFGR_RST; setPHYCFGR(tmp); } @@ -501,7 +501,7 @@ void wizphy_setphyconf(wiz_PhyConf* phyconf) tmp |= PHYCFGR_OPMDC_100F; else tmp |= PHYCFGR_OPMDC_10F; - } + } else { if(phyconf->speed == PHY_SPEED_100) @@ -522,7 +522,7 @@ void wizphy_getphyconf(wiz_PhyConf* phyconf) switch(tmp & PHYCFGR_OPMDC_ALLA) { case PHYCFGR_OPMDC_ALLA: - case PHYCFGR_OPMDC_100FA: + case PHYCFGR_OPMDC_100FA: phyconf->mode = PHY_MODE_AUTONEGO; break; default: @@ -565,7 +565,7 @@ int8_t wizphy_setphypmode(uint8_t pmode) uint8_t tmp = 0; tmp = getPHYCFGR(); if((tmp & PHYCFGR_OPMD)== 0) return -1; - tmp &= ~PHYCFGR_OPMDC_ALLA; + tmp &= ~PHYCFGR_OPMDC_ALLA; if( pmode == PHY_POWER_DOWN) tmp |= PHYCFGR_OPMDC_PDOWN; else @@ -633,11 +633,11 @@ uint8_t *wizchip_getsubn(void) { int8_t wizchip_setnetmode(netmode_type netmode) { uint8_t tmp = 0; -#if _WIZCHIP_ != 5500 +#if _WIZCHIP_ != 5500 if(netmode & ~(NM_WAKEONLAN | NM_PPPOE | NM_PINGBLOCK)) return -1; #else if(netmode & ~(NM_WAKEONLAN | NM_PPPOE | NM_PINGBLOCK | NM_FORCEARP)) return -1; -#endif +#endif tmp = getMR(); tmp |= (uint8_t)netmode; setMR(tmp); diff --git a/drivers/wiznet5k/ethernet/wizchip_conf.h b/drivers/wiznet5k/ethernet/wizchip_conf.h index 10f12a7947..509ba0668a 100644 --- a/drivers/wiznet5k/ethernet/wizchip_conf.h +++ b/drivers/wiznet5k/ethernet/wizchip_conf.h @@ -11,30 +11,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -42,9 +42,9 @@ /** * @defgroup extra_functions 2. WIZnet Extra Functions * - * @brief These functions is optional function. It could be replaced at WIZCHIP I/O function because they were made by WIZCHIP I/O functions. + * @brief These functions is optional function. It could be replaced at WIZCHIP I/O function because they were made by WIZCHIP I/O functions. * @details There are functions of configuring WIZCHIP, network, interrupt, phy, network information and timer. \n - * + * */ #ifndef _WIZCHIP_CONF_H_ @@ -97,10 +97,10 @@ #include "w5200/w5200.h" #elif (_WIZCHIP_ == 5500) #define _WIZCHIP_ID_ "W5500\0" - + /** * @brief Define interface mode. \n - * @todo Should select interface mode as chip. + * @todo Should select interface mode as chip. * - @ref \_WIZCHIP_IO_MODE_SPI_ \n * -@ref \_WIZCHIP_IO_MODE_SPI_VDM_ : Valid only in @ref \_WIZCHIP_ == 5500 \n * -@ref \_WIZCHIP_IO_MODE_SPI_FDM_ : Valid only in @ref \_WIZCHIP_ == 5500 \n @@ -109,12 +109,12 @@ * - @ref \_WIZCHIP_IO_MODE_BUS_INDIR_ \n * - Others will be defined in future. \n\n * ex> #define \_WIZCHIP_IO_MODE_ \_WIZCHIP_IO_MODE_SPI_VDM_ - * + * */ //#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_FDM_ #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_VDM_ #include "w5500/w5500.h" -#else +#else #error "Unknown defined _WIZCHIP_. You should define one of 5100, 5200, and 5500 !!!" #endif @@ -128,19 +128,19 @@ * @ref \_WIZCHIP_IO_MODE_BUS_DIR_, @ref \_WIZCHIP_IO_MODE_BUS_INDIR_). \n\n * ex> #define \_WIZCHIP_IO_BASE_ 0x00008000 */ -#define _WIZCHIP_IO_BASE_ 0x00000000 // +#define _WIZCHIP_IO_BASE_ 0x00000000 // #if _WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_BUS_ #ifndef _WIZCHIP_IO_BASE_ #error "You should be define _WIZCHIP_IO_BASE to fit your system memory map." #endif -#endif +#endif #if _WIZCHIP_ > 5100 #define _WIZCHIP_SOCK_NUM_ 8 ///< The count of independant socket of @b WIZCHIP #else #define _WIZCHIP_SOCK_NUM_ 4 ///< The count of independant socket of @b WIZCHIP -#endif +#endif /******************************************************** @@ -159,9 +159,9 @@ typedef struct __WIZCHIP */ struct _CRIS { - void (*_enter) (void); ///< crtical section enter - void (*_exit) (void); ///< critial section exit - }CRIS; + void (*_enter) (void); ///< crtical section enter + void (*_exit) (void); ///< critial section exit + }CRIS; /** * The set of @ref\_WIZCHIP_ select control callback func. */ @@ -169,20 +169,20 @@ typedef struct __WIZCHIP { void (*_select) (void); ///< @ref \_WIZCHIP_ selected void (*_deselect)(void); ///< @ref \_WIZCHIP_ deselected - }CS; + }CS; /** * The set of interface IO callback func. */ union _IF - { + { /** * For BUS interface IO - */ + */ struct { uint8_t (*_read_byte) (uint32_t AddrSel); void (*_write_byte) (uint32_t AddrSel, uint8_t wb); - }BUS; + }BUS; /** * For SPI interface IO */ @@ -210,13 +210,13 @@ typedef enum CW_CLR_INTERRUPT, ///< Clears interrupt CW_SET_INTRMASK, ///< Masks interrupt CW_GET_INTRMASK, ///< Get interrupt mask - CW_SET_INTRTIME, ///< Set interval time between the current and next interrupt. - CW_GET_INTRTIME, ///< Set interval time between the current and next interrupt. + CW_SET_INTRTIME, ///< Set interval time between the current and next interrupt. + CW_GET_INTRTIME, ///< Set interval time between the current and next interrupt. CW_GET_ID, ///< Gets WIZCHIP name. #if _WIZCHIP_ == 5500 CW_RESET_PHY, ///< Resets internal PHY. Valid Only W5000 - CW_SET_PHYCONF, ///< When PHY configured by interal register, PHY operation mode (Manual/Auto, 10/100, Half/Full). Valid Only W5000 + CW_SET_PHYCONF, ///< When PHY configured by interal register, PHY operation mode (Manual/Auto, 10/100, Half/Full). Valid Only W5000 CW_GET_PHYCONF, ///< Get PHY operation mode in interal register. Valid Only W5000 CW_GET_PHYSTATUS, ///< Get real PHY status on operating. Valid Only W5000 CW_SET_PHYPOWMODE, ///< Set PHY power mode as noraml and down when PHYSTATUS.OPMD == 1. Valid Only W5000 @@ -249,13 +249,13 @@ typedef enum { #if _WIZCHIP_ > 5200 IK_WOL = (1 << 4), ///< Wake On Lan by receiving the magic packet. Valid in W500. -#endif +#endif IK_PPPOE_TERMINATED = (1 << 5), ///< PPPoE Disconnected #if _WIZCHIP_ != 5200 IK_DEST_UNREACH = (1 << 6), ///< Destination IP & Port Unreable, No use in W5200 -#endif +#endif IK_IP_CONFLICT = (1 << 7), ///< IP conflict occurred @@ -263,22 +263,22 @@ typedef enum IK_SOCK_1 = (1 << 9), ///< Socket 1 interrupt IK_SOCK_2 = (1 << 10), ///< Socket 2 interrupt IK_SOCK_3 = (1 << 11), ///< Socket 3 interrupt -#if _WIZCHIP_ > 5100 +#if _WIZCHIP_ > 5100 IK_SOCK_4 = (1 << 12), ///< Socket 4 interrupt, No use in 5100 IK_SOCK_5 = (1 << 13), ///< Socket 5 interrupt, No use in 5100 IK_SOCK_6 = (1 << 14), ///< Socket 6 interrupt, No use in 5100 IK_SOCK_7 = (1 << 15), ///< Socket 7 interrupt, No use in 5100 -#endif +#endif #if _WIZCHIP_ > 5100 IK_SOCK_ALL = (0xFF << 8) ///< All Socket interrpt #else - IK_SOCK_ALL = (0x0F << 8) ///< All Socket interrpt -#endif + IK_SOCK_ALL = (0x0F << 8) ///< All Socket interrpt +#endif }intr_kind; #define PHY_CONFBY_HW 0 ///< Configured PHY operation mode by HW pin -#define PHY_CONFBY_SW 1 ///< Configured PHY operation mode by SW register +#define PHY_CONFBY_SW 1 ///< Configured PHY operation mode by SW register #define PHY_MODE_MANUAL 0 ///< Configured PHY operation mode with user setting. #define PHY_MODE_AUTONEGO 1 ///< Configured PHY operation mode with auto-negotiation #define PHY_SPEED_10 0 ///< Link Speed 10 @@ -288,13 +288,13 @@ typedef enum #define PHY_LINK_OFF 0 ///< Link Off #define PHY_LINK_ON 1 ///< Link On #define PHY_POWER_NORM 0 ///< PHY power normal mode -#define PHY_POWER_DOWN 1 ///< PHY power down mode +#define PHY_POWER_DOWN 1 ///< PHY power down mode -#if _WIZCHIP_ == 5500 +#if _WIZCHIP_ == 5500 /** * @ingroup DATA_TYPE - * It configures PHY configuration when CW_SET PHYCONF or CW_GET_PHYCONF in W5500, + * It configures PHY configuration when CW_SET PHYCONF or CW_GET_PHYCONF in W5500, * and it indicates the real PHY status configured by HW or SW in all WIZCHIP. \n * Valid only in W5500. */ @@ -303,11 +303,11 @@ typedef struct wiz_PhyConf_t uint8_t by; ///< set by @ref PHY_CONFBY_HW or @ref PHY_CONFBY_SW uint8_t mode; ///< set by @ref PHY_MODE_MANUAL or @ref PHY_MODE_AUTONEGO uint8_t speed; ///< set by @ref PHY_SPEED_10 or @ref PHY_SPEED_100 - uint8_t duplex; ///< set by @ref PHY_DUPLEX_HALF @ref PHY_DUPLEX_FULL + uint8_t duplex; ///< set by @ref PHY_DUPLEX_HALF @ref PHY_DUPLEX_FULL //uint8_t power; ///< set by @ref PHY_POWER_NORM or @ref PHY_POWER_DOWN - //uint8_t link; ///< Valid only in CW_GET_PHYSTATUS. set by @ref PHY_LINK_ON or PHY_DUPLEX_OFF + //uint8_t link; ///< Valid only in CW_GET_PHYSTATUS. set by @ref PHY_LINK_ON or PHY_DUPLEX_OFF }wiz_PhyConf; -#endif +#endif /** * @ingroup DATA_TYPE @@ -327,7 +327,7 @@ typedef struct wiz_NetInfo_t { uint8_t mac[6]; ///< Source Mac Address uint8_t ip[4]; ///< Source IP Address - uint8_t sn[4]; ///< Subnet Mask + uint8_t sn[4]; ///< Subnet Mask uint8_t gw[4]; ///< Gateway IP Address uint8_t dns[4]; ///< DNS server IP Address dhcp_mode dhcp; ///< 1 - Static, 2 - DHCP @@ -339,10 +339,10 @@ typedef struct wiz_NetInfo_t */ typedef enum { -#if _WIZCHIP_ == 5500 +#if _WIZCHIP_ == 5500 NM_FORCEARP = (1<<1), ///< Force to APP send whenever udp data is sent. Valid only in W5500 -#endif - NM_WAKEONLAN = (1<<5), ///< Wake On Lan +#endif + NM_WAKEONLAN = (1<<5), ///< Wake On Lan NM_PINGBLOCK = (1<<4), ///< Block ping-request NM_PPPOE = (1<<3), ///< PPPoE mode }netmode_type; @@ -353,7 +353,7 @@ typedef enum */ typedef struct wiz_NetTimeout_t { - uint8_t retry_cnt; ///< retry count + uint8_t retry_cnt; ///< retry count uint16_t time_100us; ///< time unit 100us }wiz_NetTimeout; @@ -389,8 +389,8 @@ void reg_wizchip_bus_cbfunc(uint8_t (*bus_rb)(uint32_t addr), void (*bus_wb)(uin /** *@brief Registers call back function for SPI interface. - *@param spi_rb : callback function to read byte usig SPI - *@param spi_wb : callback function to write byte usig SPI + *@param spi_rb : callback function to read byte usig SPI + *@param spi_wb : callback function to write byte usig SPI *@todo Describe \ref wizchip_spi_readbyte and \ref wizchip_spi_writebyte function *or register your functions. *@note If you do not describe or register, null function is called. @@ -405,8 +405,8 @@ void reg_wizchip_spi_cbfunc(void (*spi_rb)(uint8_t *, uint32_t), void (*spi_wb)( * @param cwtype : Decides to the control type * @param arg : arg type is dependent on cwtype. * @return 0 : Success \n - * -1 : Fail because of invalid \ref ctlwizchip_type or unsupported \ref ctlwizchip_type in WIZCHIP - */ + * -1 : Fail because of invalid \ref ctlwizchip_type or unsupported \ref ctlwizchip_type in WIZCHIP + */ int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg); /** @@ -416,20 +416,20 @@ int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg); * @param cntype : Input. Decides to the control type * @param arg : Inout. arg type is dependent on cntype. * @return -1 : Fail because of invalid \ref ctlnetwork_type or unsupported \ref ctlnetwork_type in WIZCHIP \n - * 0 : Success - */ + * 0 : Success + */ int8_t ctlnetwork(ctlnetwork_type cntype, void* arg); -/* - * The following functions are implemented for internal use. +/* + * The following functions are implemented for internal use. * but You can call these functions for code size reduction instead of ctlwizchip() and ctlnetwork(). */ - + /** * @ingroup extra_functions * @brief Reset WIZCHIP by softly. - */ + */ void wizchip_sw_reset(void); /** @@ -442,28 +442,28 @@ void wizchip_sw_reset(void); */ int8_t wizchip_init(uint8_t* txsize, uint8_t* rxsize); -/** +/** * @ingroup extra_functions * @brief Clear Interrupt of WIZCHIP. * @param intr : @ref intr_kind value operated OR. It can type-cast to uint16_t. */ void wizchip_clrinterrupt(intr_kind intr); -/** +/** * @ingroup extra_functions * @brief Get Interrupt of WIZCHIP. * @return @ref intr_kind value operated OR. It can type-cast to uint16_t. */ intr_kind wizchip_getinterrupt(void); -/** +/** * @ingroup extra_functions * @brief Mask or Unmask Interrupt of WIZCHIP. * @param intr : @ref intr_kind value operated OR. It can type-cast to uint16_t. */ void wizchip_setinterruptmask(intr_kind intr); -/** +/** * @ingroup extra_functions * @brief Get Interrupt mask of WIZCHIP. * @return : The operated OR vaule of @ref intr_kind. It can type-cast to uint16_t. @@ -482,25 +482,25 @@ intr_kind wizchip_getinterruptmask(void); * @brief Set the phy information for WIZCHIP without power mode * @param phyconf : @ref wiz_PhyConf */ - void wizphy_setphyconf(wiz_PhyConf* phyconf); + void wizphy_setphyconf(wiz_PhyConf* phyconf); /** * @ingroup extra_functions * @brief Get phy configuration information. * @param phyconf : @ref wiz_PhyConf */ - void wizphy_getphyconf(wiz_PhyConf* phyconf); + void wizphy_getphyconf(wiz_PhyConf* phyconf); /** * @ingroup extra_functions * @brief Get phy status. * @param phyconf : @ref wiz_PhyConf - */ + */ void wizphy_getphystat(wiz_PhyConf* phyconf); /** * @ingroup extra_functions * @brief set the power mode of phy inside WIZCHIP. Refer to @ref PHYCFGR in W5500, @ref PHYSTATUS in W5200 * @param pmode Settig value of power down mode. - */ - int8_t wizphy_setphypmode(uint8_t pmode); + */ + int8_t wizphy_setphypmode(uint8_t pmode); #endif /** @@ -523,14 +523,14 @@ uint8_t *wizchip_getsubn(void); /** * @ingroup extra_functions - * @brief Set the network mode such WOL, PPPoE, Ping Block, and etc. + * @brief Set the network mode such WOL, PPPoE, Ping Block, and etc. * @param pnetinfo Value of network mode. Refer to @ref netmode_type. */ int8_t wizchip_setnetmode(netmode_type netmode); /** * @ingroup extra_functions - * @brief Get the network mode such WOL, PPPoE, Ping Block, and etc. + * @brief Get the network mode such WOL, PPPoE, Ping Block, and etc. * @return Value of network mode. Refer to @ref netmode_type. */ netmode_type wizchip_getnetmode(void); @@ -538,16 +538,16 @@ netmode_type wizchip_getnetmode(void); /** * @ingroup extra_functions * @brief Set retry time value(@ref RTR) and retry count(@ref RCR). - * @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission. - * @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout. + * @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission. + * @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout. */ void wizchip_settimeout(wiz_NetTimeout* nettime); /** * @ingroup extra_functions * @brief Get retry time value(@ref RTR) and retry count(@ref RCR). - * @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission. - * @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout. + * @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission. + * @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout. */ void wizchip_gettimeout(wiz_NetTimeout* nettime); diff --git a/drivers/wiznet5k/internet/dhcp/dhcp.h b/drivers/wiznet5k/internet/dhcp/dhcp.h index 881bf5a6c1..618a91498b 100644 --- a/drivers/wiznet5k/internet/dhcp/dhcp.h +++ b/drivers/wiznet5k/internet/dhcp/dhcp.h @@ -15,30 +15,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -46,7 +46,7 @@ #define _DHCP_H_ /* - * @brief + * @brief * @details If you want to display debug & processing message, Define _DHCP_DEBUG_ * @note If defined, it depends on */ @@ -65,7 +65,7 @@ #define DCHP_HOST_NAME "WIZnet\0" -/* +/* * @brief return value of @ref DHCP_run() */ enum @@ -74,7 +74,7 @@ enum DHCP_RUNNING, ///< Processing DHCP protocol DHCP_IP_ASSIGN, ///< First Occupy IP from DHPC server (if cbfunc == null, act as default default_ip_assign) DHCP_IP_CHANGED, ///< Change IP address by new IP address from DHCP (if cbfunc == null, act as default default_ip_update) - DHCP_IP_LEASED, ///< Stand by + DHCP_IP_LEASED, ///< Stand by DHCP_STOPPED ///< Stop processing DHCP protocol }; @@ -89,12 +89,12 @@ void DHCP_init(uint8_t s, DHCP_INIT_BUFFER_TYPE* buf); /* * @brief DHCP 1s Tick Timer handler - * @note SHOULD BE register to your system 1s Tick timer handler + * @note SHOULD BE register to your system 1s Tick timer handler */ void DHCP_time_handler(void); -/* - * @brief Register call back function +/* + * @brief Register call back function * @param ip_assign - callback func when IP is assigned from DHCP server first * @param ip_update - callback func when IP is changed * @prarm ip_conflict - callback func when the assigned IP is conflict with others. @@ -112,13 +112,13 @@ void reg_dhcp_cbfunc(void(*ip_assign)(void), void(*ip_update)(void), void(*ip_co * @ref DHCP_STOPPED \n * * @note This function is always called by you main task. - */ + */ uint8_t DHCP_run(void); /* * @brief Stop DHCP processing * @note If you want to restart. call DHCP_init() and DHCP_run() - */ + */ void DHCP_stop(void); /* Get Network information assigned from DHCP server */ diff --git a/drivers/wiznet5k/internet/dns/dns.c b/drivers/wiznet5k/internet/dns/dns.c index 8b9e966708..aa3a738091 100644 --- a/drivers/wiznet5k/internet/dns/dns.c +++ b/drivers/wiznet5k/internet/dns/dns.c @@ -22,30 +22,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -338,7 +338,7 @@ uint8_t * dns_answer(uint8_t * msg, uint8_t * cp, uint8_t * ip_from_dns) * len - is the size of reply message. * Returns : -1 - Domain name length is too big * 0 - Fail (Timeout or parse error) - * 1 - Success, + * 1 - Success, */ int8_t parseDNSMSG(struct dhdr * pdhdr, uint8_t * pbuf, uint8_t * ip_from_dns) { @@ -525,7 +525,7 @@ int8_t DNS_run(uint8_t * dns_ip, uint8_t * name, uint8_t * ip_from_dns) int8_t ret_check_timeout; hal_sys_tick = HAL_GetTick(); - + // Socket open WIZCHIP_EXPORT(socket)(DNS_SOCKET, Sn_MR_UDP, 0, 0); diff --git a/drivers/wiznet5k/internet/dns/dns.h b/drivers/wiznet5k/internet/dns/dns.h index de0039515e..574b632a6a 100644 --- a/drivers/wiznet5k/internet/dns/dns.h +++ b/drivers/wiznet5k/internet/dns/dns.h @@ -2,7 +2,7 @@ // //! \file dns.h //! \brief DNS APIs Header file. -//! \details Send DNS query & Receive DNS reponse. +//! \details Send DNS query & Receive DNS reponse. //! \version 1.1.0 //! \date 2013/11/18 //! \par Revision history @@ -20,30 +20,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** diff --git a/extmod/font_petme128_8x8.h b/extmod/font_petme128_8x8.h index cdc4e73a79..9963698b17 100644 --- a/extmod/font_petme128_8x8.h +++ b/extmod/font_petme128_8x8.h @@ -27,7 +27,7 @@ #define MICROPY_INCLUDED_STM32_FONT_PETME128_8X8_H static const uint8_t font_petme128_8x8[] = { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 32= + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 32= 0x00,0x00,0x00,0x4f,0x4f,0x00,0x00,0x00, // 33=! 0x00,0x07,0x07,0x00,0x00,0x07,0x07,0x00, // 34=" 0x14,0x7f,0x7f,0x14,0x14,0x7f,0x7f,0x14, // 35=# diff --git a/lib/libm/ef_rem_pio2.c b/lib/libm/ef_rem_pio2.c index 601f3bac4e..bbb73097d6 100644 --- a/lib/libm/ef_rem_pio2.c +++ b/lib/libm/ef_rem_pio2.c @@ -17,22 +17,22 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== * */ /* __ieee754_rem_pio2f(x,y) - * - * return the remainder of x rem pi/2 in y[0]+y[1] + * + * return the remainder of x rem pi/2 in y[0]+y[1] * use __kernel_rem_pio2f() */ #include "fdlibm.h" /* - * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi + * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi */ #ifdef __STDC__ static const __int32_t two_over_pi[] = { @@ -40,27 +40,27 @@ static const __int32_t two_over_pi[] = { static __int32_t two_over_pi[] = { #endif 0xA2, 0xF9, 0x83, 0x6E, 0x4E, 0x44, 0x15, 0x29, 0xFC, -0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62, +0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62, 0x95, 0x99, 0x3C, 0x43, 0x90, 0x41, 0xFE, 0x51, 0x63, -0xAB, 0xDE, 0xBB, 0xC5, 0x61, 0xB7, 0x24, 0x6E, 0x3A, +0xAB, 0xDE, 0xBB, 0xC5, 0x61, 0xB7, 0x24, 0x6E, 0x3A, 0x42, 0x4D, 0xD2, 0xE0, 0x06, 0x49, 0x2E, 0xEA, 0x09, -0xD1, 0x92, 0x1C, 0xFE, 0x1D, 0xEB, 0x1C, 0xB1, 0x29, +0xD1, 0x92, 0x1C, 0xFE, 0x1D, 0xEB, 0x1C, 0xB1, 0x29, 0xA7, 0x3E, 0xE8, 0x82, 0x35, 0xF5, 0x2E, 0xBB, 0x44, -0x84, 0xE9, 0x9C, 0x70, 0x26, 0xB4, 0x5F, 0x7E, 0x41, +0x84, 0xE9, 0x9C, 0x70, 0x26, 0xB4, 0x5F, 0x7E, 0x41, 0x39, 0x91, 0xD6, 0x39, 0x83, 0x53, 0x39, 0xF4, 0x9C, -0x84, 0x5F, 0x8B, 0xBD, 0xF9, 0x28, 0x3B, 0x1F, 0xF8, +0x84, 0x5F, 0x8B, 0xBD, 0xF9, 0x28, 0x3B, 0x1F, 0xF8, 0x97, 0xFF, 0xDE, 0x05, 0x98, 0x0F, 0xEF, 0x2F, 0x11, -0x8B, 0x5A, 0x0A, 0x6D, 0x1F, 0x6D, 0x36, 0x7E, 0xCF, +0x8B, 0x5A, 0x0A, 0x6D, 0x1F, 0x6D, 0x36, 0x7E, 0xCF, 0x27, 0xCB, 0x09, 0xB7, 0x4F, 0x46, 0x3F, 0x66, 0x9E, -0x5F, 0xEA, 0x2D, 0x75, 0x27, 0xBA, 0xC7, 0xEB, 0xE5, +0x5F, 0xEA, 0x2D, 0x75, 0x27, 0xBA, 0xC7, 0xEB, 0xE5, 0xF1, 0x7B, 0x3D, 0x07, 0x39, 0xF7, 0x8A, 0x52, 0x92, -0xEA, 0x6B, 0xFB, 0x5F, 0xB1, 0x1F, 0x8D, 0x5D, 0x08, +0xEA, 0x6B, 0xFB, 0x5F, 0xB1, 0x1F, 0x8D, 0x5D, 0x08, 0x56, 0x03, 0x30, 0x46, 0xFC, 0x7B, 0x6B, 0xAB, 0xF0, -0xCF, 0xBC, 0x20, 0x9A, 0xF4, 0x36, 0x1D, 0xA9, 0xE3, +0xCF, 0xBC, 0x20, 0x9A, 0xF4, 0x36, 0x1D, 0xA9, 0xE3, 0x91, 0x61, 0x5E, 0xE6, 0x1B, 0x08, 0x65, 0x99, 0x85, -0x5F, 0x14, 0xA0, 0x68, 0x40, 0x8D, 0xFF, 0xD8, 0x80, +0x5F, 0x14, 0xA0, 0x68, 0x40, 0x8D, 0xFF, 0xD8, 0x80, 0x4D, 0x73, 0x27, 0x31, 0x06, 0x06, 0x15, 0x56, 0xCA, -0x73, 0xA8, 0xC9, 0x60, 0xE2, 0x7B, 0xC0, 0x8C, 0x6B, +0x73, 0xA8, 0xC9, 0x60, 0xE2, 0x7B, 0xC0, 0x8C, 0x6B, }; /* This array is like the one in e_rem_pio2.c, but the numbers are @@ -89,9 +89,9 @@ static __int32_t npio2_hw[] = { */ #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif zero = 0.0000000000e+00, /* 0x00000000 */ half = 5.0000000000e-01, /* 0x3f000000 */ @@ -121,7 +121,7 @@ pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ if(ix<=0x3f490fd8) /* |x| ~<= pi/4 , no need for reduction */ {y[0] = x; y[1] = 0; return 0;} if(ix<0x4016cbe4) { /* |x| < 3pi/4, special case with n=+-1 */ - if(hx>0) { + if(hx>0) { z = x - pio2_1; if((ix&0xfffffff0)!=0x3fc90fd0) { /* 24+24 bit pi OK */ y[0] = z - pio2_1t; @@ -151,27 +151,27 @@ pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ fn = (float)n; r = t-fn*pio2_1; w = fn*pio2_1t; /* 1st round good to 40 bit */ - if(n<32&&(__int32_t)(ix&0xffffff00)!=npio2_hw[n-1]) { + if(n<32&&(__int32_t)(ix&0xffffff00)!=npio2_hw[n-1]) { y[0] = r-w; /* quick check no cancellation */ } else { __uint32_t high; j = ix>>23; - y[0] = r-w; + y[0] = r-w; GET_FLOAT_WORD(high,y[0]); i = j-((high>>23)&0xff); if(i>8) { /* 2nd iteration needed, good to 57 */ t = r; - w = fn*pio2_2; + w = fn*pio2_2; r = t-w; - w = fn*pio2_2t-((t-r)-w); + w = fn*pio2_2t-((t-r)-w); y[0] = r-w; GET_FLOAT_WORD(high,y[0]); i = j-((high>>23)&0xff); if(i>25) { /* 3rd iteration need, 74 bits acc */ t = r; /* will cover all possible cases */ - w = fn*pio2_3; + w = fn*pio2_3; r = t-w; - w = fn*pio2_3t-((t-r)-w); + w = fn*pio2_3t-((t-r)-w); y[0] = r-w; } } @@ -180,7 +180,7 @@ pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} else return n; } - /* + /* * all other (large) arguments */ if(!FLT_UWORD_IS_FINITE(ix)) { diff --git a/lib/libm/ef_sqrt.c b/lib/libm/ef_sqrt.c index 87484d0bf0..8615dfc172 100644 --- a/lib/libm/ef_sqrt.c +++ b/lib/libm/ef_sqrt.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -74,12 +74,12 @@ float sqrtf(float x) r = 0x01000000L; /* r = moving bit from right to left */ while(r!=0) { - t = s+r; - if(t<=ix) { - s = t+r; - ix -= t; - q += r; - } + t = s+r; + if(t<=ix) { + s = t+r; + ix -= t; + q += r; + } ix += ix; r>>=1; } diff --git a/lib/libm/erf_lgamma.c b/lib/libm/erf_lgamma.c index fcb1d0a0c6..5116e3c1b1 100644 --- a/lib/libm/erf_lgamma.c +++ b/lib/libm/erf_lgamma.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== * @@ -29,9 +29,9 @@ #define __ieee754_logf logf #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif two23= 8.3886080000e+06, /* 0x4b000000 */ half= 5.0000000000e-01, /* 0x3f000000 */ @@ -144,9 +144,9 @@ static float zero= 0.0000000000e+00; } switch (n) { case 0: y = __kernel_sinf(pi*y,zero,0); break; - case 1: + case 1: case 2: y = __kernel_cosf(pi*((float)0.5-y),zero); break; - case 3: + case 3: case 4: y = __kernel_sinf(pi*(one-y),zero,0); break; case 5: case 6: y = -__kernel_cosf(pi*(y-(float)1.5),zero); break; @@ -219,7 +219,7 @@ static float zero= 0.0000000000e+00; p3 = t2+w*(t5+w*(t8+w*(t11+w*t14))); p = z*p1-(tt-w*(p2+y*p3)); r += (tf + p); break; - case 2: + case 2: p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5))))); p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5)))); r += (-(float)0.5*y + p1/p2); @@ -248,7 +248,7 @@ static float zero= 0.0000000000e+00; y = z*z; w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6))))); r = (x-half)*(t-one)+w; - } else + } else /* 2**58 <= x <= inf */ r = x*(__ieee754_logf(x)-one); if(hx<0) r = nadj - r; diff --git a/lib/libm/fdlibm.h b/lib/libm/fdlibm.h index ace3b2da22..67bc622ea5 100644 --- a/lib/libm/fdlibm.h +++ b/lib/libm/fdlibm.h @@ -15,7 +15,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -136,12 +136,12 @@ #define __P(p) () #endif -/* +/* * set X_TLOSS = pi*2**52, which is possibly defined in * (one may replace the following line by "#include ") */ -#define X_TLOSS 1.41484755040568800000e+16 +#define X_TLOSS 1.41484755040568800000e+16 /* Functions that are not documented, and are not in . */ @@ -154,13 +154,13 @@ extern float scalbf __P((float, float)); extern float significandf __P((float)); /* ieee style elementary float functions */ -extern float __ieee754_sqrtf __P((float)); -extern float __ieee754_acosf __P((float)); -extern float __ieee754_acoshf __P((float)); -extern float __ieee754_logf __P((float)); -extern float __ieee754_atanhf __P((float)); -extern float __ieee754_asinf __P((float)); -extern float __ieee754_atan2f __P((float,float)); +extern float __ieee754_sqrtf __P((float)); +extern float __ieee754_acosf __P((float)); +extern float __ieee754_acoshf __P((float)); +extern float __ieee754_logf __P((float)); +extern float __ieee754_atanhf __P((float)); +extern float __ieee754_asinf __P((float)); +extern float __ieee754_atan2f __P((float,float)); extern float __ieee754_expf __P((float)); extern float __ieee754_coshf __P((float)); extern float __ieee754_fmodf __P((float,float)); diff --git a/lib/libm/kf_cos.c b/lib/libm/kf_cos.c index 691f9842fd..5181664901 100644 --- a/lib/libm/kf_cos.c +++ b/lib/libm/kf_cos.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -25,9 +25,9 @@ #include "fdlibm.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif one = 1.0000000000e+00, /* 0x3f800000 */ C1 = 4.1666667908e-02, /* 0x3d2aaaab */ @@ -53,7 +53,7 @@ C6 = -1.1359647598e-11; /* 0xad47d74e */ } z = x*x; r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6))))); - if(ix < 0x3e99999a) /* if |x| < 0.3 */ + if(ix < 0x3e99999a) /* if |x| < 0.3 */ return one - ((float)0.5*z - (z*r - x*y)); else { if(ix > 0x3f480000) { /* x > 0.78125 */ diff --git a/lib/libm/kf_rem_pio2.c b/lib/libm/kf_rem_pio2.c index 3b09de5fd0..62aa242bc7 100644 --- a/lib/libm/kf_rem_pio2.c +++ b/lib/libm/kf_rem_pio2.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -30,7 +30,7 @@ #ifdef __STDC__ static const int init_jk[] = {4,7,9}; /* initial value for jk */ #else -static int init_jk[] = {4,7,9}; +static int init_jk[] = {4,7,9}; #endif #ifdef __STDC__ @@ -52,9 +52,9 @@ static float PIo2[] = { }; #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif zero = 0.0, one = 1.0, @@ -62,9 +62,9 @@ two8 = 2.5600000000e+02, /* 0x43800000 */ twon8 = 3.9062500000e-03; /* 0x3b800000 */ #ifdef __STDC__ - int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const __int32_t *ipio2) + int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const __int32_t *ipio2) #else - int __kernel_rem_pio2f(x,y,e0,nx,prec,ipio2) + int __kernel_rem_pio2f(x,y,e0,nx,prec,ipio2) float x[], y[]; int e0,nx,prec; __int32_t ipio2[]; #endif { @@ -109,7 +109,7 @@ recompute: i = (iq[jz-1]>>(8-q0)); n += i; iq[jz-1] -= i<<(8-q0); ih = iq[jz-1]>>(7-q0); - } + } else if(q0==0) ih = iq[jz-1]>>8; else if(z>=(float)0.5) ih=2; @@ -141,7 +141,7 @@ recompute: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wfloat-equal" if(z==zero) { -#pragma GCC diagnostic pop +#pragma GCC diagnostic pop j = 0; for (i=jz-1;i>=jk;i--) j |= iq[i]; if(j==0) { /* need recomputation */ @@ -166,7 +166,7 @@ recompute: while(iq[jz]==0) { jz--; q0-=8;} } else { /* break z into 8-bit if necessary */ z = scalbnf(z,-(int)q0); - if(z>=two8) { + if(z>=two8) { fw = (float)((__int32_t)(twon8*z)); iq[jz] = (__int32_t)(z-two8*fw); jz += 1; q0 += 8; @@ -191,29 +191,29 @@ recompute: case 0: fw = 0.0; for (i=jz;i>=0;i--) fw += fq[i]; - y[0] = (ih==0)? fw: -fw; + y[0] = (ih==0)? fw: -fw; break; case 1: case 2: fw = 0.0; - for (i=jz;i>=0;i--) fw += fq[i]; - y[0] = (ih==0)? fw: -fw; + for (i=jz;i>=0;i--) fw += fq[i]; + y[0] = (ih==0)? fw: -fw; fw = fq[0]-fw; for (i=1;i<=jz;i++) fw += fq[i]; - y[1] = (ih==0)? fw: -fw; + y[1] = (ih==0)? fw: -fw; break; case 3: /* painful */ for (i=jz;i>0;i--) { - fw = fq[i-1]+fq[i]; + fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } for (i=jz;i>1;i--) { - fw = fq[i-1]+fq[i]; + fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } - for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; + for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; if(ih==0) { y[0] = fq[0]; y[1] = fq[1]; y[2] = fw; } else { diff --git a/lib/libm/kf_sin.c b/lib/libm/kf_sin.c index 07ea993446..6ef8903cae 100644 --- a/lib/libm/kf_sin.c +++ b/lib/libm/kf_sin.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -25,9 +25,9 @@ #include "fdlibm.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif half = 5.0000000000e-01,/* 0x3f000000 */ S1 = -1.6666667163e-01, /* 0xbe2aaaab */ diff --git a/lib/libm/kf_tan.c b/lib/libm/kf_tan.c index 6da9bd8171..f0ff94c88d 100644 --- a/lib/libm/kf_tan.c +++ b/lib/libm/kf_tan.c @@ -17,16 +17,16 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ #include "libm.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif one = 1.0000000000e+00, /* 0x3f800000 */ pio4 = 7.8539812565e-01, /* 0x3f490fda */ @@ -87,7 +87,7 @@ T[] = { return (float)(1-((hx>>30)&2))*(v-(float)2.0*(x-(w*w/(w+v)-r))); } if(iy==1) return w; - else { /* if allow error up to 2 ulp, + else { /* if allow error up to 2 ulp, simply return -1.0/(x+r) here */ /* compute -1.0/(x+r) accurately */ float a,t; diff --git a/lib/libm/sf_cos.c b/lib/libm/sf_cos.c index fabb129cd9..0fe7c8ce6e 100644 --- a/lib/libm/sf_cos.c +++ b/lib/libm/sf_cos.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/sf_erf.c b/lib/libm/sf_erf.c index 3f0172c6e9..a6aec096f1 100644 --- a/lib/libm/sf_erf.c +++ b/lib/libm/sf_erf.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -57,7 +57,7 @@ qq3 = 5.0813062117e-03, /* 0x3ba68116 */ qq4 = 1.3249473704e-04, /* 0x390aee49 */ qq5 = -3.9602282413e-06, /* 0xb684e21a */ /* - * Coefficients for approximation to erf in [0.84375,1.25] + * Coefficients for approximation to erf in [0.84375,1.25] */ pa0 = -2.3621185683e-03, /* 0xbb1acdc6 */ pa1 = 4.1485610604e-01, /* 0x3ed46805 */ @@ -110,9 +110,9 @@ sb6 = 4.7452853394e+02, /* 0x43ed43a7 */ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ #ifdef __STDC__ - float erff(float x) + float erff(float x) #else - float erff(x) + float erff(x) float x; #endif { @@ -127,7 +127,7 @@ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ if(ix < 0x3f580000) { /* |x|<0.84375 */ if(ix < 0x31800000) { /* |x|<2**-28 */ - if (ix < 0x04000000) + if (ix < 0x04000000) /*avoid underflow */ return (float)0.125*((float)8.0*x+efx8*x); return x + efx*x; @@ -167,9 +167,9 @@ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ } #ifdef __STDC__ - float erfcf(float x) + float erfcf(float x) #else - float erfcf(x) + float erfcf(x) float x; #endif { @@ -202,7 +202,7 @@ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); if(hx>=0) { - z = one-erx; return z - P/Q; + z = one-erx; return z - P/Q; } else { z = erx+P/Q; return one+z; } diff --git a/lib/libm/sf_frexp.c b/lib/libm/sf_frexp.c index df50fb7737..92cedb8bc4 100644 --- a/lib/libm/sf_frexp.c +++ b/lib/libm/sf_frexp.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/sf_ldexp.c b/lib/libm/sf_ldexp.c index 75cb8b7275..c177160a3c 100644 --- a/lib/libm/sf_ldexp.c +++ b/lib/libm/sf_ldexp.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/sf_modf.c b/lib/libm/sf_modf.c index 410db2a373..8bad5d2e28 100644 --- a/lib/libm/sf_modf.c +++ b/lib/libm/sf_modf.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/sf_sin.c b/lib/libm/sf_sin.c index d270507785..b9d4049b32 100644 --- a/lib/libm/sf_sin.c +++ b/lib/libm/sf_sin.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/sf_tan.c b/lib/libm/sf_tan.c index 148b16d618..42d2df9c90 100644 --- a/lib/libm/sf_tan.c +++ b/lib/libm/sf_tan.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/wf_lgamma.c b/lib/libm/wf_lgamma.c index d86ede790b..8a7fb822d7 100644 --- a/lib/libm/wf_lgamma.c +++ b/lib/libm/wf_lgamma.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== * @@ -44,7 +44,7 @@ y = __ieee754_lgammaf_r(x,&(_REENT_SIGNGAM(_REENT))); if(_LIB_VERSION == _IEEE_) return y; if(!finitef(y)&&finitef(x)) { -#ifndef HUGE_VAL +#ifndef HUGE_VAL #define HUGE_VAL inf double inf = 0.0; @@ -77,11 +77,11 @@ } if (exc.err != 0) errno = exc.err; - return (float)exc.retval; + return (float)exc.retval; } else return y; #endif -} +} #ifdef _DOUBLE_IS_32BITS diff --git a/lib/libm_dbl/__signbit.c b/lib/libm_dbl/__signbit.c index 18c6728a50..f1f1ae8108 100644 --- a/lib/libm_dbl/__signbit.c +++ b/lib/libm_dbl/__signbit.c @@ -8,5 +8,3 @@ int __signbitd(double x) } y = { x }; return y.i>>63; } - - diff --git a/lib/memzip/README.md b/lib/memzip/README.md index 287d0fc489..c4e31a1170 100644 --- a/lib/memzip/README.md +++ b/lib/memzip/README.md @@ -25,4 +25,3 @@ $(BUILD)/memzip-files.c: $(shell find ${MEMZIP_DIR} -type f) @$(ECHO) "Creating $@" $(Q)$(PYTHON) $(MAKE_MEMZIP) --zip-file $(BUILD)/memzip-files.zip --c-file $@ $(MEMZIP_DIR) ``` - diff --git a/lib/memzip/lexermemzip.c b/lib/memzip/lexermemzip.c index 6b26961bdc..c1f21c1caa 100644 --- a/lib/memzip/lexermemzip.c +++ b/lib/memzip/lexermemzip.c @@ -16,4 +16,3 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename) return mp_lexer_new_from_str_len(qstr_from_str(filename), (const char *)data, (mp_uint_t)len, 0); } - diff --git a/lib/memzip/make-memzip.py b/lib/memzip/make-memzip.py index 9730f5e008..dd1ac93da4 100755 --- a/lib/memzip/make-memzip.py +++ b/lib/memzip/make-memzip.py @@ -76,4 +76,3 @@ def main(): if __name__ == "__main__": main() - diff --git a/lib/oofatfs/option/ccsbcs.c b/lib/oofatfs/option/ccsbcs.c index fdded968d5..f0c7e90a5c 100644 --- a/lib/oofatfs/option/ccsbcs.c +++ b/lib/oofatfs/option/ccsbcs.c @@ -385,4 +385,3 @@ WCHAR ff_wtoupper ( /* Returns upper converted character */ return chr; } - diff --git a/lib/tinytest/README b/lib/tinytest/README index 902c4a2e0f..28165d8bc7 100644 --- a/lib/tinytest/README +++ b/lib/tinytest/README @@ -15,4 +15,3 @@ You can get the latest version using Git, by pulling from Patches are welcome. Patches that turn this from tinytest to hugetest will not be applied. If you want a huge test framework, use CUnit. - diff --git a/lib/tinytest/tinytest.c b/lib/tinytest/tinytest.c index 01772f3f8e..be2ebd4956 100644 --- a/lib/tinytest/tinytest.c +++ b/lib/tinytest/tinytest.c @@ -474,4 +474,3 @@ tinytest_set_test_skipped_(void) if (cur_test_outcome==OK) cur_test_outcome = SKIP; } - diff --git a/logo/adafruit_blinka_angles-back.svg b/logo/adafruit_blinka_angles-back.svg index 589ed6f0a6..b69e3436d6 100644 --- a/logo/adafruit_blinka_angles-back.svg +++ b/logo/adafruit_blinka_angles-back.svg @@ -368,4 +368,4 @@ id="g5465"> \ No newline at end of file + d="M 0,0 C 1.069,-0.604 2.001,-3.052 2.61,-6.566 2.596,-6.436 2.585,-6.304 2.571,-6.173 2.43,-4.877 2.259,-3.587 2.062,-2.304 1.874,-1.02 1.655,0.257 1.4,1.521 1.151,2.784 0.866,4.036 0.524,5.259 c -0.336,1.22 -0.722,2.422 -1.205,3.525 -0.243,0.548 -0.503,1.077 -0.792,1.529 -0.278,0.448 -0.623,0.838 -0.84,0.961 -0.04,0.026 -0.067,0.038 -0.087,0.044 l -0.072,-0.004 c -0.043,-0.015 0.108,0.01 0.067,-10e-4 0.002,0 -0.016,-0.009 -0.05,-0.03 C -2.604,11.21 -2.939,10.854 -3.202,10.421 -3.755,9.534 -4.186,8.371 -4.556,7.206 -4.924,6.027 -5.222,4.799 -5.471,3.554 -5.718,2.307 -5.938,1.046 -6.115,-0.226 c -0.179,-1.272 -0.32,-2.552 -0.447,-3.836 -0.241,-2.571 -0.389,-5.158 -0.452,-7.75 l -0.037,-1.519 -1.451,-0.058 -2.032,-0.081 c 0.304,-0.178 0.607,-0.357 0.91,-0.536 l 5.116,-3.091 c 0.042,-0.025 0.083,-0.051 0.126,-0.077 -0.004,0.309 -0.007,0.619 -0.007,0.933 0,6.707 0.952,12.47 2.316,15.006 -0.071,-0.657 -0.11,-1.382 -0.11,-2.149 0,-1.433 0.136,-2.731 0.356,-3.677 0.224,-0.964 0.537,-1.563 0.883,-1.563 0.468,0 0.878,1.107 1.088,2.738 0.095,0.743 0.15,1.596 0.15,2.502 0,1.29 -0.111,2.47 -0.294,3.384" /> diff --git a/logo/adafruit_blinka_angles-front.svg b/logo/adafruit_blinka_angles-front.svg index f09ce38607..b5c07c5025 100644 --- a/logo/adafruit_blinka_angles-front.svg +++ b/logo/adafruit_blinka_angles-front.svg @@ -413,4 +413,4 @@ id="g10457"> \ No newline at end of file + d="m 0,0 3.99,1.09 7.954,2.26 6.252,1.855 1.671,0.496 5.787,1.717 -6.001,1.541 C 18.416,9.277 17.168,9.536 15.924,9.82 l -2.158,0.484 c -0.021,0.944 -0.06,1.888 -0.122,2.832 -0.103,1.462 -0.252,2.923 -0.469,4.38 -0.431,2.912 -1.074,5.82 -2.162,8.645 -0.537,1.413 -1.186,2.807 -2,4.159 -0.825,1.343 -1.814,2.67 -3.237,3.775 -1.408,1.107 -3.488,1.847 -5.552,1.385 -2.006,-0.444 -3.459,-1.684 -4.511,-2.921 -0.382,-0.455 -0.719,-0.925 -1.035,-1.401 -0.161,0.064 -0.317,0.123 -0.49,0.191 -0.304,0.124 -0.619,0.252 -0.938,0.382 -0.342,0.124 -0.626,0.295 -0.931,0.464 -0.311,0.174 -0.621,0.349 -0.927,0.52 -0.312,0.177 -0.557,0.393 -0.837,0.59 -0.261,0.205 -0.563,0.392 -0.768,0.611 -0.228,0.219 -0.444,0.427 -0.643,0.618 -0.199,0.198 -0.341,0.401 -0.493,0.579 -0.153,0.179 -0.267,0.34 -0.351,0.479 -0.189,0.278 -0.271,0.463 -0.271,0.463 0,0 -0.041,-0.186 -0.054,-0.536 -0.016,-0.18 -0.02,-0.399 -10e-4,-0.64 0.017,-0.242 0.015,-0.536 0.061,-0.838 0.053,-0.307 0.111,-0.64 0.171,-0.991 0.051,-0.371 0.187,-0.708 0.294,-1.093 0.122,-0.373 0.226,-0.795 0.392,-1.174 0.171,-0.384 0.345,-0.775 0.52,-1.165 0.18,-0.395 0.36,-0.808 0.585,-1.154 0.221,-0.365 0.438,-0.724 0.647,-1.071 0.217,-0.347 0.423,-0.703 0.638,-1.01 0.225,-0.294 0.438,-0.572 0.635,-0.829 0.05,-0.063 0.095,-0.121 0.144,-0.182 -0.112,-0.354 -0.235,-0.705 -0.335,-1.06 -0.809,-2.85 -1.251,-5.746 -1.455,-8.64 -0.105,-1.446 -0.169,-2.891 -0.148,-4.334 0.024,-1.456 0.071,-2.878 0.216,-4.314 0.096,-1.433 0.329,-2.854 0.552,-4.269 0.237,-1.421 0.562,-2.802 0.925,-4.181 l -0.1,2.134 -0.038,2.122 c -0.002,0.546 0.007,1.094 0.017,1.641 0.015,0.862 0.041,1.723 0.087,2.581 0.049,1.399 0.169,2.813 0.321,4.189 0.154,1.389 0.324,2.771 0.567,4.139 0.489,2.732 1.141,5.425 2.041,7.984 0.458,1.276 0.988,2.514 1.606,3.673 0.626,1.146 1.309,2.247 2.121,3.11 0.797,0.88 1.722,1.465 2.52,1.585 0.19,0.038 0.42,0.041 0.571,0.022 l 0.265,-0.021 c 0.096,-0.007 0.077,-0.026 0.121,-0.034 0.053,-0.018 0.11,-0.023 0.224,-0.07 0.393,-0.131 0.799,-0.37 1.208,-0.684 0.817,-0.647 1.571,-1.621 2.203,-2.7 0.633,-1.087 1.175,-2.279 1.626,-3.522 0.459,-1.242 0.816,-2.536 1.155,-3.841 0.333,-1.307 0.603,-2.639 0.821,-3.985 0.443,-2.69 0.633,-5.433 0.716,-8.178 L 9.918,7.053 11.459,6.811 12.605,6.63 11.046,6.059 4.729,3.658 3.317,3.122 2.445,2.78 c 0.027,0.486 0.045,0.979 0.045,1.484 0,3.923 -0.828,7.348 -2.062,9.241 -0.378,-0.966 -0.901,-1.567 -1.479,-1.567 -0.787,0 -1.465,1.122 -1.819,2.756 -1.821,-1.229 -3.165,-5.426 -3.165,-10.43 0,-1.679 0.156,-3.261 0.425,-4.678 -0.762,-0.31 -1.523,-0.62 -2.283,-0.933 -1.383,-0.57 -2.763,-1.147 -4.136,-1.744 2.692,0.631 5.363,1.323 8.034,2.018 z" /> diff --git a/logo/adafruit_blinka_angles-left.svg b/logo/adafruit_blinka_angles-left.svg index 32c83c4074..dae709fe05 100644 --- a/logo/adafruit_blinka_angles-left.svg +++ b/logo/adafruit_blinka_angles-left.svg @@ -5873,4 +5873,4 @@ id="g10145"> \ No newline at end of file + d="M 0,0 C 0.588,-0.108 1.194,-0.158 1.804,-0.242 2.11,-0.279 2.417,-0.317 2.727,-0.355 3.036,-0.389 3.349,-0.4 3.661,-0.424 c 0.627,-0.036 1.26,-0.09 1.894,-0.113 0.635,-0.015 1.274,-0.029 1.911,-0.044 0.638,-0.006 1.275,0.033 1.91,0.047 0.211,0.005 0.421,0.014 0.631,0.024 0.422,0.019 0.843,0.043 1.26,0.074 1.254,0.063 2.474,0.241 3.658,0.376 1.179,0.171 2.316,0.346 3.384,0.567 0.534,0.106 1.053,0.211 1.555,0.311 0.498,0.119 0.98,0.233 1.442,0.343 0.925,0.209 1.764,0.446 2.506,0.656 0.746,0.201 1.386,0.4 1.912,0.57 1.052,0.335 1.649,0.545 1.649,0.545 0,0 -0.63,-0.064 -1.726,-0.21 C 24.558,2.58 22.998,2.378 21.128,2.136 20.195,2.012 19.184,1.904 18.116,1.781 17.583,1.715 17.034,1.661 16.474,1.617 15.913,1.563 15.341,1.509 14.759,1.454 14.177,1.413 13.585,1.371 12.986,1.328 12.388,1.277 11.78,1.276 11.17,1.233 10.56,1.196 9.944,1.169 9.326,1.167 8.708,1.164 8.088,1.135 7.468,1.15 6.848,1.155 6.228,1.16 5.61,1.165 4.993,1.179 4.38,1.221 3.77,1.246 3.159,1.27 2.556,1.32 1.96,1.364 1.364,1.417 0.771,1.436 0.194,1.514 -0.96,1.655 -2.084,1.757 -3.14,1.932 -4.2,2.075 -5.197,2.258 -6.121,2.419 -7.048,2.568 -7.884,2.77 -8.636,2.912 c -0.751,0.147 -1.403,0.292 -1.938,0.42 -0.39,0.09 -0.719,0.162 -0.982,0.219 -0.462,0.099 -0.716,0.149 -0.716,0.149 0,0 0.573,-0.264 1.593,-0.696 0.256,-0.108 0.539,-0.228 0.847,-0.358 C -9.523,2.517 -9.181,2.408 -8.817,2.274 -8.089,2.021 -7.274,1.697 -6.354,1.452 -6.342,1.448 -6.327,1.444 -6.315,1.44 -6.533,1.319 -6.751,1.192 -6.967,1.062 -7.001,1.04 -7.035,1.021 -7.069,1 -7.28,0.87 -7.489,0.733 -7.696,0.594 -7.744,0.562 -7.792,0.532 -7.84,0.499 -8.087,0.329 -8.332,0.153 -8.573,-0.031 -9.037,-0.36 -9.46,-0.744 -9.901,-1.114 c -0.414,-0.398 -0.842,-0.791 -1.231,-1.223 -0.406,-0.417 -0.769,-0.868 -1.15,-1.314 -0.355,-0.459 -0.713,-0.926 -1.033,-1.411 -0.333,-0.479 -0.649,-0.97 -0.946,-1.469 -0.894,-1.497 -1.638,-3.068 -2.293,-4.639 -0.111,-0.263 -0.217,-0.525 -0.32,-0.788 -0.309,-0.789 -0.588,-1.58 -0.865,-2.372 -0.186,-0.536 -0.364,-1.053 -0.524,-1.56 -0.114,-0.363 -0.22,-0.721 -0.329,-1.08 v -0.001 c -0.001,-0.002 -0.002,-0.006 -0.003,-0.008 -0.293,-0.912 -0.583,-1.816 -0.869,-2.709 -0.14,-0.448 -0.291,-0.875 -0.436,-1.307 -0.147,-0.43 -0.279,-0.864 -0.433,-1.276 -0.576,-1.684 -1.217,-3.232 -1.908,-4.655 -0.178,-0.352 -0.354,-0.7 -0.527,-1.043 -0.194,-0.328 -0.385,-0.65 -0.573,-0.967 -0.094,-0.16 -0.186,-0.32 -0.278,-0.477 -0.105,-0.148 -0.207,-0.294 -0.31,-0.439 -0.204,-0.294 -0.404,-0.581 -0.601,-0.864 -0.209,-0.27 -0.432,-0.521 -0.642,-0.777 -0.218,-0.246 -0.404,-0.522 -0.636,-0.736 -0.452,-0.436 -0.857,-0.897 -1.295,-1.264 -0.445,-0.37 -0.861,-0.717 -1.245,-1.037 -0.412,-0.287 -0.79,-0.55 -1.131,-0.788 -0.176,-0.12 -0.334,-0.245 -0.5,-0.344 -0.168,-0.098 -0.326,-0.19 -0.472,-0.274 -0.294,-0.17 -0.542,-0.315 -0.744,-0.433 -0.403,-0.242 -0.617,-0.371 -0.617,-0.371 0,0 0.248,0.04 0.71,0.116 0.23,0.041 0.515,0.092 0.848,0.152 0.167,0.031 0.347,0.063 0.537,0.097 0.191,0.044 0.389,0.115 0.603,0.178 0.427,0.129 0.903,0.285 1.428,0.459 0.502,0.205 1.029,0.463 1.608,0.726 0.298,0.121 0.566,0.306 0.856,0.48 0.289,0.178 0.588,0.361 0.893,0.55 0.318,0.176 0.584,0.43 0.89,0.656 0.184,0.147 0.377,0.297 0.569,0.45 0.002,10e-4 0.002,0.002 0.004,0.003 0,0 0,-0.002 -0.001,-0.002 -0.139,-0.39 -0.28,-0.769 -0.427,-1.136 -0.56,-1.452 -1.203,-2.72 -1.855,-3.808 -0.655,-1.084 -1.326,-1.986 -1.944,-2.682 -0.148,-0.181 -0.303,-0.337 -0.447,-0.487 -0.147,-0.148 -0.273,-0.303 -0.404,-0.428 -0.263,-0.251 -0.48,-0.479 -0.676,-0.646 -0.386,-0.344 -0.592,-0.527 -0.592,-0.527 0,0 0.256,0.101 0.737,0.29 0.468,0.21 1.185,0.528 2.006,1.068 0.105,0.066 0.21,0.134 0.318,0.208 0.757,0.507 1.613,1.175 2.467,2.049 0.978,0.995 1.973,2.238 2.879,3.693 0.458,0.726 0.88,1.508 1.308,2.321 0.411,0.819 0.801,1.678 1.185,2.564 0.254,0.606 0.497,1.231 0.738,1.863 0.112,0.293 0.224,0.584 0.335,0.883 0.117,0.316 0.228,0.64 0.34,0.963 0.21,0.601 0.416,1.207 0.624,1.818 0.009,0.03 0.019,0.059 0.03,0.089 0.624,1.917 1.269,3.897 1.926,5.91 0.164,0.493 0.338,0.985 0.511,1.472 0.08,0.225 0.161,0.452 0.241,0.679 0.179,0.481 0.359,0.957 0.54,1.433 0.063,0.168 0.127,0.335 0.19,0.501 0.213,0.555 0.429,1.105 0.652,1.647 0.7,1.744 1.496,3.394 2.375,4.916 0.234,0.368 0.441,0.761 0.692,1.108 0.244,0.352 0.488,0.703 0.73,1.052 0.534,0.646 1.044,1.311 1.635,1.871 0.543,0.619 1.203,1.078 1.793,1.613 0.318,0.235 0.649,0.449 0.97,0.675 0.16,0.112 0.321,0.223 0.479,0.334 0.165,0.102 0.338,0.192 0.504,0.288 0.338,0.191 0.67,0.381 0.998,0.566 0.325,0.196 0.686,0.312 1.018,0.479 0.218,0.099 0.429,0.196 0.641,0.295 C -0.259,0.043 -0.169,0.028 -0.078,0.013 -0.052,0.009 -0.026,0.004 0,0" /> diff --git a/logo/adafruit_blinka_angles-right.svg b/logo/adafruit_blinka_angles-right.svg index 51f9279aac..a448b19494 100644 --- a/logo/adafruit_blinka_angles-right.svg +++ b/logo/adafruit_blinka_angles-right.svg @@ -478,4 +478,4 @@ id="g5189"> \ No newline at end of file + d="m 0,0 c -0.752,-0.143 -1.588,-0.344 -2.515,-0.493 -0.923,-0.161 -1.92,-0.344 -2.98,-0.487 -1.056,-0.175 -2.179,-0.277 -3.334,-0.418 -0.576,-0.079 -1.169,-0.097 -1.765,-0.15 -0.597,-0.044 -1.2,-0.095 -1.81,-0.118 -0.611,-0.025 -1.224,-0.067 -1.842,-0.081 -0.616,-0.005 -1.236,-0.01 -1.858,-0.015 -0.619,-0.015 -1.24,0.014 -1.857,0.017 -0.619,0.002 -1.234,0.029 -1.844,0.066 -0.61,0.043 -1.217,0.044 -1.816,0.095 -0.599,0.043 -1.191,0.085 -1.774,0.126 -0.581,0.055 -1.154,0.109 -1.712,0.163 -0.563,0.044 -1.112,0.098 -1.644,0.164 -1.067,0.123 -2.08,0.231 -3.012,0.355 -1.87,0.242 -3.428,0.444 -4.52,0.586 -1.092,0.146 -1.721,0.21 -1.725,0.21 h -10e-4 c 0,0 0.597,-0.21 1.652,-0.545 0.525,-0.17 1.166,-0.37 1.91,-0.57 0.742,-0.21 1.581,-0.447 2.506,-0.656 0.462,-0.11 0.943,-0.225 1.442,-0.343 0.501,-0.1 1.02,-0.205 1.556,-0.311 1.066,-0.221 2.205,-0.396 3.382,-0.567 1.184,-0.135 2.406,-0.313 3.659,-0.376 0.423,-0.032 0.849,-0.056 1.277,-0.075 0.205,-0.009 0.409,-0.018 0.614,-0.023 0.634,-0.014 1.272,-0.053 1.909,-0.047 0.639,0.014 1.277,0.029 1.913,0.044 0.634,0.023 1.265,0.077 1.892,0.113 0.313,0.023 0.626,0.035 0.936,0.068 0.308,0.039 0.616,0.077 0.922,0.114 0.609,0.084 1.216,0.133 1.804,0.242 0.027,0.004 0.053,0.009 0.08,0.014 0.09,0.015 0.179,0.029 0.27,0.044 0.213,-0.098 0.424,-0.195 0.641,-0.294 0.332,-0.167 0.693,-0.283 1.018,-0.479 0.327,-0.186 0.661,-0.375 0.998,-0.566 0.167,-0.096 0.339,-0.186 0.503,-0.288 0.159,-0.111 0.32,-0.222 0.48,-0.334 0.321,-0.226 0.652,-0.44 0.971,-0.675 0.589,-0.535 1.25,-0.994 1.793,-1.614 0.59,-0.559 1.1,-1.224 1.635,-1.871 0.241,-0.348 0.485,-0.699 0.729,-1.051 0.251,-0.347 0.458,-0.74 0.693,-1.108 0.879,-1.522 1.676,-3.172 2.374,-4.916 0.481,-1.167 0.93,-2.368 1.382,-3.577 0.08,-0.227 0.161,-0.457 0.241,-0.684 0.174,-0.486 0.347,-0.978 0.513,-1.471 0.655,-2.013 1.3,-3.993 1.925,-5.91 0.328,-0.971 0.648,-1.933 0.993,-2.87 0.349,-0.938 0.702,-1.858 1.074,-2.747 0.384,-0.885 0.773,-1.744 1.185,-2.563 0.427,-0.814 0.848,-1.595 1.307,-2.321 0.906,-1.455 1.901,-2.699 2.879,-3.693 0.976,-0.999 1.955,-1.728 2.785,-2.258 0.822,-0.539 1.537,-0.857 2.006,-1.067 0.481,-0.189 0.738,-0.29 0.738,-0.29 0,0 -0.206,0.183 -0.592,0.527 -0.197,0.167 -0.414,0.395 -0.675,0.646 -0.132,0.125 -0.259,0.28 -0.405,0.428 -0.144,0.15 -0.299,0.306 -0.448,0.487 -0.618,0.696 -1.289,1.598 -1.944,2.682 -0.653,1.087 -1.293,2.356 -1.855,3.808 -0.147,0.368 -0.289,0.748 -0.427,1.138 0.193,-0.154 0.387,-0.305 0.573,-0.453 0.305,-0.226 0.571,-0.48 0.889,-0.657 0.306,-0.188 0.604,-0.372 0.893,-0.549 0.29,-0.174 0.559,-0.359 0.856,-0.48 0.58,-0.264 1.106,-0.521 1.608,-0.726 0.525,-0.174 1,-0.33 1.428,-0.459 0.214,-0.063 0.414,-0.134 0.603,-0.178 0.191,-0.034 0.37,-0.067 0.537,-0.097 0.334,-0.06 0.617,-0.111 0.848,-0.152 0.463,-0.076 0.71,-0.116 0.71,-0.116 0,0 -0.214,0.129 -0.616,0.371 -0.203,0.118 -0.452,0.262 -0.744,0.433 -0.147,0.084 -0.304,0.176 -0.473,0.274 -0.164,0.099 -0.324,0.223 -0.499,0.344 -0.342,0.238 -0.72,0.501 -1.132,0.788 -0.385,0.32 -0.801,0.667 -1.245,1.037 -0.438,0.367 -0.843,0.828 -1.296,1.264 -0.231,0.214 -0.416,0.49 -0.635,0.736 -0.21,0.256 -0.433,0.507 -0.641,0.777 -0.197,0.283 -0.398,0.57 -0.602,0.864 -0.103,0.145 -0.206,0.291 -0.31,0.439 -0.091,0.157 -0.184,0.317 -0.277,0.477 -0.189,0.317 -0.38,0.639 -0.574,0.967 -0.174,0.343 -0.349,0.691 -0.526,1.043 -0.691,1.423 -1.334,2.971 -1.91,4.655 -0.153,0.412 -0.285,0.846 -0.431,1.276 -0.146,0.431 -0.297,0.859 -0.436,1.306 -0.287,0.894 -0.578,1.798 -0.87,2.71 -0.001,0.002 -0.002,0.006 -0.003,0.008 -0.107,0.36 -0.215,0.717 -0.329,1.081 -0.161,0.507 -0.337,1.024 -0.523,1.56 -0.371,1.055 -0.745,2.109 -1.186,3.16 -0.873,2.095 -1.905,4.189 -3.238,6.108 -0.322,0.485 -0.679,0.952 -1.034,1.411 -0.379,0.446 -0.743,0.897 -1.151,1.314 -0.387,0.432 -0.815,0.825 -1.228,1.223 -0.443,0.37 -0.866,0.754 -1.33,1.083 -0.727,0.557 -1.486,1.044 -2.258,1.471 l 0.041,0.012 c 0.918,0.245 1.733,0.569 2.462,0.822 0.362,0.134 0.706,0.242 1.014,0.372 0.308,0.13 0.592,0.249 0.847,0.358 1.02,0.431 1.593,0.696 1.593,0.696 0,0 -0.16,-0.031 -0.455,-0.094 C 2.891,0.633 2.471,0.542 1.939,0.42 1.403,0.292 0.752,0.146 0,0" /> diff --git a/logo/adafruit_blinka_computer.svg b/logo/adafruit_blinka_computer.svg index 31753081ae..0d2e09976c 100644 --- a/logo/adafruit_blinka_computer.svg +++ b/logo/adafruit_blinka_computer.svg @@ -618,4 +618,4 @@ id="g14550"> \ No newline at end of file + d="m 0,0 c -0.161,-1.553 -0.126,-2.987 -0.026,-4.161 -12.803,0.01 -17.578,2.458 -17.578,4.003 0,2.687 7.455,7.852 17.653,7.852 0.88,0 1.737,-0.04 2.574,-0.112 C 1.191,5.452 0.3,2.902 0,0 M 8.064,6.59 C 13.921,4.923 17.7,1.755 17.7,-0.158 17.7,-1.499 14.1,-3.52 4.777,-4.036 4.5,-1.401 4.582,3.378 8.064,6.59 M -21.31,3.529 c -0.711,-1.182 -1.103,-2.424 -1.103,-3.687 0,-4.204 4.146,-6.26 7.624,-7.243 3.681,-1.041 8.673,-1.569 14.838,-1.569 6.164,0 11.156,0.528 14.836,1.569 3.478,0.983 7.625,3.039 7.625,7.243 0,5.128 -6.413,9.899 -14.761,11.796 0,0 -15.682,4.692 -29.059,-8.109" /> diff --git a/logo/adafruit_circuit_python_ourboros_color.svg b/logo/adafruit_circuit_python_ourboros_color.svg index d1177ef224..ef100abaa6 100644 --- a/logo/adafruit_circuit_python_ourboros_color.svg +++ b/logo/adafruit_circuit_python_ourboros_color.svg @@ -552,4 +552,4 @@ id="g15028"> \ No newline at end of file + d="m 0,0 c -7.64,-20.177 -18.594,-38.166 -32.558,-53.466 -31.154,-34.137 -74.877,-52.181 -126.439,-52.181 -13.743,0 -28.182,1.294 -42.917,3.847 -20.992,3.638 -45.356,14.012 -65.172,27.752 -19.049,13.208 -35.213,29.878 -48.041,49.546 -12.833,19.674 -21.686,41.363 -26.313,64.466 -4.794,23.932 -4.82,48.324 -0.078,72.499 4.046,20.626 11.412,40.168 21.894,58.083 10.127,17.309 22.929,32.718 38.048,45.797 17.472,15.115 37.416,26.563 59.279,34.026 l 4.237,1.448 -0.01,0.017 c 18.412,6.534 26.683,11.716 32.798,15.547 1.996,1.251 3.694,2.314 5.404,3.199 l -0.003,-0.015 c 0.302,0.165 0.618,0.32 0.931,0.477 l 1.265,0.562 c 3.218,1.427 6.819,2.392 10.703,2.866 1.684,0.205 3.382,0.309 5.047,0.309 4.639,0 8.782,-0.789 11.667,-2.221 0.876,-0.434 1.673,-0.872 2.406,-1.312 l 0.028,0.02 c 4.336,-2.605 6.388,-5.287 8.375,-7.895 2.487,-3.266 5.061,-6.643 11.633,-9.185 2.794,-1.081 5.784,-1.625 8.676,-2.152 4.078,-0.742 7.928,-1.443 8.946,-3.447 0.04,-0.079 0.074,-0.161 0.107,-0.246 0.01,-0.028 0.02,-0.056 0.029,-0.085 0.02,-0.058 0.039,-0.117 0.057,-0.178 0.008,-0.035 0.019,-0.071 0.025,-0.107 0.015,-0.058 0.028,-0.117 0.039,-0.177 0.006,-0.039 0.012,-0.077 0.019,-0.116 0.011,-0.065 0.017,-0.131 0.023,-0.197 0.003,-0.038 0.009,-0.075 0.011,-0.112 0.006,-0.1 0.01,-0.202 0.01,-0.307 0,-0.046 -0.002,-0.093 -0.004,-0.14 -0.001,-0.066 -0.002,-0.131 -0.006,-0.198 -0.004,-0.058 -0.01,-0.118 -0.015,-0.176 -0.006,-0.06 -0.011,-0.118 -0.018,-0.178 -0.008,-0.064 -0.016,-0.129 -0.025,-0.195 -0.007,-0.057 -0.018,-0.114 -0.028,-0.172 -0.011,-0.071 -0.023,-0.142 -0.037,-0.215 -0.011,-0.05 -0.021,-0.101 -0.033,-0.154 -0.037,-0.183 -0.082,-0.371 -0.137,-0.566 -0.003,-0.014 -0.006,-0.028 -0.01,-0.042 -0.025,-0.093 -0.054,-0.187 -0.082,-0.283 -0.014,-0.048 -0.029,-0.096 -0.043,-0.143 -0.03,-0.095 -0.061,-0.19 -0.093,-0.287 -0.017,-0.05 -0.033,-0.101 -0.053,-0.152 -0.033,-0.099 -0.068,-0.2 -0.106,-0.301 -0.017,-0.047 -0.036,-0.094 -0.052,-0.142 -0.043,-0.109 -0.084,-0.217 -0.129,-0.328 l -9.826,0.62 c -0.389,1.006 -1.333,1.749 -2.477,1.821 -1.57,0.1 -2.928,-1.098 -3.027,-2.666 -0.1,-1.569 1.096,-2.928 2.667,-3.027 1.144,-0.073 2.175,0.546 2.686,1.494 l 8.887,-0.562 h -0.002 c -1.279,-2.25 -3.256,-4.091 -5.805,-5.462 -0.013,-0.007 -0.027,-0.014 -0.041,-0.022 -0.156,-0.084 -0.316,-0.166 -0.478,-0.247 -0.031,-0.015 -0.063,-0.031 -0.096,-0.047 -0.149,-0.074 -0.303,-0.146 -0.455,-0.216 -0.047,-0.021 -0.092,-0.042 -0.137,-0.062 -0.145,-0.066 -0.292,-0.13 -0.439,-0.193 -0.057,-0.023 -0.114,-0.048 -0.172,-0.071 -0.141,-0.059 -0.284,-0.115 -0.428,-0.171 -0.066,-0.026 -0.133,-0.052 -0.2,-0.077 -0.138,-0.052 -0.279,-0.103 -0.421,-0.152 -0.074,-0.028 -0.15,-0.054 -0.226,-0.08 -0.136,-0.047 -0.274,-0.092 -0.412,-0.137 -0.084,-0.027 -0.168,-0.053 -0.252,-0.079 -0.135,-0.042 -0.271,-0.082 -0.409,-0.122 -0.089,-0.027 -0.18,-0.053 -0.273,-0.078 -0.133,-0.037 -0.268,-0.074 -0.402,-0.109 -0.098,-0.025 -0.197,-0.05 -0.296,-0.075 -0.132,-0.033 -0.265,-0.065 -0.4,-0.096 -0.103,-0.024 -0.21,-0.048 -0.314,-0.071 -0.133,-0.028 -0.264,-0.058 -0.398,-0.085 -0.11,-0.022 -0.221,-0.044 -0.335,-0.065 -0.13,-0.025 -0.26,-0.05 -0.392,-0.074 -0.119,-0.021 -0.237,-0.041 -0.356,-0.06 -0.129,-0.022 -0.259,-0.043 -0.388,-0.063 -0.125,-0.019 -0.252,-0.036 -0.377,-0.054 -0.128,-0.018 -0.254,-0.036 -0.383,-0.052 -0.133,-0.018 -0.268,-0.032 -0.402,-0.047 -0.123,-0.015 -0.248,-0.03 -0.373,-0.043 -0.144,-0.015 -0.287,-0.027 -0.43,-0.04 -0.121,-0.012 -0.239,-0.023 -0.361,-0.033 -0.156,-0.012 -0.313,-0.023 -0.471,-0.033 -0.11,-0.007 -0.221,-0.016 -0.334,-0.022 -0.18,-0.011 -0.361,-0.019 -0.543,-0.026 -0.092,-0.004 -0.185,-0.01 -0.277,-0.013 -0.276,-0.009 -0.553,-0.017 -0.833,-0.021 l -0.001,-0.001 c -0.112,-0.007 -0.5,-0.029 -1.112,-0.065 -0.181,-0.009 -0.383,-0.02 -0.603,-0.032 -0.207,-0.004 -0.432,-0.008 -0.671,-0.012 -0.241,-0.005 -0.497,-0.009 -0.767,-0.014 -0.269,-0.009 -0.563,0.009 -0.865,0.014 -0.303,0.007 -0.619,0.015 -0.947,0.023 -0.326,0.021 -0.664,0.042 -1.012,0.064 -0.699,0.032 -1.426,0.124 -2.188,0.202 -0.38,0.037 -0.761,0.108 -1.15,0.16 -0.391,0.058 -0.786,0.111 -1.18,0.192 -0.395,0.075 -0.793,0.15 -1.193,0.226 -0.396,0.092 -0.795,0.184 -1.193,0.277 -0.404,0.087 -0.796,0.197 -1.189,0.308 -0.391,0.115 -0.79,0.209 -1.172,0.34 -0.384,0.126 -0.766,0.251 -1.142,0.374 -0.377,0.126 -0.739,0.276 -1.102,0.41 -0.18,0.069 -0.359,0.137 -0.537,0.204 -0.177,0.071 -0.346,0.15 -0.517,0.224 -0.341,0.149 -0.675,0.295 -1,0.437 -0.318,0.159 -0.627,0.314 -0.925,0.463 -0.151,0.075 -0.297,0.149 -0.443,0.222 -0.142,0.074 -0.277,0.157 -0.413,0.233 -0.538,0.31 -1.041,0.583 -1.457,0.874 -0.42,0.281 -0.804,0.51 -1.086,0.739 -0.584,0.44 -0.919,0.691 -0.919,0.691 0.494,-1.396 1.127,-2.74 1.814,-4.059 0.166,-0.334 0.351,-0.657 0.534,-0.981 0.181,-0.326 0.368,-0.649 0.563,-0.967 0.384,-0.641 0.802,-1.262 1.219,-1.887 0.446,-0.606 0.876,-1.226 1.362,-1.808 0.464,-0.599 0.989,-1.153 1.498,-1.725 0.554,-0.538 1.067,-1.086 1.706,-1.602 l 0.463,-0.391 0.233,-0.194 0.223,-0.16 0.892,-0.643 0.056,-0.041 0.014,-0.01 0.065,-0.04 0.031,-0.018 0.123,-0.073 0.247,-0.145 0.495,-0.291 0.996,-0.576 c 0.335,-0.183 0.662,-0.399 1.006,-0.555 l 1.028,-0.487 1.033,-0.48 c 0.344,-0.164 0.69,-0.317 1.043,-0.447 l 2.109,-0.819 c 0.709,-0.255 1.426,-0.476 2.139,-0.715 0.404,-0.143 0.814,-0.264 1.226,-0.38 h -10e-4 l 0.003,-10e-4 c -6.951,-3.271 -13.928,1.633 -23.946,0.382 -0.571,-0.072 -1.15,-0.159 -1.742,-0.274 -0.03,-0.004 -0.063,-0.009 -0.093,-0.014 -0.167,-0.028 -0.338,-0.056 -0.511,-0.082 -0.111,-0.017 -0.224,-0.033 -0.337,-0.049 -0.169,-0.023 -0.337,-0.048 -0.512,-0.069 -0.264,-0.034 -0.533,-0.064 -0.81,-0.092 -0.136,-0.014 -0.278,-0.026 -0.418,-0.038 -0.19,-0.017 -0.382,-0.034 -0.577,-0.049 -0.139,-0.01 -0.279,-0.02 -0.42,-0.029 -0.222,-0.015 -0.448,-0.028 -0.677,-0.038 -0.117,-0.006 -0.232,-0.013 -0.35,-0.018 -0.347,-0.015 -0.697,-0.025 -1.056,-0.032 -0.066,-0.002 -0.135,-0.001 -0.201,-0.002 -0.228,-0.004 -0.457,-0.007 -0.69,-0.007 -0.055,0 -0.113,0.002 -0.168,0.002 -0.317,0.002 -0.638,0.008 -0.961,0.015 -0.143,0.003 -0.283,0.004 -0.428,0.008 -0.469,0.015 -0.943,0.036 -1.424,0.065 -0.041,0.002 -0.082,0.006 -0.123,0.009 -0.439,0.027 -0.884,0.06 -1.331,0.1 -0.161,0.014 -0.322,0.032 -0.483,0.048 -0.332,0.032 -0.666,0.066 -1.002,0.106 -0.188,0.023 -0.377,0.048 -0.566,0.072 -0.314,0.041 -0.629,0.085 -0.946,0.132 -0.196,0.029 -0.393,0.06 -0.59,0.092 -0.318,0.051 -0.636,0.107 -0.954,0.165 -0.193,0.036 -0.385,0.07 -0.578,0.108 -0.344,0.067 -0.688,0.141 -1.032,0.217 -0.165,0.036 -0.33,0.069 -0.495,0.108 -0.508,0.117 -1.016,0.242 -1.522,0.379 -0.343,0.092 -0.67,0.176 -0.989,0.255 -0.056,0.014 -0.112,0.028 -0.168,0.042 -0.303,0.075 -0.595,0.144 -0.877,0.208 -0.052,0.012 -0.103,0.023 -0.155,0.035 -0.577,0.129 -1.11,0.237 -1.605,0.326 -0.044,0.008 -0.09,0.017 -0.133,0.025 -0.235,0.041 -0.462,0.078 -0.68,0.111 -0.041,0.006 -0.081,0.012 -0.122,0.017 -0.222,0.033 -0.438,0.063 -0.643,0.087 -0.003,10e-4 -0.006,10e-4 -0.01,10e-4 -0.203,0.025 -0.397,0.044 -0.585,0.062 -0.036,0.003 -0.072,0.007 -0.108,0.01 -0.179,0.015 -0.352,0.028 -0.519,0.037 -0.036,0.002 -0.07,0.004 -0.105,0.006 -0.168,0.008 -0.333,0.015 -0.489,0.018 h -0.019 c -0.1,0.002 -0.198,0.004 -0.293,0.004 -0.025,0 -0.045,-0.002 -0.069,-0.002 -0.234,-0.001 -0.457,-0.007 -0.668,-0.018 -0.035,-0.002 -0.068,-0.005 -0.103,-0.007 -0.192,-0.012 -0.375,-0.027 -0.551,-0.044 -0.031,-0.003 -0.063,-0.005 -0.092,-0.009 -0.191,-0.02 -0.374,-0.042 -0.552,-0.066 -0.043,-0.006 -0.085,-0.012 -0.127,-0.018 -0.168,-0.024 -0.333,-0.049 -0.495,-0.073 -0.951,-0.15 -1.898,-0.312 -2.843,-0.479 -0.642,-0.113 -1.28,-0.234 -1.919,-0.356 -0.13,-0.025 -0.262,-0.049 -0.392,-0.074 -6.123,-1.178 -12.111,-2.713 -17.94,-4.59 -3.091,-0.995 -6.137,-2.086 -9.134,-3.269 -0.776,-0.306 -1.551,-0.614 -2.321,-0.932 -8.949,-3.706 -17.445,-8.242 -25.384,-13.521 -0.695,-0.462 -1.384,-0.932 -2.07,-1.405 -7.989,-5.512 -15.391,-11.786 -22.09,-18.738 -0.578,-0.6 -1.15,-1.207 -1.718,-1.817 -6.609,-7.1 -12.499,-14.875 -17.556,-23.231 -0.431,-0.713 -0.857,-1.429 -1.276,-2.15 -4.85,-8.344 -8.881,-17.246 -11.979,-26.619 -0.261,-0.79 -0.512,-1.585 -0.76,-2.382 -2.84,-9.125 -4.799,-18.682 -5.788,-28.592 -0.082,-0.827 -0.158,-1.657 -0.227,-2.489 -0.339,-4.096 -0.52,-8.249 -0.52,-12.457 0,-5.623 0.317,-11.171 0.916,-16.635 0.091,-0.829 0.18,-1.659 0.284,-2.484 1.231,-9.752 3.399,-19.211 6.399,-28.292 0.262,-0.792 0.531,-1.581 0.805,-2.367 3.207,-9.193 7.275,-17.979 12.111,-26.264 0.42,-0.72 0.841,-1.44 1.272,-2.152 5.007,-8.261 10.785,-16.001 17.231,-23.125 0.559,-0.618 1.128,-1.227 1.698,-1.836 6.555,-7.011 13.771,-13.395 21.549,-19.056 0.673,-0.49 1.349,-0.977 2.032,-1.457 7.808,-5.489 16.157,-10.26 24.956,-14.211 0.76,-0.341 1.524,-0.673 2.29,-1.002 8.714,-3.739 17.851,-6.678 27.32,-8.735 0.813,-0.177 1.628,-0.351 2.446,-0.515 9.228,-1.843 18.759,-2.842 28.511,-2.922 0.417,-0.003 0.832,-0.015 1.25,-0.015 0.418,0 0.833,0.012 1.25,0.015 9.751,0.08 19.281,1.079 28.51,2.922 0.818,0.164 1.633,0.338 2.445,0.515 9.469,2.057 18.606,4.996 27.321,8.735 0.765,0.329 1.53,0.661 2.29,1.002 8.797,3.951 17.147,8.722 24.956,14.21 0.681,0.48 1.357,0.967 2.031,1.457 7.777,5.662 14.994,12.046 21.55,19.057 0.569,0.609 1.137,1.218 1.697,1.836 6.446,7.124 12.224,14.865 17.231,23.125 0.432,0.713 0.852,1.432 1.272,2.152 4.836,8.285 8.904,17.071 12.111,26.263 0.274,0.786 0.543,1.575 0.805,2.367 3,9.082 5.168,18.541 6.4,28.293 0.104,0.825 0.193,1.654 0.284,2.484 0.598,5.463 0.916,11.012 0.916,16.635 0,4.195 -0.182,8.348 -0.517,12.457 -0.067,0.832 -0.138,1.663 -0.218,2.491 -0.969,9.855 -2.889,19.429 -5.658,28.636 -0.24,0.799 -0.481,1.597 -0.734,2.39 -2.999,9.397 -6.897,18.392 -11.585,26.89 -0.404,0.73 -0.812,1.456 -1.226,2.179 -4.895,8.534 -10.591,16.549 -16.998,23.932 -0.547,0.629 -1.104,1.25 -1.66,1.87 -7.627,8.502 -16.203,16.134 -25.564,22.729 -0.662,0.467 -1.329,0.928 -1.999,1.384 -0.198,0.135 -0.398,0.267 -0.598,0.402 -0.477,0.321 -0.954,0.641 -1.435,0.958 -0.224,0.147 -0.45,0.292 -0.676,0.438 -0.465,0.303 -0.931,0.604 -1.4,0.901 -0.219,0.139 -0.439,0.276 -0.658,0.413 -0.488,0.306 -0.977,0.61 -1.469,0.911 -0.196,0.12 -0.393,0.239 -0.59,0.358 -0.531,0.321 -1.065,0.64 -1.601,0.955 -0.157,0.092 -0.315,0.185 -0.471,0.276 -0.603,0.351 -1.207,0.698 -1.814,1.041 -0.093,0.052 -0.186,0.106 -0.28,0.158 -5.937,3.336 -12.123,6.28 -18.521,8.801 -0.057,0.025 -0.113,0.05 -0.168,0.074 -1.451,0.614 -2.889,1.156 -4.303,1.614 -0.066,0.021 -0.133,0.045 -0.199,0.065 l -0.025,0.016 -0.293,0.174 c 34.572,-7.316 63.56,-24.111 84.956,-49.504 C -12.854,157.081 -3.269,139.703 3.101,120.309 9.257,101.564 12.173,81.713 11.767,61.306 11.347,40.137 7.388,19.511 0,0 m -25.675,177.617 c -0.002,0.001 -0.002,0.002 -0.003,0.003 -0.458,0.51 -0.919,1.018 -1.384,1.523 -0.005,0.005 -0.011,0.011 -0.016,0.017 -0.464,0.503 -0.931,1.003 -1.401,1.5 l -0.014,0.014 c -4.756,5.016 -9.903,9.737 -15.442,14.116 -0.033,0.027 -0.068,0.053 -0.101,0.08 -0.508,0.401 -1.02,0.798 -1.533,1.193 l -0.223,0.17 c -0.477,0.365 -0.955,0.727 -1.437,1.086 -0.1,0.075 -0.201,0.148 -0.301,0.223 -0.459,0.34 -0.92,0.678 -1.384,1.014 -0.118,0.086 -0.236,0.171 -0.355,0.256 -0.449,0.323 -0.902,0.644 -1.355,0.962 -0.131,0.092 -0.26,0.183 -0.391,0.274 -0.447,0.311 -0.896,0.621 -1.348,0.929 l -0.41,0.278 c -0.451,0.304 -0.902,0.605 -1.356,0.905 -0.14,0.092 -0.28,0.185 -0.42,0.277 -0.456,0.298 -0.915,0.595 -1.376,0.89 -0.139,0.089 -0.279,0.178 -0.419,0.267 -0.469,0.298 -0.94,0.593 -1.413,0.885 -0.133,0.083 -0.265,0.166 -0.398,0.248 -0.492,0.301 -0.988,0.601 -1.485,0.898 -0.115,0.07 -0.23,0.14 -0.347,0.209 -0.534,0.318 -1.071,0.632 -1.61,0.944 -0.081,0.047 -0.16,0.094 -0.242,0.141 -0.618,0.356 -1.24,0.709 -1.867,1.058 -10e-4,0.001 -0.002,0.002 -0.004,0.002 -1.921,1.07 -3.877,2.105 -5.868,3.103 -0.048,0.023 -0.096,0.046 -0.144,0.07 -0.599,0.3 -1.202,0.597 -1.808,0.89 -0.143,0.069 -0.285,0.136 -0.428,0.204 -0.514,0.247 -1.03,0.493 -1.55,0.735 -0.187,0.087 -0.376,0.173 -0.565,0.26 -0.476,0.22 -0.953,0.439 -1.434,0.655 -0.217,0.097 -0.434,0.193 -0.652,0.289 -0.455,0.202 -0.911,0.403 -1.37,0.602 -0.238,0.102 -0.475,0.203 -0.712,0.304 -0.444,0.189 -0.887,0.377 -1.332,0.562 -0.252,0.105 -0.506,0.209 -0.76,0.313 -0.436,0.179 -0.872,0.356 -1.311,0.531 -0.262,0.105 -0.525,0.209 -0.789,0.313 -0.433,0.17 -0.869,0.339 -1.305,0.506 -0.271,0.104 -0.54,0.207 -0.812,0.309 -0.435,0.164 -0.871,0.326 -1.308,0.487 -0.276,0.101 -0.551,0.202 -0.829,0.302 -0.438,0.159 -0.878,0.315 -1.32,0.47 -0.277,0.097 -0.554,0.195 -0.832,0.291 -0.446,0.155 -0.895,0.306 -1.346,0.458 -0.276,0.093 -0.552,0.186 -0.83,0.278 -0.459,0.151 -0.921,0.3 -1.382,0.448 -0.271,0.086 -0.54,0.174 -0.811,0.26 -0.482,0.152 -0.968,0.3 -1.453,0.448 -0.254,0.078 -0.508,0.157 -0.763,0.233 -0.522,0.157 -1.047,0.309 -1.573,0.461 -0.222,0.065 -0.443,0.131 -0.666,0.194 -0.623,0.178 -1.249,0.351 -1.877,0.523 -0.127,0.035 -0.254,0.071 -0.382,0.105 -1.524,0.413 -3.063,0.807 -4.618,1.182 -0.217,0.052 -0.436,0.102 -0.652,0.154 -0.555,0.131 -1.111,0.263 -1.669,0.39 -0.285,0.064 -0.572,0.126 -0.857,0.19 -0.495,0.109 -0.99,0.22 -1.488,0.326 -0.316,0.068 -0.633,0.132 -0.95,0.198 -0.473,0.098 -0.945,0.197 -1.42,0.291 -0.334,0.067 -0.67,0.131 -1.005,0.197 -0.461,0.089 -0.923,0.178 -1.387,0.264 -0.347,0.065 -0.697,0.128 -1.047,0.191 -0.455,0.082 -0.91,0.163 -1.367,0.242 -0.357,0.063 -0.719,0.122 -1.078,0.183 -0.453,0.075 -0.906,0.15 -1.361,0.222 -0.366,0.058 -0.732,0.115 -1.098,0.171 -0.455,0.07 -0.911,0.138 -1.368,0.205 -0.369,0.054 -0.739,0.107 -1.11,0.159 -0.457,0.064 -0.917,0.127 -1.377,0.188 -0.375,0.05 -0.748,0.099 -1.124,0.147 -0.462,0.059 -0.926,0.115 -1.39,0.171 -0.377,0.045 -0.754,0.09 -1.131,0.133 -0.469,0.054 -0.939,0.105 -1.41,0.155 -0.377,0.04 -0.754,0.081 -1.133,0.12 -0.478,0.049 -0.959,0.094 -1.439,0.14 -0.375,0.035 -0.748,0.071 -1.123,0.105 -0.495,0.044 -0.991,0.084 -1.488,0.125 -0.366,0.029 -0.731,0.061 -1.098,0.089 -0.522,0.04 -1.047,0.076 -1.572,0.112 -0.344,0.023 -0.688,0.049 -1.034,0.071 -0.587,0.038 -1.177,0.07 -1.766,0.104 -0.289,0.016 -0.575,0.034 -0.863,0.049 -0.881,0.046 -1.764,0.086 -2.653,0.122 0,0 0.59,-0.065 1.615,-0.197 l -1.615,0.197 c 0,0 40.553,-8.103 74.257,-34.671 6.396,-5.111 12.381,-10.751 17.852,-16.85 0.535,-0.595 1.087,-1.21 1.62,-1.825 6.257,-7.21 11.844,-15.075 16.607,-23.38 0.391,-0.683 0.794,-1.399 1.197,-2.129 4.618,-8.371 8.425,-17.208 11.316,-26.263 0.25,-0.786 0.492,-1.585 0.716,-2.334 2.738,-9.098 4.596,-18.508 5.526,-27.97 0.081,-0.824 0.15,-1.654 0.214,-2.434 0.335,-4.104 0.505,-8.199 0.505,-12.172 0,-5.364 -0.301,-10.833 -0.895,-16.254 l -0.031,-0.277 c -0.081,-0.744 -0.158,-1.445 -0.246,-2.15 -1.182,-9.356 -3.286,-18.654 -6.251,-27.633 -0.246,-0.744 -0.503,-1.5 -0.786,-2.312 -3.102,-8.887 -7.082,-17.517 -11.829,-25.651 l -0.027,-0.045 c -0.397,-0.681 -0.809,-1.385 -1.217,-2.058 -4.857,-8.014 -10.521,-15.616 -16.832,-22.592 -0.553,-0.61 -1.14,-1.239 -1.659,-1.792 -6.399,-6.843 -13.482,-13.107 -21.053,-18.618 -0.794,-0.577 -1.405,-1.016 -1.985,-1.423 -7.668,-5.391 -15.869,-10.061 -24.376,-13.88 -0.644,-0.289 -1.333,-0.591 -2.237,-0.979 -8.567,-3.677 -17.545,-6.547 -26.682,-8.531 -0.754,-0.164 -1.564,-0.338 -2.39,-0.503 -9.096,-1.817 -18.466,-2.778 -27.851,-2.855 -0.186,-0.002 -0.369,-0.004 -0.553,-0.007 -0.223,-0.004 -0.445,-0.008 -0.669,-0.008 -0.223,0 -0.446,0.004 -0.669,0.008 -0.183,0.003 -0.368,0.005 -0.553,0.007 -9.385,0.077 -18.756,1.038 -27.854,2.855 -0.825,0.165 -1.635,0.339 -2.388,0.503 -9.138,1.984 -18.115,4.854 -26.683,8.531 -0.907,0.39 -1.597,0.692 -2.237,0.979 -8.506,3.819 -16.709,8.489 -24.377,13.88 -0.578,0.407 -1.19,0.846 -1.985,1.424 -7.569,5.51 -14.652,11.774 -21.052,18.617 -0.587,0.626 -1.124,1.202 -1.658,1.792 -6.311,6.976 -11.975,14.577 -16.833,22.591 -0.408,0.673 -0.819,1.377 -1.217,2.058 l -0.027,0.047 c -4.748,8.134 -8.728,16.764 -11.828,25.65 -0.288,0.826 -0.545,1.583 -0.786,2.313 -2.967,8.98 -5.07,18.277 -6.251,27.633 -0.088,0.7 -0.164,1.397 -0.245,2.135 l -0.032,0.291 c -0.594,5.421 -0.895,10.89 -0.895,16.254 0,3.993 0.171,8.087 0.509,12.168 0.066,0.808 0.141,1.626 0.221,2.432 0.95,9.523 2.85,18.91 5.647,27.898 0.292,0.939 0.52,1.655 0.741,2.324 2.981,9.018 6.912,17.751 11.682,25.958 0.389,0.669 0.808,1.375 1.244,2.096 4.892,8.083 10.653,15.707 17.124,22.66 0.614,0.659 1.162,1.239 1.677,1.773 6.512,6.759 13.765,12.91 21.556,18.285 0.743,0.513 1.405,0.961 2.021,1.371 7.772,5.168 16.111,9.61 24.785,13.202 0.762,0.316 1.538,0.623 2.267,0.911 2.923,1.154 5.925,2.228 8.921,3.193 5.697,1.834 11.595,3.342 17.529,4.484 l 0.379,0.072 0.089,0.017 c 0.597,0.113 1.192,0.226 1.79,0.332 1.093,0.192 1.976,0.341 2.779,0.468 0.679,0.102 1.284,0.194 2.113,0.194 1.61,0 3.767,-0.368 6.595,-1.125 5.343,-1.442 10.295,-1.745 13.508,-1.745 2.88,0 5.613,0.238 7.903,0.69 0.028,0.005 0.06,0.009 0.088,0.015 0,0.001 -0.001,0.002 -0.001,0.003 9.582,2.158 12.655,-1.566 19.878,-0.942 10.129,0.875 15.048,5.307 15.048,5.307 l -4.599,0.95 c -0.661,0.136 -1.375,0.295 -2.063,0.461 -0.695,0.164 -1.391,0.326 -2.08,0.521 -0.689,0.189 -1.384,0.36 -2.066,0.571 -0.683,0.207 -1.373,0.398 -2.051,0.618 l -2.019,0.684 c -0.685,0.21 -1.316,0.516 -1.981,0.763 l -0.392,0.153 c -3.685,1.591 -7.777,4.721 -9.509,7.465 0,0 5.863,-2.928 18.288,-3.385 0.894,-0.045 1.66,-0.058 2.271,-0.056 0.006,0 0.011,-0.001 0.017,-0.001 l -0.002,0.001 c 0.484,0.001 0.871,0.012 1.14,0.023 0.146,0.007 0.296,0.015 0.441,0.022 h 0.004 c 0.304,0.016 0.604,0.034 0.893,0.063 0.533,0.039 1.037,0.098 1.503,0.149 0.466,0.046 0.889,0.12 1.27,0.167 0.379,0.049 0.71,0.102 0.981,0.149 0.196,0.033 0.363,0.058 0.496,0.078 0.021,0.003 0.037,0.006 0.056,0.008 1.546,0.402 2.994,0.914 4.337,1.528 0.023,0.012 0.048,0.021 0.071,0.032 0.034,0.015 0.063,0.03 0.092,0.044 0.383,0.179 0.755,0.365 1.119,0.56 0.17,0.09 0.338,0.182 0.502,0.276 0.166,0.095 0.334,0.187 0.496,0.286 0.334,0.202 0.657,0.414 0.973,0.631 0.076,0.052 0.151,0.101 0.226,0.154 0.368,0.26 0.721,0.53 1.062,0.811 0.017,0.013 0.033,0.026 0.05,0.04 1.498,1.236 2.734,2.661 3.695,4.269 0.004,0.006 0.008,0.013 0.012,0.02 0.238,0.4 0.461,0.809 0.666,1.232 0.521,1.073 0.935,2.074 1.244,3.01 0.389,1.17 0.612,2.238 0.674,3.22 0.088,1.374 -0.143,2.576 -0.687,3.646 -1.231,2.427 -3.817,3.589 -6.917,4.37 -0.005,0.002 -0.013,0.004 -0.019,0.006 -0.231,0.058 -0.467,0.113 -0.703,0.167 -0.053,0.012 -0.105,0.025 -0.156,0.037 -0.024,0.006 -0.047,0.01 -0.07,0.015 -1.141,0.255 -2.337,0.474 -3.55,0.695 -0.21,0.037 -0.419,0.076 -0.63,0.115 l -0.367,0.067 c -0.13,0.023 -0.261,0.049 -0.391,0.074 -0.209,0.039 -0.416,0.077 -0.625,0.117 -0.144,0.028 -0.286,0.058 -0.43,0.086 -0.195,0.038 -0.39,0.077 -0.584,0.117 -0.151,0.032 -0.303,0.066 -0.453,0.098 -0.186,0.04 -0.369,0.078 -0.553,0.12 -0.156,0.035 -0.31,0.074 -0.467,0.111 -0.176,0.043 -0.354,0.084 -0.529,0.128 -0.155,0.04 -0.308,0.083 -0.462,0.123 -0.175,0.046 -0.348,0.093 -0.522,0.143 -0.151,0.043 -0.299,0.09 -0.448,0.135 -0.172,0.053 -0.345,0.104 -0.515,0.161 -0.145,0.047 -0.285,0.099 -0.43,0.148 -0.215,0.075 -0.431,0.15 -0.641,0.231 -0.163,0.062 -0.322,0.126 -0.478,0.189 -0.05,0.021 -0.098,0.041 -0.146,0.061 -0.108,0.045 -0.214,0.089 -0.32,0.134 -0.053,0.023 -0.106,0.047 -0.16,0.069 -0.101,0.045 -0.201,0.088 -0.3,0.134 -0.049,0.021 -0.096,0.043 -0.144,0.065 -0.118,0.054 -0.235,0.108 -0.348,0.162 -0.025,0.013 -0.053,0.024 -0.077,0.037 -0.138,0.066 -0.274,0.133 -0.407,0.201 -0.036,0.018 -0.073,0.037 -0.109,0.056 -0.096,0.049 -0.192,0.099 -0.286,0.149 -0.045,0.024 -0.089,0.048 -0.133,0.071 -0.086,0.047 -0.17,0.093 -0.255,0.141 -0.042,0.023 -0.085,0.048 -0.127,0.071 -0.09,0.052 -0.179,0.103 -0.267,0.155 -0.032,0.019 -0.065,0.037 -0.096,0.056 -0.117,0.07 -0.233,0.141 -0.345,0.212 -0.024,0.014 -0.045,0.028 -0.066,0.042 -0.092,0.058 -0.183,0.116 -0.271,0.174 -0.036,0.024 -0.073,0.048 -0.109,0.073 -0.073,0.048 -0.145,0.098 -0.218,0.147 -0.037,0.026 -0.076,0.052 -0.113,0.078 -0.073,0.051 -0.142,0.103 -0.215,0.153 -0.031,0.023 -0.063,0.047 -0.095,0.069 -0.1,0.074 -0.2,0.149 -0.297,0.223 -0.002,10e-4 -0.002,0.003 -0.004,0.003 -0.096,0.074 -0.19,0.148 -0.283,0.222 -0.03,0.025 -0.059,0.048 -0.088,0.073 -0.066,0.052 -0.129,0.105 -0.192,0.157 -0.033,0.028 -0.065,0.056 -0.097,0.083 -0.061,0.052 -0.121,0.103 -0.182,0.156 -0.029,0.026 -0.059,0.052 -0.088,0.078 -0.071,0.063 -0.14,0.126 -0.211,0.19 -0.015,0.014 -0.032,0.029 -0.048,0.044 -0.084,0.078 -0.167,0.156 -0.249,0.234 -0.024,0.023 -0.047,0.046 -0.072,0.069 -0.057,0.057 -0.115,0.114 -0.173,0.171 -0.028,0.029 -0.057,0.058 -0.085,0.087 -0.052,0.053 -0.105,0.106 -0.156,0.159 -0.029,0.029 -0.057,0.058 -0.085,0.087 -0.056,0.058 -0.111,0.117 -0.167,0.176 -0.019,0.023 -0.041,0.045 -0.062,0.067 -0.077,0.082 -0.151,0.164 -0.223,0.245 -0.017,0.018 -0.032,0.036 -0.049,0.054 -0.058,0.065 -0.115,0.13 -0.172,0.195 -0.025,0.029 -0.053,0.06 -0.078,0.088 -0.047,0.056 -0.094,0.111 -0.141,0.166 -0.025,0.031 -0.052,0.062 -0.079,0.094 -0.047,0.056 -0.095,0.113 -0.143,0.169 -0.024,0.029 -0.047,0.057 -0.071,0.087 -0.066,0.081 -0.134,0.162 -0.2,0.245 -0.003,10e-4 -0.003,0.003 -0.005,0.006 0.086,0.117 0.17,0.235 0.245,0.364 0.109,0.177 0.214,0.356 0.302,0.543 0.097,0.181 0.174,0.369 0.25,0.553 0.079,0.18 0.134,0.368 0.196,0.541 0.05,0.179 0.103,0.347 0.138,0.51 0.039,0.164 0.071,0.316 0.094,0.459 0.099,0.565 0.092,0.939 0.092,0.939 0,0 -0.18,-0.329 -0.526,-0.747 -0.084,-0.105 -0.18,-0.214 -0.284,-0.326 -0.1,-0.112 -0.219,-0.223 -0.335,-0.337 -0.125,-0.107 -0.243,-0.224 -0.38,-0.323 -0.131,-0.105 -0.264,-0.206 -0.407,-0.294 -0.135,-0.095 -0.279,-0.176 -0.418,-0.25 -0.056,-0.033 -0.113,-0.061 -0.17,-0.087 -0.047,0.06 -0.092,0.12 -0.138,0.181 -2.041,2.677 -4.317,5.653 -8.951,8.522 -0.038,0.024 -0.078,0.048 -0.117,0.072 -0.259,0.159 -0.521,0.317 -0.795,0.475 -0.129,0.075 -0.265,0.149 -0.398,0.224 -0.203,0.114 -0.403,0.228 -0.615,0.341 -0.365,0.197 -0.742,0.393 -1.133,0.587 -0.258,0.128 -0.526,0.25 -0.798,0.369 -0.08,0.034 -0.161,0.068 -0.241,0.102 -0.208,0.087 -0.42,0.172 -0.637,0.254 -0.08,0.03 -0.16,0.061 -0.241,0.092 -0.29,0.106 -0.584,0.209 -0.887,0.305 -0.031,0.011 -0.064,0.02 -0.097,0.03 -0.273,0.087 -0.552,0.169 -0.835,0.247 -0.096,0.027 -0.192,0.053 -0.289,0.078 -0.241,0.064 -0.485,0.126 -0.733,0.184 -0.088,0.021 -0.174,0.042 -0.262,0.063 -0.328,0.074 -0.661,0.145 -0.999,0.21 -0.059,0.012 -0.12,0.021 -0.179,0.033 -0.286,0.053 -0.574,0.103 -0.865,0.149 -0.107,0.017 -0.215,0.034 -0.323,0.05 -0.271,0.04 -0.546,0.078 -0.823,0.113 -0.088,0.011 -0.176,0.023 -0.264,0.034 -0.359,0.042 -0.722,0.08 -1.087,0.113 -0.079,0.006 -0.159,0.012 -0.238,0.019 -0.295,0.024 -0.593,0.046 -0.892,0.063 -0.115,0.007 -0.23,0.014 -0.345,0.02 -0.301,0.015 -0.604,0.028 -0.908,0.037 -0.082,0.002 -0.163,0.006 -0.245,0.008 -0.343,0.008 -0.688,0.013 -1.036,0.013 -0.031,0 -0.062,-0.002 -0.094,-0.002 -0.252,0 -0.508,-0.006 -0.763,-0.011 -0.188,-0.004 -0.375,-0.005 -0.564,-0.011 -0.266,-0.008 -0.535,-0.024 -0.803,-0.037 -0.18,-0.009 -0.358,-0.015 -0.538,-0.026 -0.298,-0.018 -0.597,-0.044 -0.896,-0.068 -0.152,-0.013 -0.303,-0.021 -0.455,-0.035 -0.452,-0.042 -0.904,-0.09 -1.358,-0.145 -4.254,-0.519 -8.218,-1.596 -11.699,-3.142 l 0.001,0.006 c -8.665,-3.624 -13.565,-10.559 -42.812,-20.606 -0.098,-0.033 -0.197,-0.068 -0.295,-0.101 -0.405,-0.139 -0.813,-0.278 -1.228,-0.417 l 0.001,-0.002 c -21.967,-7.499 -42.581,-19.244 -60.438,-34.692 -15.41,-13.331 -28.457,-29.035 -38.78,-46.677 -10.68,-18.254 -18.185,-38.164 -22.306,-59.176 -4.831,-24.627 -4.804,-49.477 0.08,-73.861 4.715,-23.541 13.736,-45.642 26.813,-65.69 13.077,-20.049 29.556,-37.043 48.979,-50.51 20.118,-13.95 45.189,-24.62 66.568,-28.324 0.992,-0.172 1.981,-0.338 2.967,-0.498 0.356,-0.058 0.709,-0.111 1.064,-0.167 0.627,-0.1 1.254,-0.2 1.879,-0.295 0.425,-0.063 0.847,-0.124 1.27,-0.187 0.552,-0.081 1.104,-0.163 1.655,-0.24 0.453,-0.063 0.904,-0.124 1.355,-0.185 0.516,-0.071 1.032,-0.14 1.546,-0.207 0.467,-0.061 0.932,-0.119 1.397,-0.176 0.497,-0.063 0.994,-0.124 1.49,-0.183 0.471,-0.055 0.94,-0.109 1.409,-0.163 0.488,-0.055 0.976,-0.109 1.462,-0.162 0.47,-0.051 0.939,-0.1 1.408,-0.147 0.482,-0.05 0.964,-0.098 1.445,-0.144 0.467,-0.046 0.933,-0.09 1.398,-0.132 0.482,-0.044 0.962,-0.086 1.442,-0.127 0.46,-0.039 0.92,-0.078 1.379,-0.115 0.484,-0.038 0.966,-0.074 1.447,-0.109 0.452,-0.035 0.903,-0.068 1.352,-0.099 0.495,-0.034 0.988,-0.064 1.481,-0.095 0.43,-0.027 0.861,-0.055 1.291,-0.08 0.525,-0.03 1.048,-0.055 1.572,-0.082 0.394,-0.02 0.789,-0.042 1.181,-0.059 0.598,-0.028 1.192,-0.05 1.787,-0.074 0.315,-0.011 0.633,-0.026 0.948,-0.037 0.911,-0.031 1.82,-0.057 2.724,-0.078 0.033,0 0.065,-0.001 0.099,-0.001 0.873,-0.019 1.743,-0.034 2.61,-0.043 0.274,-0.003 0.547,-0.003 0.82,-0.005 0.546,-0.004 1.093,-0.009 1.637,-0.009 0.076,0 0.151,0.001 0.228,0.001 0.348,0 0.695,0.004 1.042,0.006 0.548,0.003 1.096,0.006 1.642,0.013 0.365,0.005 0.73,0.013 1.094,0.02 0.523,0.008 1.048,0.018 1.568,0.031 0.375,0.01 0.748,0.021 1.122,0.033 0.509,0.016 1.018,0.031 1.525,0.05 0.377,0.014 0.753,0.03 1.129,0.046 0.5,0.021 0.999,0.044 1.497,0.068 0.377,0.019 0.752,0.039 1.127,0.06 0.495,0.027 0.989,0.055 1.482,0.086 0.373,0.023 0.745,0.047 1.117,0.072 0.492,0.033 0.985,0.068 1.475,0.104 0.368,0.028 0.735,0.056 1.102,0.085 0.493,0.039 0.982,0.081 1.471,0.123 0.361,0.032 0.723,0.064 1.083,0.097 0.495,0.046 0.987,0.094 1.481,0.143 0.35,0.035 0.701,0.07 1.05,0.106 0.502,0.053 1.001,0.109 1.501,0.165 0.336,0.038 0.673,0.075 1.008,0.115 0.52,0.061 1.035,0.125 1.551,0.191 0.312,0.039 0.625,0.077 0.935,0.118 0.549,0.071 1.094,0.147 1.641,0.223 0.275,0.039 0.551,0.075 0.825,0.115 0.61,0.087 1.216,0.18 1.821,0.272 0.208,0.033 0.417,0.062 0.626,0.095 0.785,0.123 1.565,0.251 2.343,0.383 0.028,0.004 0.054,0.009 0.08,0.013 1.643,0.279 3.27,0.579 4.884,0.897 0.122,0.024 0.242,0.05 0.364,0.074 0.672,0.134 1.344,0.271 2.012,0.412 0.192,0.04 0.383,0.083 0.575,0.124 0.594,0.128 1.187,0.257 1.777,0.389 0.226,0.052 0.451,0.104 0.676,0.156 0.556,0.127 1.111,0.255 1.664,0.387 0.238,0.058 0.474,0.116 0.712,0.174 0.537,0.131 1.073,0.262 1.606,0.397 0.244,0.062 0.486,0.125 0.73,0.188 0.526,0.136 1.049,0.272 1.573,0.412 0.243,0.064 0.486,0.131 0.728,0.197 0.522,0.142 1.041,0.285 1.559,0.431 0.238,0.067 0.474,0.135 0.712,0.203 0.522,0.149 1.044,0.302 1.563,0.456 0.229,0.067 0.455,0.135 0.682,0.203 0.527,0.159 1.054,0.32 1.579,0.484 0.216,0.067 0.431,0.134 0.645,0.202 0.539,0.17 1.075,0.342 1.61,0.517 0.196,0.065 0.392,0.128 0.589,0.193 0.559,0.185 1.115,0.373 1.67,0.563 0.168,0.058 0.336,0.114 0.505,0.173 0.591,0.204 1.18,0.412 1.767,0.622 0.129,0.047 0.259,0.092 0.388,0.139 0.647,0.233 1.29,0.47 1.93,0.711 0.069,0.025 0.135,0.049 0.203,0.075 5.069,1.907 9.959,4.029 14.674,6.349 0.019,0.01 0.037,0.02 0.057,0.03 0.648,0.318 1.292,0.641 1.933,0.967 0.043,0.023 0.085,0.044 0.127,0.067 0.62,0.316 1.237,0.636 1.85,0.959 0.051,0.027 0.102,0.054 0.152,0.081 0.608,0.32 1.21,0.644 1.811,0.972 0.051,0.027 0.103,0.056 0.154,0.084 0.603,0.329 1.201,0.662 1.798,0.998 0.044,0.024 0.089,0.049 0.134,0.075 0.607,0.344 1.213,0.69 1.815,1.041 0.028,0.015 0.056,0.032 0.083,0.048 0.625,0.364 1.246,0.732 1.866,1.104 0.002,0.002 0.005,0.003 0.007,0.005 90.995,54.734 105.94,188.322 39.592,262.371" /> diff --git a/logo/adafruit_circuit_python_ouroboros_logo_final.svg b/logo/adafruit_circuit_python_ouroboros_logo_final.svg index 051966d4ac..2c71fd8ecf 100644 --- a/logo/adafruit_circuit_python_ouroboros_logo_final.svg +++ b/logo/adafruit_circuit_python_ouroboros_logo_final.svg @@ -93,4 +93,4 @@ id="g3884"> \ No newline at end of file + d="M 0,0 V -0.002 C -0.52,0.546 -1.049,1.08 -1.595,1.603 -1.68,1.685 -1.767,1.766 -1.853,1.848 V -3.94 C -1.219,-4.651 -0.59,-5.367 0,-6.117 V -6.39 -41.674 h 6.278 v 24.966 c 0.379,-0.889 0.738,-1.784 1.062,-2.698 h 4.22 c -0.584,1.809 -1.27,3.573 -2.044,5.289 -0.068,0.148 -0.132,0.299 -0.203,0.444 -0.223,0.483 -0.454,0.961 -0.693,1.436 -0.08,0.158 -0.161,0.317 -0.244,0.475 -0.246,0.481 -0.498,0.961 -0.761,1.431 -0.039,0.07 -0.08,0.138 -0.119,0.207 -0.39,0.691 -0.797,1.369 -1.218,2.041 v 0.008 C 4.458,-5.172 2.353,-2.469 0,0" /> diff --git a/logo/adafruit_circuit_python_sitting_color.svg b/logo/adafruit_circuit_python_sitting_color.svg index 6da7f5ca86..266a46c550 100644 --- a/logo/adafruit_circuit_python_sitting_color.svg +++ b/logo/adafruit_circuit_python_sitting_color.svg @@ -603,4 +603,4 @@ id="g15548"> \ No newline at end of file + d="m 0,0 2.273,0.622 4.532,1.288 3.56,1.055 0.953,0.284 3.297,0.977 -3.418,0.88 C 10.492,5.286 9.781,5.434 9.072,5.595 L 7.842,5.871 C 7.83,6.408 7.809,6.947 7.771,7.484 7.715,8.318 7.629,9.149 7.506,9.98 7.26,11.64 6.895,13.296 6.273,14.906 5.967,15.71 5.6,16.505 5.135,17.275 4.664,18.041 4.1,18.797 3.291,19.425 c -0.803,0.631 -1.986,1.054 -3.164,0.789 -1.143,-0.253 -1.971,-0.959 -2.57,-1.664 -0.219,-0.259 -0.411,-0.527 -0.588,-0.798 -0.094,0.037 -0.182,0.071 -0.282,0.109 -0.171,0.07 -0.351,0.143 -0.535,0.218 -0.193,0.07 -0.355,0.168 -0.529,0.264 -0.176,0.1 -0.353,0.199 -0.527,0.296 -0.178,0.101 -0.319,0.224 -0.479,0.336 -0.148,0.118 -0.32,0.223 -0.435,0.348 -0.131,0.125 -0.252,0.244 -0.366,0.352 -0.115,0.114 -0.195,0.229 -0.281,0.331 -0.088,0.102 -0.154,0.193 -0.201,0.273 -0.107,0.158 -0.152,0.263 -0.152,0.263 0,0 -0.026,-0.106 -0.034,-0.305 -0.009,-0.103 -0.009,-0.227 0,-0.365 0.01,-0.139 0.01,-0.305 0.036,-0.477 0.029,-0.175 0.062,-0.365 0.097,-0.564 0.03,-0.212 0.106,-0.404 0.166,-0.623 0.071,-0.212 0.129,-0.454 0.223,-0.669 0.1,-0.219 0.197,-0.443 0.297,-0.664 0.103,-0.225 0.205,-0.46 0.332,-0.657 0.127,-0.208 0.25,-0.412 0.371,-0.611 0.123,-0.198 0.24,-0.4 0.363,-0.575 0.127,-0.168 0.248,-0.326 0.362,-0.472 0.029,-0.037 0.054,-0.069 0.084,-0.104 C -4.588,14.254 -4.658,14.053 -4.715,13.852 -5.174,12.229 -5.428,10.579 -5.543,8.93 -5.604,8.105 -5.641,7.283 -5.629,6.46 -5.613,5.631 -5.588,4.821 -5.504,4.002 -5.451,3.186 -5.316,2.377 -5.189,1.57 -5.055,0.76 -4.871,-0.027 -4.662,-0.812 L -4.721,0.404 -4.74,1.613 c -0.002,0.311 0.004,0.623 0.008,0.935 0.009,0.491 0.025,0.981 0.048,1.47 0.03,0.797 0.098,1.603 0.184,2.387 0.088,0.792 0.184,1.579 0.324,2.359 0.278,1.556 0.649,3.089 1.162,4.547 0.262,0.728 0.563,1.433 0.916,2.093 0.356,0.654 0.746,1.281 1.207,1.773 0.454,0.501 0.983,0.835 1.436,0.902 0.109,0.022 0.24,0.024 0.326,0.013 L 1.02,18.079 C 1.076,18.076 1.066,18.065 1.09,18.06 1.121,18.05 1.154,18.047 1.219,18.021 1.443,17.946 1.674,17.809 1.906,17.631 2.371,17.262 2.801,16.707 3.162,16.093 3.521,15.474 3.832,14.794 4.088,14.086 4.35,13.378 4.551,12.642 4.746,11.897 4.936,11.154 5.09,10.394 5.213,9.627 5.467,8.095 5.574,6.533 5.621,4.968 L 5.65,4.019 6.529,3.881 7.182,3.778 6.295,3.452 2.693,2.085 1.889,1.778 1.393,1.584 C 1.41,1.861 1.418,2.143 1.418,2.429 1.418,4.665 0.945,6.616 0.244,7.695 0.027,7.144 -0.27,6.802 -0.6,6.802 c -0.449,0 -0.834,0.639 -1.035,1.57 -1.039,-0.7 -1.804,-3.092 -1.804,-5.943 0,-0.955 0.087,-1.857 0.242,-2.664 -0.436,-0.177 -0.867,-0.353 -1.301,-0.531 -0.787,-0.326 -1.572,-0.654 -2.357,-0.995 1.535,0.36 3.056,0.755 4.578,1.15 z" /> diff --git a/logo/adafruit_circuit_python_stacked_lockup_logo_final.svg b/logo/adafruit_circuit_python_stacked_lockup_logo_final.svg index 3fbce7126e..62d7f66367 100644 --- a/logo/adafruit_circuit_python_stacked_lockup_logo_final.svg +++ b/logo/adafruit_circuit_python_stacked_lockup_logo_final.svg @@ -74,4 +74,4 @@ id="g3772"> \ No newline at end of file + d="M 0,0 5.74,24.865 H 2.239 L -3.499,0 Z" /> diff --git a/logo/awesome_circuitpython.svg b/logo/awesome_circuitpython.svg index f60b0c6593..53225310be 100644 --- a/logo/awesome_circuitpython.svg +++ b/logo/awesome_circuitpython.svg @@ -633,4 +633,4 @@ id="g16074"> \ No newline at end of file + d="m 0,0 h 4.107 v -2.053 c 0.948,1.217 2.162,2.324 4.241,2.324 3.108,0 4.921,-2.054 4.921,-5.378 v -9.375 H 9.161 v 8.077 c 0,1.946 -0.922,2.947 -2.485,2.947 -1.571,0 -2.569,-1.001 -2.569,-2.947 v -8.077 H 0 Z" /> diff --git a/logo/blinka_colorform-cooking.svg b/logo/blinka_colorform-cooking.svg index d108479f75..8f169ede9b 100644 --- a/logo/blinka_colorform-cooking.svg +++ b/logo/blinka_colorform-cooking.svg @@ -1082,4 +1082,4 @@ id="g17854"> \ No newline at end of file + d="M 0,0 C -4.549,0 -8.826,-0.083 -12.044,-0.235 -17.5,-0.492 -17.5,-0.762 -17.5,-1.301 c 0,-0.538 0,-0.808 5.456,-1.066 3.218,-0.151 7.495,-0.235 12.044,-0.235 4.549,0 8.826,0.084 12.044,0.235 5.456,0.258 5.456,0.528 5.456,1.066 0,0.539 0,0.809 -5.456,1.066 C 8.826,-0.083 4.549,0 0,0 m 0,-0.5 c 9.389,0 17,-0.358 17,-0.801 0,-0.442 -7.611,-0.801 -17,-0.801 -9.389,0 -17,0.359 -17,0.801 0,0.443 7.611,0.801 17,0.801" /> diff --git a/logo/blinka_colorform-first-birthday.svg b/logo/blinka_colorform-first-birthday.svg index 37626864c3..9b4a5d30d6 100644 --- a/logo/blinka_colorform-first-birthday.svg +++ b/logo/blinka_colorform-first-birthday.svg @@ -883,4 +883,4 @@ id="tspan20612" y="0" x="0">1 - \ No newline at end of file + diff --git a/logo/blinka_colorform-painting.svg b/logo/blinka_colorform-painting.svg index c7493207ac..33252883d1 100644 --- a/logo/blinka_colorform-painting.svg +++ b/logo/blinka_colorform-painting.svg @@ -1019,4 +1019,4 @@ id="g21156"> \ No newline at end of file + d="m 0,0 c 0,0 0.227,0.497 0.522,1.411 0.284,0.912 0.644,2.254 0.721,3.922 0.064,1.659 -0.203,3.658 -1.092,5.584 -0.874,1.93 -2.358,3.705 -4.093,5.105 -0.436,0.36 -0.869,0.688 -1.35,1.006 -0.456,0.299 -0.885,0.61 -1.396,0.866 -0.975,0.566 -1.991,0.951 -3.004,1.268 -1.03,0.251 -2.045,0.451 -3.024,0.425 -0.972,-0.013 -1.889,-0.131 -2.699,-0.369 -0.817,-0.211 -1.527,-0.525 -2.123,-0.849 -0.589,-0.341 -1.07,-0.681 -1.447,-0.98 -0.373,-0.308 -0.651,-0.564 -0.823,-0.757 -0.177,-0.184 -0.272,-0.283 -0.272,-0.283 0,0 0.109,0.082 0.314,0.236 0.199,0.16 0.513,0.365 0.908,0.625 0.403,0.247 0.908,0.518 1.507,0.774 0.611,0.226 1.293,0.495 2.078,0.63 0.774,0.168 1.637,0.213 2.534,0.16 0.902,-0.037 1.836,-0.241 2.779,-0.513 0.922,-0.326 1.897,-0.691 2.77,-1.223 0.448,-0.228 0.901,-0.549 1.358,-0.838 0.428,-0.273 0.868,-0.602 1.277,-0.933 0.827,-0.666 1.599,-1.397 2.278,-2.184 0.682,-0.785 1.243,-1.645 1.698,-2.52 C 0.347,8.811 0.706,6.937 0.731,5.337 0.784,3.729 0.56,2.38 0.356,1.454 0.161,0.523 0,0 0,0" /> diff --git a/logo/blinka_colorform-reading.svg b/logo/blinka_colorform-reading.svg index 761895ac06..fc57b6f800 100644 --- a/logo/blinka_colorform-reading.svg +++ b/logo/blinka_colorform-reading.svg @@ -903,4 +903,4 @@ transform="translate(266.938,449.3901)"> \ No newline at end of file + d="m 0,0 -0.031,0.008 -39.606,10.181 0.063,0.243 L 0,0.258 39.574,10.432 39.637,10.189 Z" /> diff --git a/logo/blinka_colorform-singing.svg b/logo/blinka_colorform-singing.svg index ec22f43627..f64c034c11 100644 --- a/logo/blinka_colorform-singing.svg +++ b/logo/blinka_colorform-singing.svg @@ -1034,4 +1034,4 @@ style="fill:#e80e8a;fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 0,0 h 0.006 c 0,0 -0.006,0.001 -0.007,0.001 -0.53,0.417 -1.547,0.95 -3.369,1.006 -2.13,0.065 -3.564,0.182 -4.913,0.526 -0.15,0.051 -0.3,0.098 -0.447,0.154 -0.531,0.165 -1.046,0.366 -1.542,0.59 -0.511,0.198 -0.973,0.469 -1.434,0.706 -0.444,0.262 -0.878,0.516 -1.268,0.788 -0.389,0.273 -0.748,0.542 -1.055,0.824 -1.269,1.086 -1.791,2.109 -1.791,2.109 0,0 0.087,-0.269 0.335,-0.699 0.123,-0.215 0.29,-0.465 0.498,-0.742 0.213,-0.27 0.453,-0.582 0.765,-0.873 0.297,-0.308 0.648,-0.608 1.031,-0.912 0.383,-0.303 0.81,-0.597 1.268,-0.871 0.468,-0.253 0.941,-0.543 1.459,-0.754 0.506,-0.242 1.029,-0.46 1.569,-0.636 0.534,-0.196 1.081,-0.344 1.624,-0.474 0.538,-0.149 1.073,-0.266 1.597,-0.347 0.337,-0.056 0.662,-0.115 0.983,-0.162 0.769,-0.117 1.44,-0.26 2.023,-0.438 0.661,-0.2 1.22,-0.444 1.674,-0.754 0.488,-0.334 0.858,-0.746 1.147,-1.244 0.157,-0.297 0.315,-0.592 0.445,-0.919 0.059,-0.14 0.115,-0.283 0.17,-0.427 0.016,-0.043 0.033,-0.086 0.049,-0.129 0.047,-0.125 0.094,-0.248 0.141,-0.373 0.02,-0.059 0.041,-0.117 0.062,-0.176 0.045,-0.127 0.09,-0.254 0.133,-0.383 0.17,-0.521 0.338,-1.035 0.5,-1.533 0.002,-0.008 0.005,-0.016 0.008,-0.024 0.054,-0.158 0.107,-0.316 0.162,-0.472 0.029,-0.082 0.056,-0.166 0.088,-0.25 0.029,-0.076 0.058,-0.153 0.087,-0.229 0.063,-0.164 0.126,-0.326 0.191,-0.482 0.1,-0.231 0.201,-0.453 0.308,-0.666 0.111,-0.211 0.22,-0.414 0.339,-0.604 0.235,-0.377 0.494,-0.699 0.747,-0.957 0.222,-0.226 0.445,-0.4 0.64,-0.533 0.028,-0.017 0.057,-0.035 0.083,-0.053 0.213,-0.14 0.4,-0.222 0.521,-0.277 0.125,-0.049 0.191,-0.076 0.191,-0.076 0,0 -0.054,0.049 -0.154,0.137 -0.051,0.043 -0.107,0.103 -0.175,0.168 -0.034,0.033 -0.067,0.072 -0.105,0.111 -0.037,0.039 -0.078,0.08 -0.116,0.127 -0.161,0.18 -0.335,0.414 -0.505,0.695 -0.169,0.283 -0.336,0.611 -0.48,0.988 -0.039,0.096 -0.076,0.194 -0.111,0.295 0.05,-0.039 0.099,-0.078 0.148,-0.117 0.079,-0.058 0.148,-0.123 0.23,-0.17 0.081,-0.049 0.157,-0.095 0.233,-0.142 0.074,-0.045 0.144,-0.094 0.222,-0.125 0.15,-0.069 0.287,-0.135 0.417,-0.188 0.136,-0.045 0.259,-0.086 0.371,-0.119 0.055,-0.018 0.107,-0.035 0.156,-0.047 0.049,-0.008 0.096,-0.017 0.14,-0.025 0.086,-0.016 0.16,-0.03 0.219,-0.039 0.121,-0.02 0.184,-0.03 0.184,-0.03 0,0 -0.055,0.034 -0.16,0.096 C 5.481,-9.119 5.417,-9.082 5.34,-9.039 5.301,-9.015 5.26,-8.992 5.217,-8.966 5.174,-8.941 5.133,-8.91 5.087,-8.878 4.999,-8.816 4.901,-8.748 4.793,-8.673 4.694,-8.589 4.586,-8.5 4.47,-8.404 4.357,-8.308 4.252,-8.189 4.134,-8.076 4.075,-8.021 4.026,-7.949 3.969,-7.884 3.915,-7.818 3.858,-7.753 3.803,-7.683 3.752,-7.609 3.7,-7.535 3.647,-7.458 3.62,-7.421 3.593,-7.382 3.567,-7.345 3.542,-7.304 3.518,-7.263 3.495,-7.22 3.446,-7.138 3.396,-7.054 3.346,-6.97 3.3,-6.88 3.254,-6.791 3.208,-6.699 3.03,-6.33 2.864,-5.929 2.713,-5.49 c -0.04,0.106 -0.074,0.219 -0.111,0.33 -0.039,0.112 -0.078,0.223 -0.114,0.338 -0.074,0.233 -0.15,0.467 -0.226,0.705 v 0.002 c -0.029,0.092 -0.056,0.186 -0.086,0.28 -0.041,0.132 -0.088,0.265 -0.135,0.406 -0.072,0.205 -0.145,0.41 -0.225,0.615 -0.026,0.068 -0.054,0.135 -0.083,0.203 -0.17,0.409 -0.363,0.816 -0.596,1.204 -0.076,0.131 -0.158,0.258 -0.245,0.383 -0.083,0.126 -0.176,0.247 -0.267,0.366 -0.046,0.053 -0.093,0.103 -0.138,0.157 l 0.006,-0.003 c 0,0 -0.116,0.193 -0.41,0.442 C 0.059,-0.043 0.027,-0.021 0,0" /> \ No newline at end of file + id="g20008" /> diff --git a/logo/blinka_colorform-telescope.svg b/logo/blinka_colorform-telescope.svg index 8b3724171b..081b9cb685 100644 --- a/logo/blinka_colorform-telescope.svg +++ b/logo/blinka_colorform-telescope.svg @@ -962,4 +962,4 @@ id="g17204"> \ No newline at end of file + d="m 0,0 c 0,-0.838 -0.686,-1.518 -1.525,-1.518 -0.837,0 -1.518,0.68 -1.518,1.518 0,0.839 0.681,1.519 1.518,1.519 C -0.686,1.519 0,0.839 0,0" /> diff --git a/logo/blinka_colorform-test_tubes.svg b/logo/blinka_colorform-test_tubes.svg index b6b939d2f0..62e5a572e0 100644 --- a/logo/blinka_colorform-test_tubes.svg +++ b/logo/blinka_colorform-test_tubes.svg @@ -1214,4 +1214,4 @@ d="m 0,0 c 3.464,0.942 2.658,10.376 2.658,10.376 h -14.301 -12.299 c 0,0 -1.419,-9.774 4.78,-10.567 6.046,-0.773 4.318,7.167 15.929,5.897" /> \ No newline at end of file + d="m 154.293,494.23 h -27.616 v 0.917 h 27.616 z" /> diff --git a/mpy-cross/mpconfigport.h b/mpy-cross/mpconfigport.h index 04f9a24d5c..1a8b4880da 100644 --- a/mpy-cross/mpconfigport.h +++ b/mpy-cross/mpconfigport.h @@ -128,7 +128,7 @@ X(ENOTEMPTY) \ X(EILSEQ) #endif - + // type definitions for the specific machine #ifdef __LP64__ diff --git a/ports/atmel-samd/boards/8086_commander/pins.c b/ports/atmel-samd/boards/8086_commander/pins.c index 3eea4009e7..728da3f6b2 100644 --- a/ports/atmel-samd/boards/8086_commander/pins.c +++ b/ports/atmel-samd/boards/8086_commander/pins.c @@ -2,7 +2,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - // Serial + // Serial { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, // RX { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, // TX diff --git a/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c b/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c index b418d0f1b9..1e9ab029e2 100644 --- a/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c +++ b/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -// Updated to support Alorium Technology Evo M51 +// Updated to support Alorium Technology Evo M51 // Author: Bryan Craker // Date: 2020-05-20 diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/pins.c b/ports/atmel-samd/boards/capablerobot_usbhub/pins.c index b1966930c7..f7ad82c579 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/pins.c +++ b/ports/atmel-samd/boards/capablerobot_usbhub/pins.c @@ -4,7 +4,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_ANMB), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ANVLIM), MP_ROM_PTR(&pin_PA04) }, { MP_OBJ_NEW_QSTR(MP_QSTR_AN5V), MP_ROM_PTR(&pin_PA05) }, - + { MP_OBJ_NEW_QSTR(MP_QSTR_MBPWM), MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MBINT), MP_ROM_PTR(&pin_PA15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MBCS), MP_ROM_PTR(&pin_PA18) }, diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.h b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.h index 592160b84f..321436c6b7 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.h @@ -32,4 +32,4 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 -#define IGNORE_PIN_PA25 1 \ No newline at end of file +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index 19e5dd2ab9..a71728e2db 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -15,4 +15,3 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_VECTORIO = 0 - diff --git a/ports/atmel-samd/boards/datum_distance/pins.c b/ports/atmel-samd/boards/datum_distance/pins.c index b29a859b64..8e4f1101e8 100644 --- a/ports/atmel-samd/boards/datum_distance/pins.c +++ b/ports/atmel-samd/boards/datum_distance/pins.c @@ -14,7 +14,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, diff --git a/ports/atmel-samd/boards/datum_imu/pins.c b/ports/atmel-samd/boards/datum_imu/pins.c index 237b5774ec..eabd2567ef 100644 --- a/ports/atmel-samd/boards/datum_imu/pins.c +++ b/ports/atmel-samd/boards/datum_imu/pins.c @@ -16,7 +16,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, diff --git a/ports/atmel-samd/boards/datum_light/pins.c b/ports/atmel-samd/boards/datum_light/pins.c index b29a859b64..8e4f1101e8 100644 --- a/ports/atmel-samd/boards/datum_light/pins.c +++ b/ports/atmel-samd/boards/datum_light/pins.c @@ -14,7 +14,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, diff --git a/ports/atmel-samd/boards/datum_weather/pins.c b/ports/atmel-samd/boards/datum_weather/pins.c index b29a859b64..8e4f1101e8 100644 --- a/ports/atmel-samd/boards/datum_weather/pins.c +++ b/ports/atmel-samd/boards/datum_weather/pins.c @@ -14,7 +14,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, diff --git a/ports/atmel-samd/boards/escornabot_makech/pins.c b/ports/atmel-samd/boards/escornabot_makech/pins.c index d43d254e71..fefee19199 100644 --- a/ports/atmel-samd/boards/escornabot_makech/pins.c +++ b/ports/atmel-samd/boards/escornabot_makech/pins.c @@ -9,11 +9,11 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { // Buttons { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA03) }, - - + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA01) }, - + // Motors { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA11) }, @@ -23,10 +23,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA17) }, - + // Buzzer { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA16) }, - + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA13) }, @@ -34,7 +34,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { //UART { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA00) }, - + // I2C { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk index 7cb53bd130..4946788d3e 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk @@ -12,4 +12,3 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ CIRCUITPY_VECTORIO = 1 - diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk index 3aa7c5721a..e9d94638af 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk @@ -18,4 +18,3 @@ CIRCUITPY_AUDIOIO = 0 # Too much flash for Korean translations CIRCUITPY_VECTORIO = 0 - diff --git a/ports/atmel-samd/boards/hallowing_m4_express/pins.c b/ports/atmel-samd/boards/hallowing_m4_express/pins.c index 9365ea3caf..388a85d56f 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/pins.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/pins.c @@ -40,7 +40,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA21) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23) }, - + { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_PB31) }, diff --git a/ports/atmel-samd/boards/kicksat-sprite/board.c b/ports/atmel-samd/boards/kicksat-sprite/board.c index fc53f39675..75cdfbc824 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/board.c +++ b/ports/atmel-samd/boards/kicksat-sprite/board.c @@ -38,4 +38,4 @@ bool board_requests_safe_mode(void) { } void reset_board(void) { -} \ No newline at end of file +} diff --git a/ports/atmel-samd/boards/kicksat-sprite/pins.c b/ports/atmel-samd/boards/kicksat-sprite/pins.c index 03af22ff26..87d894c589 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/pins.c +++ b/ports/atmel-samd/boards/kicksat-sprite/pins.c @@ -22,7 +22,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) }, - + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA16) }, @@ -30,9 +30,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PB03) }, - + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h index 4bd01706df..ed8f15856c 100644 --- a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h +++ b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h @@ -23,6 +23,3 @@ // Enable the use of 2 displays #define CIRCUITPY_DISPLAY_LIMIT (2) - - - diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h index 869f207a16..51be8d7c06 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h @@ -29,4 +29,3 @@ // USB is always used. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 - diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk index 5e5f0ff5fd..09804bc4e7 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk @@ -12,4 +12,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c index 6d1fc53b6d..2ea5630079 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c @@ -23,7 +23,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA05) }, - + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA09) }, diff --git a/ports/atmel-samd/boards/pycubed/board.c b/ports/atmel-samd/boards/pycubed/board.c index 31b0812094..9d29d2a66a 100644 --- a/ports/atmel-samd/boards/pycubed/board.c +++ b/ports/atmel-samd/boards/pycubed/board.c @@ -58,4 +58,4 @@ void reset_board(void) { common_hal_nvm_bytearray_get_bytes(&bootcnt,0,1,&value_out); ++value_out; common_hal_nvm_bytearray_set_bytes(&bootcnt,0,&value_out,1); -} \ No newline at end of file +} diff --git a/ports/atmel-samd/boards/pycubed/mpconfigboard.h b/ports/atmel-samd/boards/pycubed/mpconfigboard.h index 8d046c75bd..fc16e22b59 100644 --- a/ports/atmel-samd/boards/pycubed/mpconfigboard.h +++ b/ports/atmel-samd/boards/pycubed/mpconfigboard.h @@ -17,7 +17,7 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) -// External flash W25Q80DV +// External flash W25Q80DV #define EXTERNAL_FLASH_QSPI_DUAL #define BOARD_HAS_CRYSTAL 1 diff --git a/ports/atmel-samd/boards/pycubed/pins.c b/ports/atmel-samd/boards/pycubed/pins.c index 4c97f58a80..e494fb54bf 100644 --- a/ports/atmel-samd/boards/pycubed/pins.c +++ b/ports/atmel-samd/boards/pycubed/pins.c @@ -40,16 +40,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_EN_GPS), MP_ROM_PTR(&pin_PB01) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB03) }, - + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB13) }, { MP_ROM_QSTR(MP_QSTR_WDT_WDI), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA21) }, - + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - + }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/pycubed_mram/board.c b/ports/atmel-samd/boards/pycubed_mram/board.c index 31b0812094..9d29d2a66a 100644 --- a/ports/atmel-samd/boards/pycubed_mram/board.c +++ b/ports/atmel-samd/boards/pycubed_mram/board.c @@ -58,4 +58,4 @@ void reset_board(void) { common_hal_nvm_bytearray_get_bytes(&bootcnt,0,1,&value_out); ++value_out; common_hal_nvm_bytearray_set_bytes(&bootcnt,0,&value_out,1); -} \ No newline at end of file +} diff --git a/ports/atmel-samd/boards/pygamer/pins.c b/ports/atmel-samd/boards/pygamer/pins.c index 7e6eff43f9..107d780a8a 100644 --- a/ports/atmel-samd/boards/pygamer/pins.c +++ b/ports/atmel-samd/boards/pygamer/pins.c @@ -44,7 +44,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB23) }, // SDCS, dup of D4 - { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA14) }, // Special named pins { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, diff --git a/ports/atmel-samd/boards/pygamer_advance/pins.c b/ports/atmel-samd/boards/pygamer_advance/pins.c index 9c2284db1a..653a1bb2ef 100644 --- a/ports/atmel-samd/boards/pygamer_advance/pins.c +++ b/ports/atmel-samd/boards/pygamer_advance/pins.c @@ -44,7 +44,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB23) }, // SDCS, dup of D4 - { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA14) }, // Special named pins { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, diff --git a/ports/atmel-samd/boards/robohatmm1_m4/pins.c b/ports/atmel-samd/boards/robohatmm1_m4/pins.c index 4fc290fb0a..74dcfd651f 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/pins.c +++ b/ports/atmel-samd/boards/robohatmm1_m4/pins.c @@ -83,7 +83,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SWCLK), MP_ROM_PTR(&pin_PA30) }, { MP_ROM_QSTR(MP_QSTR_PI_GP24), MP_ROM_PTR(&pin_PA31) }, { MP_ROM_QSTR(MP_QSTR_SWDIO), MP_ROM_PTR(&pin_PA31) }, - + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, //{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, diff --git a/ports/atmel-samd/boards/sam32/board.c b/ports/atmel-samd/boards/sam32/board.c index 7a23d30070..e032601440 100644 --- a/ports/atmel-samd/boards/sam32/board.c +++ b/ports/atmel-samd/boards/sam32/board.c @@ -49,4 +49,4 @@ void reset_board(void) { common_hal_digitalio_digitalinout_switch_to_output(&neopixel, false, DRIVE_MODE_PUSH_PULL); common_hal_neopixel_write(&neopixel, zeroes, 96); common_hal_digitalio_digitalinout_deinit(&neopixel); -} \ No newline at end of file +} diff --git a/ports/atmel-samd/boards/sam32/mpconfigboard.mk b/ports/atmel-samd/boards/sam32/mpconfigboard.mk index 1187449355..1dc686ef8a 100644 --- a/ports/atmel-samd/boards/sam32/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sam32/mpconfigboard.mk @@ -14,4 +14,4 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_USTACK = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel \ No newline at end of file +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/atmel-samd/boards/sam32/pins.c b/ports/atmel-samd/boards/sam32/pins.c index f0a5b2b626..463615960f 100644 --- a/ports/atmel-samd/boards/sam32/pins.c +++ b/ports/atmel-samd/boards/sam32/pins.c @@ -42,12 +42,12 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_TDI), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_TMS), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_ESP_CS),MP_ROM_PTR(&pin_PB15) }, - + { MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_PB16) }, { MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_PB17) }, - + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, @@ -56,11 +56,11 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, - + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PA06) }, - + }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/serpente/pins.c b/ports/atmel-samd/boards/serpente/pins.c index 0bf6866561..7b7b14799e 100644 --- a/ports/atmel-samd/boards/serpente/pins.c +++ b/ports/atmel-samd/boards/serpente/pins.c @@ -37,4 +37,3 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); - diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c index f9d755d935..9562dc3b80 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c @@ -21,14 +21,14 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA23) }, - + // External SPI { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - // UART + // UART { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c index f9d755d935..9562dc3b80 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c @@ -21,14 +21,14 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA23) }, - + // External SPI { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - // UART + // UART { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, diff --git a/ports/atmel-samd/common-hal/countio/Counter.c b/ports/atmel-samd/common-hal/countio/Counter.c index db5b325b8f..d2e3fae630 100644 --- a/ports/atmel-samd/common-hal/countio/Counter.c +++ b/ports/atmel-samd/common-hal/countio/Counter.c @@ -25,20 +25,20 @@ void common_hal_countio_counter_construct(countio_counter_obj_t* self, // These default settings apply when the EIC isn't yet enabled. self->eic_channel_a = pin_a->extint_channel; - + self->pin_a = pin_a->number; - + gpio_set_pin_function(self->pin_a, GPIO_PIN_FUNCTION_A); gpio_set_pin_pull_mode(self->pin_a, GPIO_PULL_UP); set_eic_channel_data(self->eic_channel_a, (void*) self); self->count = 0; - + claim_pin(pin_a); - - + + set_eic_handler(self->eic_channel_a, EIC_HANDLER_COUNTER); turn_on_eic_channel(self->eic_channel_a, EIC_CONFIG_SENSE0_FALL_Val); @@ -77,7 +77,7 @@ void common_hal_countio_counter_reset(countio_counter_obj_t* self){ void counter_interrupt_handler(uint8_t channel) { countio_counter_obj_t* self = get_eic_channel_data(channel); - + self->count += 1; - + } diff --git a/ports/atmel-samd/common-hal/neopixel_write/__init__.c b/ports/atmel-samd/common-hal/neopixel_write/__init__.c index 1755270253..5c79f72a40 100644 --- a/ports/atmel-samd/common-hal/neopixel_write/__init__.c +++ b/ports/atmel-samd/common-hal/neopixel_write/__init__.c @@ -150,4 +150,3 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, mp_hal_enable_all_interrupts(); } - diff --git a/ports/atmel-samd/common-hal/supervisor/__init__.c b/ports/atmel-samd/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100755 --- a/ports/atmel-samd/common-hal/supervisor/__init__.c +++ b/ports/atmel-samd/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/cxd56/boards/spresense/mpconfigboard.h b/ports/cxd56/boards/spresense/mpconfigboard.h index c53f6b418c..adfcbacb9e 100644 --- a/ports/cxd56/boards/spresense/mpconfigboard.h +++ b/ports/cxd56/boards/spresense/mpconfigboard.h @@ -38,4 +38,3 @@ #define DEFAULT_UART_BUS_TX (&pin_UART2_TXD) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) - diff --git a/ports/cxd56/common-hal/busio/I2C.c b/ports/cxd56/common-hal/busio/I2C.c index c163c183a9..127b6e75cd 100644 --- a/ports/cxd56/common-hal/busio/I2C.c +++ b/ports/cxd56/common-hal/busio/I2C.c @@ -79,7 +79,7 @@ bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) { return self->has_lock; } - + void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { self->has_lock = false; } diff --git a/ports/cxd56/common-hal/busio/SPI.c b/ports/cxd56/common-hal/busio/SPI.c index 9a41011f2a..718a8ff16e 100644 --- a/ports/cxd56/common-hal/busio/SPI.c +++ b/ports/cxd56/common-hal/busio/SPI.c @@ -31,7 +31,7 @@ #include "shared-bindings/busio/SPI.h" -void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *clock, +void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi, const mcu_pin_obj_t *miso) { int port = -1; diff --git a/ports/cxd56/common-hal/pulseio/PulseOut.c b/ports/cxd56/common-hal/pulseio/PulseOut.c index 5e1d5a2ed4..21b4c77e55 100644 --- a/ports/cxd56/common-hal/pulseio/PulseOut.c +++ b/ports/cxd56/common-hal/pulseio/PulseOut.c @@ -63,7 +63,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, if (pulse_fd < 0) { pulse_fd = open("/dev/timer0", O_RDONLY); } - + if (pulse_fd < 0) { mp_raise_RuntimeError(translate("All timers in use")); } diff --git a/ports/cxd56/mkspk/.gitignore b/ports/cxd56/mkspk/.gitignore index e9a6ab18f8..4c3d12e3ad 100644 --- a/ports/cxd56/mkspk/.gitignore +++ b/ports/cxd56/mkspk/.gitignore @@ -1,3 +1,2 @@ /mkspk /mkspk.exe - diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index a7e9c30a3d..a40d31fafb 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -146,4 +146,3 @@ void port_interrupt_after_ticks(uint32_t ticks) { void port_sleep_until_interrupt(void) { // TODO: Implement sleep. } - diff --git a/ports/esp32s2/common-hal/supervisor/Runtime.c b/ports/esp32s2/common-hal/supervisor/Runtime.c index feab6987d8..ea663f897d 100644 --- a/ports/esp32s2/common-hal/supervisor/Runtime.c +++ b/ports/esp32s2/common-hal/supervisor/Runtime.c @@ -35,4 +35,3 @@ bool common_hal_get_serial_connected(void) { bool common_hal_get_serial_bytes_available(void) { return (bool) serial_bytes_available(); } - diff --git a/ports/esp32s2/common-hal/supervisor/__init__.c b/ports/esp32s2/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100644 --- a/ports/esp32s2/common-hal/supervisor/__init__.c +++ b/ports/esp32s2/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index ef216c4b1b..a8d3fa485c 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -121,4 +121,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 void supervisor_flash_release_cache(void) { } - diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c index 8bba84015a..39eb8204ff 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/esp32s2/supervisor/usb.c @@ -88,4 +88,3 @@ void init_usb_hardware(void) { usb_device_stack, &usb_device_taskdef); } - diff --git a/ports/litex/common-hal/supervisor/Runtime.c b/ports/litex/common-hal/supervisor/Runtime.c index feab6987d8..ea663f897d 100644 --- a/ports/litex/common-hal/supervisor/Runtime.c +++ b/ports/litex/common-hal/supervisor/Runtime.c @@ -35,4 +35,3 @@ bool common_hal_get_serial_connected(void) { bool common_hal_get_serial_bytes_available(void) { return (bool) serial_bytes_available(); } - diff --git a/ports/litex/common-hal/supervisor/__init__.c b/ports/litex/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100644 --- a/ports/litex/common-hal/supervisor/__init__.c +++ b/ports/litex/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/litex/hw/common.h b/ports/litex/hw/common.h index 6a97ca2e93..b902bc4f27 100644 --- a/ports/litex/hw/common.h +++ b/ports/litex/hw/common.h @@ -30,4 +30,4 @@ static inline uint32_t csr_readl(uint32_t addr) { return *(volatile uint32_t *)addr; } -#endif /* _HW_COMMON_H_ */ \ No newline at end of file +#endif /* _HW_COMMON_H_ */ diff --git a/ports/litex/irq.h b/ports/litex/irq.h index a822189071..dc96c228d8 100644 --- a/ports/litex/irq.h +++ b/ports/litex/irq.h @@ -68,4 +68,4 @@ static inline unsigned int irq_pending(void) } #endif -#endif /* __IRQ_H */ \ No newline at end of file +#endif /* __IRQ_H */ diff --git a/ports/litex/supervisor/internal_flash.c b/ports/litex/supervisor/internal_flash.c index 2dbf46b3a6..cf777a8acc 100644 --- a/ports/litex/supervisor/internal_flash.c +++ b/ports/litex/supervisor/internal_flash.c @@ -348,4 +348,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 void supervisor_flash_release_cache(void) { } - diff --git a/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c b/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c index 80a57f17be..43ffe0dd13 100644 --- a/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c +++ b/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c @@ -45,7 +45,7 @@ const flexspi_nor_config_t qspiflash_config = { #ifdef BOARD_USING_SECONDARY_QSPI_PINMUX .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromInternally, #else - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, #endif .csHoldTime = 1u, .csSetupTime = 2u, diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index ef34e61724..c51aef4daa 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -87,7 +87,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, //if both MOSI and MISO exist, loop search normally if ((mosi != NULL) && (miso != NULL)) { for (uint j = 0; j < mosi_count; j++) { - if ((mcu_spi_mosi_list[i].pin != mosi) + if ((mcu_spi_mosi_list[i].pin != mosi) || (mcu_spi_sck_list[i].bank_idx != mcu_spi_mosi_list[j].bank_idx)){ continue; } diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index a517dc7b5e..5ef347e591 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -109,7 +109,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // 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 || + if (mcu_uart_tx_list[j].pin != tx || mcu_uart_tx_list[j].bank_idx != mcu_uart_rx_list[i].bank_idx) { continue; } @@ -291,7 +291,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { } else { reserved_uart[self->tx->bank_idx - 1] = false; } - + LPUART_Deinit(self->uart); gc_free(self->ringbuf); diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 233e66006b..a005924e2f 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -41,8 +41,8 @@ STATIC bool claimed_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; STATIC bool never_reset_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; // There are two numbering systems used here: -// IOMUXC index, used for iterating through pins and accessing reset information, -// and GPIO port and number, used to store claimed and reset tagging. The two number +// IOMUXC index, used for iterating through pins and accessing reset information, +// and GPIO port and number, used to store claimed and reset tagging. The two number // systems are not related and one cannot determine the other without a pin object void reset_all_pins(void) { for (uint8_t i = 0; i < IOMUXC_SW_PAD_CTL_PAD_COUNT; i++) { @@ -64,8 +64,8 @@ void reset_all_pins(void) { #endif } -// Since i.MX pins need extra register and reset information to reset properly, -// resetting pins by number alone has been removed. +// Since i.MX pins need extra register and reset information to reset properly, +// resetting pins by number alone has been removed. void common_hal_reset_pin(const mcu_pin_obj_t* pin) { never_reset_pins[pin->mux_idx] = false; claimed_pins[pin->mux_idx] = false; diff --git a/ports/mimxrt10xx/common-hal/supervisor/__init__.c b/ports/mimxrt10xx/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100755 --- a/ports/mimxrt10xx/common-hal/supervisor/__init__.c +++ b/ports/mimxrt10xx/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c index 3e2c6972b0..a994e154de 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c @@ -115,7 +115,7 @@ const mcu_periph_obj_t mcu_uart_tx_list[9] = { const mcu_periph_obj_t mcu_uart_rts_list[4] = { PERIPH_PIN(1, 6, 0, 0, &pin_GPIO_07), - + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_AD_07), PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_13), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c index 814b4120d1..3d043a14ec 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c @@ -160,7 +160,7 @@ const mcu_periph_obj_t mcu_uart_tx_list[16] = { const mcu_periph_obj_t mcu_uart_rts_list[10] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_09), - + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_EMC_21), PERIPH_PIN(2, 2, 0, 1, &pin_GPIO_AD_B1_07), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c index 388a1b0147..fd1e4ddb85 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c @@ -165,7 +165,7 @@ const mcu_periph_obj_t mcu_uart_tx_list[18] = { const mcu_periph_obj_t mcu_uart_rts_list[9] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_15), - + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_AD_B1_01), PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_AD_B1_05), @@ -188,7 +188,7 @@ const mcu_periph_obj_t mcu_uart_cts_list[9] = { PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_AD_B1_00), PERIPH_PIN(3, 2, kIOMUXC_LPUART3_CTS_B_SELECT_INPUT, 0, &pin_GPIO_EMC_15), - PERIPH_PIN(3, 2, kIOMUXC_LPUART3_CTS_B_SELECT_INPUT, 1, &pin_GPIO_AD_B1_04), + PERIPH_PIN(3, 2, kIOMUXC_LPUART3_CTS_B_SELECT_INPUT, 1, &pin_GPIO_AD_B1_04), PERIPH_PIN(4, 2, 0, 0, &pin_GPIO_EMC_17), diff --git a/ports/mimxrt10xx/supervisor/internal_flash.c b/ports/mimxrt10xx/supervisor/internal_flash.c index 4f52748ed5..9abd15e60e 100644 --- a/ports/mimxrt10xx/supervisor/internal_flash.c +++ b/ports/mimxrt10xx/supervisor/internal_flash.c @@ -254,4 +254,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 void supervisor_flash_release_cache(void) { } - diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index acec3cf727..ed5824732d 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -257,7 +257,7 @@ safe_mode_t port_init(void) { // enabled. It won't occur very often so it'll be low overhead. NVIC_EnableIRQ(SNVS_HP_WRAPPER_IRQn); - // Note that `reset_port` CANNOT GO HERE, unlike other ports, because `board_init` hasn't been + // Note that `reset_port` CANNOT GO HERE, unlike other ports, because `board_init` hasn't been // run yet, which uses `never_reset` to protect critical pins from being reset by `reset_port`. if (board_requests_safe_mode()) { diff --git a/ports/mimxrt10xx/supervisor/serial.c b/ports/mimxrt10xx/supervisor/serial.c index 22c979cf9a..01656a819c 100644 --- a/ports/mimxrt10xx/supervisor/serial.c +++ b/ports/mimxrt10xx/supervisor/serial.c @@ -90,4 +90,3 @@ void serial_write_substring(const char *text, uint32_t len) { LPUART_WriteBlocking(uart_instance, (uint8_t*)text, len); } - diff --git a/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/doc/ble_api.dox b/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/doc/ble_api.dox index a444c5e4ec..ecabf96aa3 100644 --- a/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/doc/ble_api.dox +++ b/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/doc/ble_api.dox @@ -968,11 +968,11 @@ * |||; * SD<-ADVERTISERS [label = "Scannable Advertisement (ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; * SD->ADVERTISERS [label = "Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; - * SD<-ADVERTISERS [label = "Scan Response (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; + * SD<-ADVERTISERS [label = "Scan Response (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {bdaddr, rssi, data}"]; - * ...; - * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"]; - * |||; + * ...; + * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"]; + * |||; * @endmsc * @defgroup BLE_GAP_SCAN_MSC_AE Scanning for advertisers performing legacy and extended advertising * @msc @@ -1011,7 +1011,7 @@ * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 1, scannable = 1, scan_response = 1}, data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<ADVERTISERS [label = "Legacy Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 0, scannable = 1, scan_response = 0}, adv_data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; @@ -1030,8 +1030,8 @@ * --- [label = " Variant #2 Reporting incomplete advertising reports"]; * |||; * APP=>SD [label = "sd_ble_gap_scan_start(params : {extended = 1, report_incomplete_evts = 1}, adv_report_buffer)"]; - * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {{peer_addr1, peer_irk1}}, pp_local_irks: {local_irk1}) "]; * APP<ADVERTISERS [label = "Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; - * SD<-ADVERTISERS [label = "Scan Response (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; + * SD<-ADVERTISERS [label = "Scan Response (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {bdaddr, rssi, data}"]; - * ...; - * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"]; - * |||; + * ...; + * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"]; + * |||; * @endmsc * @defgroup BLE_GAP_SCAN_MSC_AE Scanning for advertisers performing legacy and extended advertising * @msc @@ -1011,7 +1011,7 @@ * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 1, scannable = 1, scan_response = 1}, data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<ADVERTISERS [label = "Legacy Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 0, scannable = 1, scan_response = 0}, adv_data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; @@ -1030,8 +1030,8 @@ * --- [label = " Variant #2 Reporting incomplete advertising reports"]; * |||; * APP=>SD [label = "sd_ble_gap_scan_start(params : {extended = 1, report_incomplete_evts = 1}, adv_report_buffer)"]; - * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: {local_irk1}) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: local_irk1) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: {local_irk1}) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; - + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; * |||; * ...; @@ -3927,4 +3927,3 @@ * @} * @} */ - diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h index 39944854c2..d17ac9a596 100644 --- a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h @@ -89,7 +89,7 @@ enum BLE_COMMON_SVCS */ enum BLE_COMMON_EVTS { - BLE_EVT_USER_MEM_REQUEST = BLE_EVT_BASE + 0, /**< User Memory request. See @ref ble_evt_user_mem_request_t + BLE_EVT_USER_MEM_REQUEST = BLE_EVT_BASE + 0, /**< User Memory request. See @ref ble_evt_user_mem_request_t \n Reply with @ref sd_ble_user_mem_reply. */ BLE_EVT_USER_MEM_RELEASE = BLE_EVT_BASE + 1, /**< User Memory release. See @ref ble_evt_user_mem_release_t */ }; @@ -389,10 +389,10 @@ typedef union * application RAM region (APP_RAM_BASE). On return, this will * contain the minimum start address of the application RAM region * required by the SoftDevice for this configuration. - * @warning After this call, the SoftDevice may generate several events. The list of events provided - * below require the application to initiate a SoftDevice API call. The corresponding API call - * is referenced in the event documentation. - * If the application fails to do so, the BLE connection may timeout, or the SoftDevice may stop + * @warning After this call, the SoftDevice may generate several events. The list of events provided + * below require the application to initiate a SoftDevice API call. The corresponding API call + * is referenced in the event documentation. + * If the application fails to do so, the BLE connection may timeout, or the SoftDevice may stop * communicating with the peer device. * - @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST * - @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST @@ -537,7 +537,7 @@ SVCALL(SD_BLE_UUID_VS_ADD, uint32_t, sd_ble_uuid_vs_add(ble_uuid128_t const *p_v /**@brief Remove a Vendor Specific base UUID. - * + * * @details This call removes a Vendor Specific base UUID that has been added with @ref sd_ble_uuid_vs_add. This function allows * the application to reuse memory allocated for Vendor Specific base UUIDs. * diff --git a/ports/nrf/boards/electronut_labs_papyr/README.md b/ports/nrf/boards/electronut_labs_papyr/README.md index fda3901938..7e5c43cc87 100644 --- a/ports/nrf/boards/electronut_labs_papyr/README.md +++ b/ports/nrf/boards/electronut_labs_papyr/README.md @@ -4,7 +4,7 @@ The `Electronut Labs Papyr` board is based on the `nRF52840` SoC from Nordic Semiconductors. It has an e-ink display on it, along with a CR2477 battery holder. -Papyr can be programmed with the [`Adafruit nRF52 bootloader`](https://github.com/adafruit/Adafruit_nRF52_Bootloader) to +Papyr can be programmed with the [`Adafruit nRF52 bootloader`](https://github.com/adafruit/Adafruit_nRF52_Bootloader) to Schematic, datasheet default pin mapping etc. can be found over [here](https://docs.electronut.in/papyr/). The default pin mapping can be found in the board directory. diff --git a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.h b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.h index c4833e7196..4b7a884cfa 100644 --- a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.h +++ b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.h @@ -62,6 +62,3 @@ #define DEFAULT_UART_BUS_RX (&pin_P0_28) #define DEFAULT_UART_BUS_TX (&pin_P0_02) - - - diff --git a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk index b6614f8b3f..e43639a897 100644 --- a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk +++ b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk @@ -15,4 +15,3 @@ EXTERNAL_FLASH_DEVICES = "W25Q16JV_IQ" # We use a CFLAGS define here because there are include order issues # if we try to include "mpconfigport.h" into nrfx_config.h . CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2 - diff --git a/ports/nrf/boards/particle_argon/mpconfigboard.mk b/ports/nrf/boards/particle_argon/mpconfigboard.mk index a0edfda958..2ca08b9829 100644 --- a/ports/nrf/boards/particle_argon/mpconfigboard.mk +++ b/ports/nrf/boards/particle_argon/mpconfigboard.mk @@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICES = "MX25L3233F" # Support for the Ethernet FeatherWing CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 \ No newline at end of file +MICROPY_PY_WIZNET5K = 5500 diff --git a/ports/nrf/boards/particle_boron/mpconfigboard.mk b/ports/nrf/boards/particle_boron/mpconfigboard.mk index ccb2d63a17..f03f43a7bc 100644 --- a/ports/nrf/boards/particle_boron/mpconfigboard.mk +++ b/ports/nrf/boards/particle_boron/mpconfigboard.mk @@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICES = "MX25L3233F" # Support for the Ethernet FeatherWing CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 \ No newline at end of file +MICROPY_PY_WIZNET5K = 5500 diff --git a/ports/nrf/boards/particle_xenon/mpconfigboard.mk b/ports/nrf/boards/particle_xenon/mpconfigboard.mk index 3970b1d056..44309bbca2 100644 --- a/ports/nrf/boards/particle_xenon/mpconfigboard.mk +++ b/ports/nrf/boards/particle_xenon/mpconfigboard.mk @@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICES = "MX25L3233F" # Support for the Ethernet FeatherWing CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 \ No newline at end of file +MICROPY_PY_WIZNET5K = 5500 diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/README.md b/ports/nrf/boards/sparkfun_nrf52840_mini/README.md index f80f1c27ca..396e169a1e 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_mini/README.md +++ b/ports/nrf/boards/sparkfun_nrf52840_mini/README.md @@ -45,4 +45,4 @@ The nRF52840 Mini hardware layout is open source: * [Schematic](https://cdn.sparkfun.com/assets/learn_tutorials/8/2/0/nrf52840-breakout-mdbt50q-v10.pdf) * [Eagle Files](https://cdn.sparkfun.com/assets/learn_tutorials/8/2/0/nrf52840-breakout-mdbt50q-v10.zip) -* [Hookup Guide](https://learn.sparkfun.com/tutorials/sparkfun-pro-nrf52840-mini-hookup-guide) \ No newline at end of file +* [Hookup Guide](https://learn.sparkfun.com/tutorials/sparkfun-pro-nrf52840-mini-hookup-guide) diff --git a/ports/nrf/common-hal/neopixel_write/__init__.h b/ports/nrf/common-hal/neopixel_write/__init__.h index b8dce85adf..9366235af7 100644 --- a/ports/nrf/common-hal/neopixel_write/__init__.h +++ b/ports/nrf/common-hal/neopixel_write/__init__.h @@ -29,4 +29,4 @@ void neopixel_write_reset(void); -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_NEOPIXEL_WRITE_INIT_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_NEOPIXEL_WRITE_INIT_H diff --git a/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c b/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c index a0cfd48d56..28f563da6f 100644 --- a/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c @@ -49,9 +49,9 @@ static void _intr_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { self->state = new_state; - // logic from the atmel-samd port: provides some damping and scales movement - // down by 4:1. - if (self->quarter >= 4) { + // logic from the atmel-samd port: provides some damping and scales movement + // down by 4:1. + if (self->quarter >= 4) { self->position++; self->quarter = 0; } else if (self->quarter <= -4) { diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index 06345f5895..93ba007c83 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -79,4 +79,3 @@ int common_hal_rtc_get_calibration(void) { void common_hal_rtc_set_calibration(int calibration) { mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); } - diff --git a/ports/nrf/common-hal/supervisor/Runtime.c b/ports/nrf/common-hal/supervisor/Runtime.c index feab6987d8..ea663f897d 100755 --- a/ports/nrf/common-hal/supervisor/Runtime.c +++ b/ports/nrf/common-hal/supervisor/Runtime.c @@ -35,4 +35,3 @@ bool common_hal_get_serial_connected(void) { bool common_hal_get_serial_bytes_available(void) { return (bool) serial_bytes_available(); } - diff --git a/ports/nrf/common-hal/supervisor/__init__.c b/ports/nrf/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100755 --- a/ports/nrf/common-hal/supervisor/__init__.c +++ b/ports/nrf/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/nrf/examples/ubluepy_eddystone.py b/ports/nrf/examples/ubluepy_eddystone.py index baf25ba4b4..426a4aa55f 100644 --- a/ports/nrf/examples/ubluepy_eddystone.py +++ b/ports/nrf/examples/ubluepy_eddystone.py @@ -53,6 +53,6 @@ def generate_eddystone_adv_packet(url): return packet def start(): - adv_packet = generate_eddystone_adv_packet("micropython") + adv_packet = generate_eddystone_adv_packet("micropython") p = Peripheral() - p.advertise(data=adv_packet, connectable=False) \ No newline at end of file + p.advertise(data=adv_packet, connectable=False) diff --git a/ports/nrf/examples/ubluepy_scan.py b/ports/nrf/examples/ubluepy_scan.py index ab11661cca..c0a7d05a37 100644 --- a/ports/nrf/examples/ubluepy_scan.py +++ b/ports/nrf/examples/ubluepy_scan.py @@ -19,7 +19,7 @@ def get_device_names(scan_entries): def find_device_by_name(name): s = Scanner() scan_res = s.scan(100) - + device_names = get_device_names(scan_res) for dev in device_names: if name == dev[1]: @@ -30,9 +30,9 @@ def find_device_by_name(name): # ... print("address:", res.addr()) # ... print("address type:", res.addr_type()) # ... print("rssi:", res.rssi()) -# ... -# ... -# ... +# ... +# ... +# ... # address: c2:73:61:89:24:45 # address type: 1 # rssi: -26 diff --git a/ports/nrf/examples/ubluepy_temp.py b/ports/nrf/examples/ubluepy_temp.py index e5c157dbbd..118407af5e 100644 --- a/ports/nrf/examples/ubluepy_temp.py +++ b/ports/nrf/examples/ubluepy_temp.py @@ -31,7 +31,7 @@ def event_handler(id, handle, data): global periph global serv_env_sense global notif_enabled - + if id == constants.EVT_GAP_CONNECTED: # indicated 'connected' LED(1).on() @@ -50,7 +50,7 @@ def event_handler(id, handle, data): notif_enabled = True # start low power timer rtc.start() - else: + else: notif_enabled = False # stop low power timer rtc.stop() @@ -68,7 +68,7 @@ def send_temp(timer_id): # start off with LED(1) off LED(1).off() -# use RTC1 as RTC0 is used by bluetooth stack +# use RTC1 as RTC0 is used by bluetooth stack # set up RTC callback every 5 second rtc = RTC(1, period=5, mode=RTC.PERIODIC, callback=send_temp) @@ -76,7 +76,7 @@ notif_enabled = False uuid_env_sense = UUID("0x181A") # Environmental Sensing service uuid_temp = UUID("0x2A6E") # Temperature characteristic - + serv_env_sense = Service(uuid_env_sense) temp_props = Characteristic.PROP_NOTIFY | Characteristic.PROP_READ @@ -89,4 +89,3 @@ periph = Peripheral() periph.addService(serv_env_sense) periph.setConnectionHandler(event_handler) periph.advertise(device_name="micr_temp", services=[serv_env_sense]) - diff --git a/ports/nrf/gccollect.c b/ports/nrf/gccollect.c index b7aa57a55a..3661daa535 100644 --- a/ports/nrf/gccollect.c +++ b/ports/nrf/gccollect.c @@ -43,7 +43,7 @@ void gc_collect(void) { gc_collect_start(); mp_uint_t sp = get_msp(); // Get stack pointer - + // trace the stack, including the registers (since they live on the stack in this function) gc_collect_root((void**)sp, ((uint32_t)&_ram_end - sp) / sizeof(uint32_t)); diff --git a/ports/stm/.gitignore b/ports/stm/.gitignore index 3080ece14d..5d645392ca 100644 --- a/ports/stm/.gitignore +++ b/ports/stm/.gitignore @@ -6,4 +6,4 @@ build-*/ ##################### ref/ -.gdb_history \ No newline at end of file +.gdb_history diff --git a/ports/stm/README.md b/ports/stm/README.md index 95e9bd13fd..5df9cedee2 100644 --- a/ports/stm/README.md +++ b/ports/stm/README.md @@ -1,6 +1,6 @@ # Circuitpython on STM32 # -This port brings the ST Microelectronics STM32 series of MCUs to Circuitpython. STM32 chips have a wide range of capability, from <$1 low power STM32F0s to dual-core STM32H7s running at 400+ MHz. Currently, only the F4, F7, and H7 families are supported, powered by the ARM Cortex M4 and M7 processors. +This port brings the ST Microelectronics STM32 series of MCUs to Circuitpython. STM32 chips have a wide range of capability, from <$1 low power STM32F0s to dual-core STM32H7s running at 400+ MHz. Currently, only the F4, F7, and H7 families are supported, powered by the ARM Cortex M4 and M7 processors. Refer to the ST Microelectronics website for more information on features sorted by family and individual chip lines: [st.com/en/microcontrollers-microprocessors/stm32-high-performance-mcus.html](https://www.st.com/en/microcontrollers-microprocessors/stm32-high-performance-mcus.html) @@ -13,10 +13,10 @@ STM32 SoCs vary product-by-product in clock speed, peripheral capability, pin as - **packages/** contains package-specific pin bindings (LQFP100, BGA216, etc) - **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**. - **st-driver/** submodule for ST HAL and LL files generated via CubeMX. Shared with TinyUSB. -- **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup. -- **tools/** python scripts for generating peripheral and pin mapping files in **peripherals/** and **board/**. +- **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup. +- **tools/** python scripts for generating peripheral and pin mapping files in **peripherals/** and **board/**. -At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled modules. +At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled modules. ## Build instructions ## @@ -36,9 +36,9 @@ You may also build with certain flags available in the makefile, depending on yo ## USB connection ## -Connect your development board of choice to the host PC via the USB cable. Note that for most ST development boards such as the Nucleo and Discovery series, you must use a secondary OTG USB connector to access circuitpython, as the primary USB connector will be connected to a built-in ST-Link debugger rather than the chip itself. +Connect your development board of choice to the host PC via the USB cable. Note that for most ST development boards such as the Nucleo and Discovery series, you must use a secondary OTG USB connector to access circuitpython, as the primary USB connector will be connected to a built-in ST-Link debugger rather than the chip itself. -In many cases, this ST-Link USB connector will **still need to be connected to power** for the chip to turn on - refer to your specific product manual for details. +In many cases, this ST-Link USB connector will **still need to be connected to power** for the chip to turn on - refer to your specific product manual for details. ## Flash the bootloader ## @@ -52,7 +52,7 @@ Windows users will need to install [stm32cubeprog](https://www.st.com/en/develop ## Flashing the circuitpython image with DFU-Util ## -Ensure the board is in dfu mode by following the steps in the previous section. Then run: +Ensure the board is in dfu mode by following the steps in the previous section. Then run: $ make BOARD=feather_stm32F405_express flash @@ -62,10 +62,10 @@ Alternatively, you can navigate to the build directory and run the raw `dfu-util ## Accessing the board ## -Connecting the board to the PC via the USB cable will allow code to be uploaded to the `CIRCUITPY` volume. +Connecting the board to the PC via the USB cable will allow code to be uploaded to the `CIRCUITPY` volume. -Circuitpython exposes a CDC virtual serial connection for REPL access and debugging. Connecting to it from OSX will look something like this: +Circuitpython exposes a CDC virtual serial connection for REPL access and debugging. Connecting to it from OSX will look something like this: screen /dev/tty.usbmodem14111201 115200 -You may also use a program like [mu](https://codewith.mu/) to assist with REPL access. +You may also use a program like [mu](https://codewith.mu/) to assist with REPL access. diff --git a/ports/stm/boards/STM32F401xe_boot.ld b/ports/stm/boards/STM32F401xe_boot.ld index 37827c3301..4f3e6ea70e 100644 --- a/ports/stm/boards/STM32F401xe_boot.ld +++ b/ports/stm/boards/STM32F401xe_boot.ld @@ -1,5 +1,5 @@ /* - GNU linker script for STM32F401 with bootloader (such as the Meowbit). No internal fs. + GNU linker script for STM32F401 with bootloader (such as the Meowbit). No internal fs. */ /* Specify the memory areas */ @@ -23,4 +23,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F405_boot.ld b/ports/stm/boards/STM32F405_boot.ld index 5768d1a01e..0b0e1a5f34 100644 --- a/ports/stm/boards/STM32F405_boot.ld +++ b/ports/stm/boards/STM32F405_boot.ld @@ -24,4 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F405_default.ld b/ports/stm/boards/STM32F405_default.ld index 4c11fd7cf3..39255ff7a0 100644 --- a/ports/stm/boards/STM32F405_default.ld +++ b/ports/stm/boards/STM32F405_default.ld @@ -24,4 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F405_fs.ld b/ports/stm/boards/STM32F405_fs.ld index e6c66127fb..d6de1a08b6 100644 --- a/ports/stm/boards/STM32F405_fs.ld +++ b/ports/stm/boards/STM32F405_fs.ld @@ -25,4 +25,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F407_fs.ld b/ports/stm/boards/STM32F407_fs.ld index f06c19d992..293ac6ff56 100644 --- a/ports/stm/boards/STM32F407_fs.ld +++ b/ports/stm/boards/STM32F407_fs.ld @@ -25,4 +25,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F411_fs.ld b/ports/stm/boards/STM32F411_fs.ld index 1b45f235fa..69b98cf825 100644 --- a/ports/stm/boards/STM32F411_fs.ld +++ b/ports/stm/boards/STM32F411_fs.ld @@ -24,4 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F412_fs.ld b/ports/stm/boards/STM32F412_fs.ld index 8837bd87d6..d3ad291a2b 100644 --- a/ports/stm/boards/STM32F412_fs.ld +++ b/ports/stm/boards/STM32F412_fs.ld @@ -24,4 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F746xG_fs.ld b/ports/stm/boards/STM32F746xG_fs.ld index be10a14294..6c9ea4de31 100644 --- a/ports/stm/boards/STM32F746xG_fs.ld +++ b/ports/stm/boards/STM32F746xG_fs.ld @@ -49,4 +49,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld index 25322b0b6f..2feb422257 100644 --- a/ports/stm/boards/STM32F767_fs.ld +++ b/ports/stm/boards/STM32F767_fs.ld @@ -24,4 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32H743_fs.ld b/ports/stm/boards/STM32H743_fs.ld index b6c3d5b62d..ca69f0d8d1 100644 --- a/ports/stm/boards/STM32H743_fs.ld +++ b/ports/stm/boards/STM32H743_fs.ld @@ -36,4 +36,3 @@ _estack = ORIGIN(DTCM) + LENGTH(DTCM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/common_default.ld b/ports/stm/boards/common_default.ld index ade3571a59..0c7efd01d4 100644 --- a/ports/stm/boards/common_default.ld +++ b/ports/stm/boards/common_default.ld @@ -1,4 +1,4 @@ -/* Memory layout for default case. +/* Memory layout for default case. FLASH_ISR .isr_vector FLASH_FIRMWARE .text @@ -96,4 +96,3 @@ SECTIONS .ARM.attributes 0 : { *(.ARM.attributes) } } - diff --git a/ports/stm/boards/common_nvm.ld b/ports/stm/boards/common_nvm.ld index f948b94e10..91e453bfd9 100644 --- a/ports/stm/boards/common_nvm.ld +++ b/ports/stm/boards/common_nvm.ld @@ -106,4 +106,3 @@ SECTIONS .ARM.attributes 0 : { *(.ARM.attributes) } } - diff --git a/ports/stm/boards/common_tcm.ld b/ports/stm/boards/common_tcm.ld index 1a41853fe6..9e677862d3 100644 --- a/ports/stm/boards/common_tcm.ld +++ b/ports/stm/boards/common_tcm.ld @@ -133,7 +133,7 @@ SECTIONS . += _ld_default_stack_size; } > DTCM _ld_stack_top = ORIGIN(DTCM) + LENGTH(DTCM); - + .ARM.attributes 0 : { *(.ARM.attributes) } } diff --git a/ports/stm/boards/espruino_pico/README.md b/ports/stm/boards/espruino_pico/README.md index 9f0321c474..86df1ad32a 100644 --- a/ports/stm/boards/espruino_pico/README.md +++ b/ports/stm/boards/espruino_pico/README.md @@ -6,10 +6,10 @@ The Espruino Pico is normally updated via a bootloader activated by the Espruino - Install ST's DFU utility on Windows, or dfu-util for Mac or Linux - **Mac**: install with Homebrew: `brew install dfu-util` - **Linux**: install with apt-get: `sudo apt-get install dfu-util` - - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. + - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. - Hold down the Pico's button while plugging it into USB (when overwriting Espruino's default firmware) - - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. - - Restart the board. + - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. + - Restart the board. -To reinstall Espruino, follow the same steps with the latest Espruino Pico binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. \ No newline at end of file +To reinstall Espruino, follow the same steps with the latest Espruino Pico binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.h b/ports/stm/boards/espruino_pico/mpconfigboard.h index 890b1b88e7..5136fac224 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.h +++ b/ports/stm/boards/espruino_pico/mpconfigboard.h @@ -37,4 +37,3 @@ #define BOARD_OSC_DIV (8) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) - diff --git a/ports/stm/boards/espruino_wifi/README.MD b/ports/stm/boards/espruino_wifi/README.MD index 8c2cd3be2b..cc78811f1c 100644 --- a/ports/stm/boards/espruino_wifi/README.MD +++ b/ports/stm/boards/espruino_wifi/README.MD @@ -6,10 +6,10 @@ The Espruino Wifi is normally updated via a bootloader activated by the Espruino - Install ST's DFU utility on Windows, or dfu-util for Mac or Linux - **Mac**: install with Homebrew: `brew install dfu-util` - **Linux**: install with apt-get: `sudo apt-get install dfu-util` - - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. + - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. - Hold down the Wifi's button while plugging it into USB (when overwriting Espruino's default firmware) - - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. - - Restart the board. + - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. + - Restart the board. -To reinstall Espruino, follow the same steps with the latest Espruino Wifi binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. \ No newline at end of file +To reinstall Espruino, follow the same steps with the latest Espruino Wifi binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.mk b/ports/stm/boards/espruino_wifi/mpconfigboard.mk index 70d0ea2bdf..ee82095ffd 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.mk +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.mk @@ -10,6 +10,5 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F411_fs.ld - diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index 85ed18f4f6..d98bd29ec7 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -12,8 +12,7 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F405xx MCU_PACKAGE = LQFP64 -LD_COMMON = boards/common_default.ld -LD_DEFAULT = boards/STM32F405_default.ld +LD_COMMON = boards/common_default.ld +LD_DEFAULT = boards/STM32F405_default.ld LD_BOOT = boards/STM32F405_boot.ld # UF2 boot option UF2_OFFSET = 0x8010000 - diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index cd8d3b548e..cf60c89c26 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -15,7 +15,6 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F401xE MCU_PACKAGE = LQFP64 -LD_COMMON = boards/common_default.ld -LD_FILE = boards/STM32F401xe_boot.ld +LD_COMMON = boards/common_default.ld +LD_FILE = boards/STM32F401xe_boot.ld # LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash - diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk index 8a793d5709..f23f642e7e 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk index c8c2a3d2b1..4e5e1bc7c8 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk @@ -10,6 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F767xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F767_fs.ld - diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk index 01ace06a23..ea99a1e10b 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk @@ -10,6 +10,5 @@ MCU_SERIES = H7 MCU_VARIANT = STM32H743xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_tcm.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32H743_fs.ld - diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 9a049ed2cf..2f26c6e71f 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -34,4 +34,3 @@ #define BOARD_OSC_DIV (12) #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) - diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.mk b/ports/stm/boards/openmv_h7/mpconfigboard.mk index 242dac52cd..4ff0f18d54 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.mk +++ b/ports/stm/boards/openmv_h7/mpconfigboard.mk @@ -10,6 +10,5 @@ MCU_SERIES = H7 MCU_VARIANT = STM32H743xx MCU_PACKAGE = LQFP100_x7 -LD_COMMON = boards/common_tcm.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32H743_fs.ld - diff --git a/ports/stm/boards/openmv_h7/openmv.csv b/ports/stm/boards/openmv_h7/openmv.csv index 9045e1ea2d..f9d4ebc400 100644 --- a/ports/stm/boards/openmv_h7/openmv.csv +++ b/ports/stm/boards/openmv_h7/openmv.csv @@ -23,4 +23,4 @@ I2C4_SDA,PD13 SPI2_NSS,PB12 SPI2_SCK,PB13 SPI2_MISO,PB14 -SPI2_MOSI,PB15 \ No newline at end of file +SPI2_MOSI,PB15 diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk index 0a06852fb8..08a2668167 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk @@ -12,6 +12,5 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F411_fs.ld - diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.mk b/ports/stm/boards/pyboard_v11/mpconfigboard.mk index 9d8b0f3f27..c0c0f5f6cd 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.mk +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.mk @@ -10,6 +10,5 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F405xx MCU_PACKAGE = LQFP64 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F405_fs.ld - diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk index 62887c0289..0054232e1d 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -15,6 +15,5 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F411_fs.ld - diff --git a/ports/stm/boards/stm32f411ce_blackpill/pins.c b/ports/stm/boards/stm32f411ce_blackpill/pins.c index aa9736fc4c..2f8aab6e8e 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/pins.c +++ b/ports/stm/boards/stm32f411ce_blackpill/pins.c @@ -33,7 +33,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_C15), MP_ROM_PTR(&pin_PC15) }, { MP_ROM_QSTR(MP_QSTR_C14), MP_ROM_PTR(&pin_PC14) }, - { MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_PTR(&pin_PC13) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC13) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk index 761602acdf..ca2f10ba37 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk @@ -12,4 +12,3 @@ MCU_PACKAGE = LQFP100_f4 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F411_fs.ld - diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk index 09e7bda85d..04d2a9b0d0 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -17,5 +17,3 @@ MCU_PACKAGE = LQFP144 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F412_fs.ld - - diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk index 57a65f75ae..09652d9ad9 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk @@ -12,4 +12,3 @@ MCU_PACKAGE = LQFP100_f4 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F407_fs.ld - diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk index 0b4ccc7604..ff8456df66 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = TFBGA216 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/system_stm32f4xx.c b/ports/stm/boards/system_stm32f4xx.c index caa4f9cafb..d8c745dbbd 100644 --- a/ports/stm/boards/system_stm32f4xx.c +++ b/ports/stm/boards/system_stm32f4xx.c @@ -1,6 +1,6 @@ /* * Taken from ST Cube library and modified. See below for original header. - * + * * Modifications copyright (c) 2019 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -28,16 +28,16 @@ * @author MCD Application Team * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. * - * This file provides two functions and one global variable to be called from + * This file provides two functions and one global variable to be called from * user application: - * - SystemInit(): This function is called at startup just after reset and + * - SystemInit(): This function is called at startup just after reset and * before branch to main program. This call is made inside * the "startup_stm32f4xx.s" file. * * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick + * by the user application to setup the SysTick * timer or configure other parameters. - * + * * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must * be called whenever the core clock is changed * during program execution. @@ -79,8 +79,8 @@ /** @addtogroup stm32f4xx_system * @{ - */ - + */ + /** @addtogroup STM32F4xx_System_Private_Includes * @{ */ @@ -89,7 +89,7 @@ #include "stm32f4xx.h" #include "py/mpconfig.h" -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ #endif /* HSE_VALUE */ @@ -121,7 +121,7 @@ /* #define DATA_IN_ExtSRAM */ #endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx ||\ STM32F412Zx || STM32F412Vx */ - + #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) /* #define DATA_IN_ExtSDRAM */ @@ -131,7 +131,7 @@ /*!< Uncomment the following line if you need to relocate your vector Table in Internal SRAM. */ /* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. +#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. This value must be a multiple of 0x200. */ /******************************************************************************/ @@ -153,7 +153,7 @@ /* This variable is updated in three ways: 1) by calling CMSIS function SystemCoreClockUpdate() 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency Note: If you use this function to configure the system clock; then there is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. @@ -170,7 +170,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; */ #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) - static void SystemInit_ExtMemCtl(void); + static void SystemInit_ExtMemCtl(void); #endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ /** @@ -183,7 +183,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; /** * @brief Setup the microcontroller system - * Initialize the FPU setting, vector table location and External memory + * Initialize the FPU setting, vector table location and External memory * configuration. * @param None * @retval None @@ -214,7 +214,7 @@ void SystemInit(void) RCC->CIR = 0x00000000; #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) - SystemInit_ExtMemCtl(); + SystemInit_ExtMemCtl(); #endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ /* Configure the Vector Table location add offset address ------------------*/ @@ -232,41 +232,41 @@ void SystemInit(void) * The SystemCoreClock variable contains the core clock (HCLK), it can * be used by the user application to setup the SysTick timer or configure * other parameters. - * + * * @note Each time the core clock (HCLK) changes, this function must be called * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined * constant and the selected clock source: - * + * * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * + * * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * + * * (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * + * in voltage and temperature. + * * (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (its value * depends on the application requirements), user has to ensure that HSE_VALUE * is same as the real frequency of the crystal used. Otherwise, this function * may have wrong result. - * + * * - The result of this function could be not correct when using fractional * value for HSE crystal. - * + * * @param None * @retval None */ void SystemCoreClockUpdate(void) { uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; - + /* Get SYSCLK source -------------------------------------------------------*/ tmp = RCC->CFGR & RCC_CFGR_SWS; @@ -282,10 +282,10 @@ void SystemCoreClockUpdate(void) /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N SYSCLK = PLL_VCO / PLL_P - */ + */ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; - + if (pllsource != 0) { /* HSE used as PLL clock source */ @@ -334,79 +334,79 @@ void SystemInit_ExtMemCtl(void) /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - + /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x00CCC0CC; GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ + /* Configure PDx pins speed to 100 MHz */ GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00CC0CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ + /* Configure PEx pins speed to 100 MHz */ GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; - + /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0xCCCCCCCC; GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ + /* Configure PFx pins speed to 50 MHz */ GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0xCCCCCCCC; GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ + /* Configure PGx pins speed to 50 MHz */ GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; - + /* Connect PHx pins to FMC Alternate function */ GPIOH->AFR[0] = 0x00C0CC00; GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ + /* Configure PHx pins in Alternate function mode */ GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ + /* Configure PHx pins speed to 50 MHz */ GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ + /* Configure PHx pins Output type to push-pull */ GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ + /* No pull-up, pull-down for PHx pins */ GPIOH->PUPDR = 0x00000000; - + /* Connect PIx pins to FMC Alternate function */ GPIOI->AFR[0] = 0xCCCCCCCC; GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ + /* Configure PIx pins in Alternate function mode */ GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ + /* Configure PIx pins speed to 50 MHz */ GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ + /* Configure PIx pins Output type to push-pull */ GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ + /* No pull-up, pull-down for PIx pins */ GPIOI->PUPDR = 0x00000000; - + /*-- FMC Configuration -------------------------------------------------------*/ /* Enable the FMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -414,50 +414,50 @@ void SystemInit_ExtMemCtl(void) tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); FMC_Bank5_6->SDCR[0] = 0x000019E4; - FMC_Bank5_6->SDTR[0] = 0x01115351; - + FMC_Bank5_6->SDTR[0] = 0x01115351; + /* SDRAM initialization sequence */ /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + FMC_Bank5_6->SDCMR = 0x00000011; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } /* Delay */ for (index = 0; index<1000; index++); - + /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; + FMC_Bank5_6->SDCMR = 0x00000012; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* Auto refresh command */ FMC_Bank5_6->SDCMR = 0x00000073; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* MRD register program */ FMC_Bank5_6->SDCMR = 0x00046014; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + /* Set refresh count */ tmpreg = FMC_Bank5_6->SDRTR; FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); - + /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; + tmpreg = FMC_Bank5_6->SDCR[0]; FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) @@ -465,7 +465,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1->BTCR[2] = 0x00001011; FMC_Bank1->BTCR[3] = 0x00000201; FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #if defined(STM32F469xx) || defined(STM32F479xx) /* Configure and enable Bank1_SRAM2 */ FMC_Bank1->BTCR[2] = 0x00001091; @@ -473,7 +473,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1E->BWTR[2] = 0x0fffffff; #endif /* STM32F469xx || STM32F479xx */ - (void)(tmp); + (void)(tmp); } #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ #elif defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) @@ -499,13 +499,13 @@ void SystemInit_ExtMemCtl(void) clock */ RCC->AHB1ENR |= 0x0000007D; #else - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface + /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ RCC->AHB1ENR |= 0x000001F8; -#endif /* STM32F446xx */ +#endif /* STM32F446xx */ /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - + #if defined(STM32F446xx) /* Connect PAx pins to FMC Alternate function */ GPIOA->AFR[0] |= 0xC0000000; @@ -535,78 +535,78 @@ void SystemInit_ExtMemCtl(void) /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x000000CC; GPIOD->AFR[1] = 0xCC000CCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xA02A000A; - /* Configure PDx pins speed to 50 MHz */ + /* Configure PDx pins speed to 50 MHz */ GPIOD->OSPEEDR = 0xA02A000A; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00000CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA800A; - /* Configure PEx pins speed to 50 MHz */ + /* Configure PEx pins speed to 50 MHz */ GPIOE->OSPEEDR = 0xAAAA800A; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0xCCCCCCCC; GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ + /* Configure PFx pins speed to 50 MHz */ GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0xCCCCCCCC; GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ + /* Configure PGx pins speed to 50 MHz */ GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) + || defined(STM32F469xx) || defined(STM32F479xx) /* Connect PHx pins to FMC Alternate function */ GPIOH->AFR[0] = 0x00C0CC00; GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ + /* Configure PHx pins in Alternate function mode */ GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ + /* Configure PHx pins speed to 50 MHz */ GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ + /* Configure PHx pins Output type to push-pull */ GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ + /* No pull-up, pull-down for PHx pins */ GPIOH->PUPDR = 0x00000000; - + /* Connect PIx pins to FMC Alternate function */ GPIOI->AFR[0] = 0xCCCCCCCC; GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ + /* Configure PIx pins in Alternate function mode */ GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ + /* Configure PIx pins speed to 50 MHz */ GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ + /* Configure PIx pins Output type to push-pull */ GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ + /* No pull-up, pull-down for PIx pins */ GPIOI->PUPDR = 0x00000000; #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ - + /*-- FMC Configuration -------------------------------------------------------*/ /* Enable the FMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -616,65 +616,65 @@ void SystemInit_ExtMemCtl(void) /* Configure and enable SDRAM bank1 */ #if defined(STM32F446xx) FMC_Bank5_6->SDCR[0] = 0x00001954; -#else +#else FMC_Bank5_6->SDCR[0] = 0x000019E4; #endif /* STM32F446xx */ - FMC_Bank5_6->SDTR[0] = 0x01115351; - + FMC_Bank5_6->SDTR[0] = 0x01115351; + /* SDRAM initialization sequence */ /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + FMC_Bank5_6->SDCMR = 0x00000011; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } /* Delay */ for (index = 0; index<1000; index++); - + /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; + FMC_Bank5_6->SDCMR = 0x00000012; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* Auto refresh command */ #if defined(STM32F446xx) FMC_Bank5_6->SDCMR = 0x000000F3; -#else +#else FMC_Bank5_6->SDCMR = 0x00000073; #endif /* STM32F446xx */ timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* MRD register program */ #if defined(STM32F446xx) FMC_Bank5_6->SDCMR = 0x00044014; -#else +#else FMC_Bank5_6->SDCMR = 0x00046014; #endif /* STM32F446xx */ timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + /* Set refresh count */ tmpreg = FMC_Bank5_6->SDRTR; #if defined(STM32F446xx) FMC_Bank5_6->SDRTR = (tmpreg | (0x0000050C<<1)); -#else +#else FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); #endif /* STM32F446xx */ - + /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; + tmpreg = FMC_Bank5_6->SDCR[0]; FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); #endif /* DATA_IN_ExtSDRAM */ #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */ @@ -689,55 +689,55 @@ void SystemInit_ExtMemCtl(void) RCC->AHB1ENR |= 0x00000078; /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN); - + /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x00CCC0CC; GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ + /* Configure PDx pins speed to 100 MHz */ GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00CC0CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ + /* Configure PEx pins speed to 100 MHz */ GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0x00CCCCCC; GPIOF->AFR[1] = 0xCCCC0000; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA000AAA; - /* Configure PFx pins speed to 100 MHz */ + /* Configure PFx pins speed to 100 MHz */ GPIOF->OSPEEDR = 0xFF000FFF; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0x00CCCCCC; GPIOG->AFR[1] = 0x000000C0; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0x00085AAA; - /* Configure PGx pins speed to 100 MHz */ + /* Configure PGx pins speed to 100 MHz */ GPIOG->OSPEEDR = 0x000CAFFF; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; - + /*-- FMC/FSMC Configuration --------------------------------------------------*/ /* Enable the FMC/FSMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -749,7 +749,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1->BTCR[2] = 0x00001011; FMC_Bank1->BTCR[3] = 0x00000201; FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #if defined(STM32F469xx) || defined(STM32F479xx) /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); @@ -770,8 +770,8 @@ void SystemInit_ExtMemCtl(void) #endif /* DATA_IN_ExtSRAM */ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ - STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ - (void)(tmp); + STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ + (void)(tmp); } #endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */ /** diff --git a/ports/stm/boards/system_stm32f7xx.c b/ports/stm/boards/system_stm32f7xx.c index 184fefb36c..4aebc3d357 100644 --- a/ports/stm/boards/system_stm32f7xx.c +++ b/ports/stm/boards/system_stm32f7xx.c @@ -4,16 +4,16 @@ * @author MCD Application Team * @brief CMSIS Cortex-M7 Device Peripheral Access Layer System Source File. * - * This file provides two functions and one global variable to be called from + * This file provides two functions and one global variable to be called from * user application: - * - SystemInit(): This function is called at startup just after reset and + * - SystemInit(): This function is called at startup just after reset and * before branch to main program. This call is made inside * the "startup_stm32f7xx.s" file. * * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick + * by the user application to setup the SysTick * timer or configure other parameters. - * + * * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must * be called whenever the core clock is changed * during program execution. @@ -39,15 +39,15 @@ /** @addtogroup stm32f7xx_system * @{ - */ - + */ + /** @addtogroup STM32F7xx_System_Private_Includes * @{ */ #include "stm32f7xx.h" -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ #endif /* HSE_VALUE */ @@ -76,7 +76,7 @@ /*!< Uncomment the following line if you need to relocate your vector Table in Internal SRAM. */ /* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. +#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. This value must be a multiple of 0x200. */ /******************************************************************************/ @@ -99,7 +99,7 @@ /* This variable is updated in three ways: 1) by calling CMSIS function SystemCoreClockUpdate() 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency Note: If you use this function to configure the system clock; then there is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. @@ -126,7 +126,7 @@ /** * @brief Setup the microcontroller system - * Initialize the Embedded Flash Interface, the PLL and update the + * Initialize the Embedded Flash Interface, the PLL and update the * SystemFrequency variable. * @param None * @retval None @@ -154,41 +154,41 @@ void SystemInit(void) * The SystemCoreClock variable contains the core clock (HCLK), it can * be used by the user application to setup the SysTick timer or configure * other parameters. - * + * * @note Each time the core clock (HCLK) changes, this function must be called * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined * constant and the selected clock source: - * + * * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * + * * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * + * * (*) HSI_VALUE is a constant defined in stm32f7xx_hal_conf.h file (default value * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * + * in voltage and temperature. + * * (**) HSE_VALUE is a constant defined in stm32f7xx_hal_conf.h file (default value * 25 MHz), user has to ensure that HSE_VALUE is same as the real * frequency of the crystal used. Otherwise, this function may * have wrong result. - * + * * - The result of this function could be not correct when using fractional * value for HSE crystal. - * + * * @param None * @retval None */ void SystemCoreClockUpdate(void) { uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; - + /* Get SYSCLK source -------------------------------------------------------*/ tmp = RCC->CFGR & RCC_CFGR_SWS; @@ -204,10 +204,10 @@ void SystemCoreClockUpdate(void) /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N SYSCLK = PLL_VCO / PLL_P - */ + */ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; - + if (pllsource != 0) { /* HSE used as PLL clock source */ @@ -216,7 +216,7 @@ void SystemCoreClockUpdate(void) else { /* HSI used as PLL clock source */ - pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); + pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); } pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2; @@ -240,8 +240,8 @@ void SystemCoreClockUpdate(void) /** * @} */ - + /** * @} - */ + */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/system_stm32h7xx.c b/ports/stm/boards/system_stm32h7xx.c index 2132f26a0c..bbb0f821fb 100644 --- a/ports/stm/boards/system_stm32h7xx.c +++ b/ports/stm/boards/system_stm32h7xx.c @@ -1,6 +1,6 @@ /* * Taken from ST Cube library and modified. See below for original header. - * + * * Modifications copyright (c) 2020 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/stm/boards/thunderpack/pins.c b/ports/stm/boards/thunderpack/pins.c index 559d9658e7..eed54eb3c8 100644 --- a/ports/stm/boards/thunderpack/pins.c +++ b/ports/stm/boards/thunderpack/pins.c @@ -10,7 +10,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PA6), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_PA7), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_PA8), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_PA9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA9), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 0dc10c4e4c..86a932290a 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -280,7 +280,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->rx = NULL; } - + ringbuf_free(&self->ringbuf); } diff --git a/ports/stm/common-hal/nvm/ByteArray.c b/ports/stm/common-hal/nvm/ByteArray.c index 1aaf54653b..462d3aa9de 100644 --- a/ports/stm/common-hal/nvm/ByteArray.c +++ b/ports/stm/common-hal/nvm/ByteArray.c @@ -60,7 +60,7 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, return false; } } - + // Finish up HAL_FLASH_Lock(); return true; diff --git a/ports/stm/common-hal/os/__init__.c b/ports/stm/common-hal/os/__init__.c index eef58bfe22..84deb81759 100644 --- a/ports/stm/common-hal/os/__init__.c +++ b/ports/stm/common-hal/os/__init__.c @@ -92,4 +92,4 @@ bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) { #else return false; #endif -} \ No newline at end of file +} diff --git a/ports/stm/common-hal/supervisor/Runtime.c b/ports/stm/common-hal/supervisor/Runtime.c index feab6987d8..ea663f897d 100755 --- a/ports/stm/common-hal/supervisor/Runtime.c +++ b/ports/stm/common-hal/supervisor/Runtime.c @@ -35,4 +35,3 @@ bool common_hal_get_serial_connected(void) { bool common_hal_get_serial_bytes_available(void) { return (bool) serial_bytes_available(); } - diff --git a/ports/stm/common-hal/supervisor/__init__.c b/ports/stm/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100755 --- a/ports/stm/common-hal/supervisor/__init__.c +++ b/ports/stm/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/stm/packages/LQFP100_f4.c b/ports/stm/packages/LQFP100_f4.c index 5bc0a5158e..9136b94951 100644 --- a/ports/stm/packages/LQFP100_f4.c +++ b/ports/stm/packages/LQFP100_f4.c @@ -114,4 +114,4 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { // VDD --------------------------------------------*/ }; -MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/packages/LQFP100_x7.c b/ports/stm/packages/LQFP100_x7.c index 23d89a8268..4d3d5f45ae 100644 --- a/ports/stm/packages/LQFP100_x7.c +++ b/ports/stm/packages/LQFP100_x7.c @@ -112,4 +112,4 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { // VDD --------------------------------------------*/ }; -MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/packages/LQFP144.c b/ports/stm/packages/LQFP144.c index 36683bb648..5e0d743d7e 100644 --- a/ports/stm/packages/LQFP144.c +++ b/ports/stm/packages/LQFP144.c @@ -154,6 +154,6 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, // PDR_ON -----------------------------------------*/ // VDD --------------------------------------------*/ - + }; -MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/packages/LQFP64.c b/ports/stm/packages/LQFP64.c index e6a492bc33..52ca27cd92 100644 --- a/ports/stm/packages/LQFP64.c +++ b/ports/stm/packages/LQFP64.c @@ -76,6 +76,6 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, // VSS --------------------------------------------*/ // VDD --------------------------------------------*/ - + }; MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/packages/UFQFPN48.c b/ports/stm/packages/UFQFPN48.c index ae4bcf6cda..5304482ec0 100644 --- a/ports/stm/packages/UFQFPN48.c +++ b/ports/stm/packages/UFQFPN48.c @@ -58,6 +58,6 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, // VSS --------------------------------------------*/ // VDD --------------------------------------------*/ - + }; -MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/peripherals/periph.h b/ports/stm/peripherals/periph.h index 316dbbec5c..34089c849a 100644 --- a/ports/stm/peripherals/periph.h +++ b/ports/stm/peripherals/periph.h @@ -51,8 +51,8 @@ typedef struct { // Timer Peripheral typedef struct { - uint8_t tim_index:4; - uint8_t altfn_index:4; + uint8_t tim_index:4; + uint8_t altfn_index:4; uint8_t channel_index:4; const mcu_pin_obj_t * pin; } mcu_tim_pin_obj_t; diff --git a/ports/stm/peripherals/pins.h b/ports/stm/peripherals/pins.h index 8f06d012ec..358313f565 100644 --- a/ports/stm/peripherals/pins.h +++ b/ports/stm/peripherals/pins.h @@ -39,7 +39,7 @@ typedef struct { mp_obj_base_t base; uint8_t port:4; uint8_t number:4; - uint8_t adc_unit:3; + uint8_t adc_unit:3; uint8_t adc_channel:5; } mcu_pin_obj_t; @@ -50,8 +50,8 @@ typedef struct { #define ADC_3 4 //STM32 ADC pins can have a combination of 1, 2 or all 3 ADCs on a single pin, -//but all 3 ADCs will share the same input number per pin. -//F4 family has 3 ADC max, 24 channels max. +//but all 3 ADCs will share the same input number per pin. +//F4 family has 3 ADC max, 24 channels max. #define ADC_INPUT(mask, number) \ .adc_unit = mask, \ .adc_channel = number, @@ -63,7 +63,7 @@ typedef struct { extern const mp_obj_type_t mcu_pin_type; // STM32 can have up to 9 ports, each restricted to 16 pins -// We split the pin/port evenly, in contrast to nrf. +// We split the pin/port evenly, in contrast to nrf. #define PIN(p_port, p_number, p_adc) \ { \ { &mcu_pin_type }, \ diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c b/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c index 514bcc506e..d10fcbb6ff 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c @@ -42,4 +42,3 @@ void stm32_peripherals_gpio_init(void) { never_reset_pin_number(0,13); //PA13 SWDIO never_reset_pin_number(0,14); //PA14 SWCLK } - diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h index 334a14db57..ae416bda1d 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h @@ -54,4 +54,4 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[6]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c index eea2a1a1b3..ed89f0de6b 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c @@ -120,4 +120,4 @@ const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); \ No newline at end of file +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c index a5f4eae78c..03fba62895 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c @@ -48,12 +48,10 @@ void stm32_peripherals_gpio_init(void) { // never_reset_pin_number(1,4); //PB4 JTRST // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,0); //PH0 JTDO // never_reset_pin_number(5,1); //PH1 JTRST } void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { } - - diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h index 98b4fab9c2..df67a99d79 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h @@ -54,4 +54,4 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[12]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c index 0f669f1c6c..4282741a84 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c @@ -38,17 +38,17 @@ const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11)); @@ -71,14 +71,14 @@ const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_12,8)); const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_12,9)); const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); //BOOT1 -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); @@ -91,7 +91,7 @@ const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h index b3e5e3344d..e722b6e5ae 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h @@ -38,17 +38,17 @@ extern const mcu_pin_obj_t pin_PC13; extern const mcu_pin_obj_t pin_PC14; //pg 51 extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only +extern const mcu_pin_obj_t pin_PF00; // 144 only +extern const mcu_pin_obj_t pin_PF01; // 144 only +extern const mcu_pin_obj_t pin_PF02; // 144 only +extern const mcu_pin_obj_t pin_PF03; // 144 only +extern const mcu_pin_obj_t pin_PF04; // 144 only +extern const mcu_pin_obj_t pin_PF05; // 144 only +extern const mcu_pin_obj_t pin_PF06; // 144 only +extern const mcu_pin_obj_t pin_PF07; // 144 only +extern const mcu_pin_obj_t pin_PF08; // 144 only +extern const mcu_pin_obj_t pin_PF09; // 144 only +extern const mcu_pin_obj_t pin_PF10; // 144 only //pg 52 extern const mcu_pin_obj_t pin_PC00; extern const mcu_pin_obj_t pin_PC01; @@ -69,13 +69,13 @@ extern const mcu_pin_obj_t pin_PC05; extern const mcu_pin_obj_t pin_PB00; extern const mcu_pin_obj_t pin_PB01; extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only +extern const mcu_pin_obj_t pin_PF11; // 144 only +extern const mcu_pin_obj_t pin_PF12; // 144 only +extern const mcu_pin_obj_t pin_PF13; // 144 only +extern const mcu_pin_obj_t pin_PF14; // 144 only +extern const mcu_pin_obj_t pin_PF15; // 144 only +extern const mcu_pin_obj_t pin_PG00; // 144 only +extern const mcu_pin_obj_t pin_PG01; // 144 only //pg 55 extern const mcu_pin_obj_t pin_PE07; extern const mcu_pin_obj_t pin_PE08; diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c index a5f4eae78c..03fba62895 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c @@ -48,12 +48,10 @@ void stm32_peripherals_gpio_init(void) { // never_reset_pin_number(1,4); //PB4 JTRST // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,0); //PH0 JTDO // never_reset_pin_number(5,1); //PH1 JTRST } void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { } - - diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h index 15cbfb16d2..55c00ee936 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h @@ -54,4 +54,4 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[12]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c index 0f669f1c6c..4282741a84 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c @@ -38,17 +38,17 @@ const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11)); @@ -71,14 +71,14 @@ const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_12,8)); const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_12,9)); const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); //BOOT1 -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); @@ -91,7 +91,7 @@ const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h index 109dcb9226..a247fe6312 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h @@ -38,17 +38,17 @@ extern const mcu_pin_obj_t pin_PC13; extern const mcu_pin_obj_t pin_PC14; //pg 51 extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only +extern const mcu_pin_obj_t pin_PF00; // 144 only +extern const mcu_pin_obj_t pin_PF01; // 144 only +extern const mcu_pin_obj_t pin_PF02; // 144 only +extern const mcu_pin_obj_t pin_PF03; // 144 only +extern const mcu_pin_obj_t pin_PF04; // 144 only +extern const mcu_pin_obj_t pin_PF05; // 144 only +extern const mcu_pin_obj_t pin_PF06; // 144 only +extern const mcu_pin_obj_t pin_PF07; // 144 only +extern const mcu_pin_obj_t pin_PF08; // 144 only +extern const mcu_pin_obj_t pin_PF09; // 144 only +extern const mcu_pin_obj_t pin_PF10; // 144 only //pg 52 extern const mcu_pin_obj_t pin_PC00; extern const mcu_pin_obj_t pin_PC01; @@ -69,13 +69,13 @@ extern const mcu_pin_obj_t pin_PC05; extern const mcu_pin_obj_t pin_PB00; extern const mcu_pin_obj_t pin_PB01; extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only +extern const mcu_pin_obj_t pin_PF11; // 144 only +extern const mcu_pin_obj_t pin_PF12; // 144 only +extern const mcu_pin_obj_t pin_PF13; // 144 only +extern const mcu_pin_obj_t pin_PF14; // 144 only +extern const mcu_pin_obj_t pin_PF15; // 144 only +extern const mcu_pin_obj_t pin_PG00; // 144 only +extern const mcu_pin_obj_t pin_PG01; // 144 only //pg 55 extern const mcu_pin_obj_t pin_PE07; extern const mcu_pin_obj_t pin_PE08; diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c b/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c index 9aabffa9f6..08c6b55cde 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c @@ -56,5 +56,3 @@ void stm32_peripherals_gpio_init(void) { //LEDs are inverted on F411 DISCO void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { } - - diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h index 2c5e5dd564..14a73d12f1 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h @@ -54,4 +54,4 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[7]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F411XE_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F411XE_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c index eea2a1a1b3..ed89f0de6b 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c @@ -120,4 +120,4 @@ const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); \ No newline at end of file +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c index 3ec1b5b795..5ca4667a43 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c @@ -49,6 +49,6 @@ void stm32_peripherals_gpio_init(void) { //never_reset_pin_number(1,4); //PB4 JTRST // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,0); //PH0 JTDO // never_reset_pin_number(5,1); //PH1 JTRST } diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h index f668ace752..f6b001a4e9 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h @@ -55,4 +55,4 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[12]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c index ef3ce6d0ed..c1b624f4d5 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c @@ -38,17 +38,17 @@ const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); // 144 only const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); @@ -71,14 +71,14 @@ const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h index 5cf99345ce..8914530d2c 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h @@ -37,17 +37,17 @@ extern const mcu_pin_obj_t pin_PC13; extern const mcu_pin_obj_t pin_PC14; //pg 51 extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only +extern const mcu_pin_obj_t pin_PF00; // 144 only +extern const mcu_pin_obj_t pin_PF01; // 144 only +extern const mcu_pin_obj_t pin_PF02; // 144 only +extern const mcu_pin_obj_t pin_PF03; // 144 only +extern const mcu_pin_obj_t pin_PF04; // 144 only +extern const mcu_pin_obj_t pin_PF05; // 144 only +extern const mcu_pin_obj_t pin_PF06; // 144 only +extern const mcu_pin_obj_t pin_PF07; // 144 only +extern const mcu_pin_obj_t pin_PF08; // 144 only +extern const mcu_pin_obj_t pin_PF09; // 144 only +extern const mcu_pin_obj_t pin_PF10; // 144 only //pg 52 extern const mcu_pin_obj_t pin_PC00; extern const mcu_pin_obj_t pin_PC01; @@ -68,13 +68,13 @@ extern const mcu_pin_obj_t pin_PC05; extern const mcu_pin_obj_t pin_PB00; extern const mcu_pin_obj_t pin_PB01; extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only +extern const mcu_pin_obj_t pin_PF11; // 144 only +extern const mcu_pin_obj_t pin_PF12; // 144 only +extern const mcu_pin_obj_t pin_PF13; // 144 only +extern const mcu_pin_obj_t pin_PF14; // 144 only +extern const mcu_pin_obj_t pin_PF15; // 144 only +extern const mcu_pin_obj_t pin_PG00; // 144 only +extern const mcu_pin_obj_t pin_PG01; // 144 only //pg 55 extern const mcu_pin_obj_t pin_PE07; extern const mcu_pin_obj_t pin_PE08; diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c b/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c index cee4b4f457..ca64428eb0 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c @@ -50,4 +50,3 @@ void stm32_peripherals_gpio_init(void) { never_reset_pin_number(7,0); //PH0 OSC_IN never_reset_pin_number(7,1); //PH1 OSC_OUT } - diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c index 895ad5ec0d..ae940c1a05 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c @@ -28,7 +28,7 @@ #include "py/mphal.h" #include "peripherals/pins.h" -// Todo: some pins do have ADCs, but the module isn't set up yet. +// Todo: some pins do have ADCs, but the module isn't set up yet. const mcu_pin_obj_t pin_PA00 = PIN(0, 0, NO_ADC); const mcu_pin_obj_t pin_PA01 = PIN(0, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c b/ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c index d51ff53c1f..1189948c77 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c @@ -44,5 +44,3 @@ void stm32_peripherals_gpio_init(void) { never_reset_pin_number(0,13); //PA13 SWDIO never_reset_pin_number(0,14); //PA14 SWCLK } - - diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h index 98aa5782a8..438964c3e1 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h @@ -54,4 +54,4 @@ TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/pins.c b/ports/stm/peripherals/stm32f7/stm32f767xx/pins.c index 870545f994..5c9daea982 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/pins.c +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/pins.c @@ -28,7 +28,7 @@ #include "py/mphal.h" #include "peripherals/pins.h" -// Todo: some pins do have ADCs, but the module isn't set up yet. +// Todo: some pins do have ADCs, but the module isn't set up yet. const mcu_pin_obj_t pin_PA00 = PIN(0, 0, NO_ADC); const mcu_pin_obj_t pin_PA01 = PIN(0, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c b/ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c index d51ff53c1f..1189948c77 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c @@ -44,5 +44,3 @@ void stm32_peripherals_gpio_init(void) { never_reset_pin_number(0,13); //PA13 SWDIO never_reset_pin_number(0,14); //PA14 SWCLK } - - diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h b/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h index 4b852413b3..9aa2f7366b 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h @@ -52,4 +52,4 @@ const mcu_periph_obj_t mcu_uart_rx_list[26]; #define TIM_PIN_ARRAY_LEN 58 TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32H743XX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32H743XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/pins.c b/ports/stm/peripherals/stm32h7/stm32h743xx/pins.c index 491fe69385..7484781c2b 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/pins.c +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/pins.c @@ -28,7 +28,7 @@ #include "py/mphal.h" #include "peripherals/pins.h" -// Todo: some pins do have ADCs, but the module isn't set up yet. +// Todo: some pins do have ADCs, but the module isn't set up yet. const mcu_pin_obj_t pin_PA00 = PIN(0, 0, NO_ADC); const mcu_pin_obj_t pin_PA01 = PIN(0, 1, NO_ADC); diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 060eadecb3..d37a54f60f 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -321,4 +321,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, void supervisor_flash_release_cache(void) { } - diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 9b62fa2eb1..dfe4c5ba2f 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -453,4 +453,3 @@ void _init(void) { } - diff --git a/ports/stm/supervisor/serial.c b/ports/stm/supervisor/serial.c index ce13660000..3a058ed2e1 100644 --- a/ports/stm/supervisor/serial.c +++ b/ports/stm/supervisor/serial.c @@ -72,4 +72,3 @@ void serial_write_substring(const char *text, uint32_t len) { } HAL_UART_Transmit(&huart2, (uint8_t*)text, len, 5000); } - diff --git a/ports/stm/tools/examples/nucleo_h743.csv b/ports/stm/tools/examples/nucleo_h743.csv index 2481415b30..d3647ca42a 100644 --- a/ports/stm/tools/examples/nucleo_h743.csv +++ b/ports/stm/tools/examples/nucleo_h743.csv @@ -127,4 +127,4 @@ ETH_RMII_RXD0,PC4 ETH_RMII_RXD1,PC5 ETH_RMII_TX_EN,PG11 ETH_RMII_TXD0,PG13 -ETH_RMII_TXD1,PB13 \ No newline at end of file +ETH_RMII_TXD1,PB13 diff --git a/ports/stm/tools/parse_af_csv.py b/ports/stm/tools/parse_af_csv.py index b257a450c2..4e97252602 100644 --- a/ports/stm/tools/parse_af_csv.py +++ b/ports/stm/tools/parse_af_csv.py @@ -28,8 +28,8 @@ import sys # Use: parse_af_csf.py Filename.csv -pins-only # Designed for use with .csv files from Micropython, or in identical format # created via Datasheet peripheral tables with a Sheets program. -# -# See examples/stm32f405.csv for example formatting. +# +# See examples/stm32f405.csv for example formatting. # Most peripherals (SPI, I2C) output 3 values: # peripheral index, alt function, pin string @@ -52,7 +52,7 @@ def evaluate_tim(inper, inlist, altfn, pin): if inper[:3] == "TIM" and inper[5:7] == "CH" and inper[-1:] != 'N': inlist.append([inper[3:4],altfn,inper[-1:],pin]) - + # Open target file with open(sys.argv[1]) as csv_file: csv_reader = csv.reader(csv_file, delimiter=',') @@ -107,7 +107,7 @@ with open(sys.argv[1]) as csv_file: print(" PERIPH(" + row[0] + ", " + str(row[1]) + ", &pin_" + row[2] + "),") print("};") - # Timer special case: + # Timer special case: print("const mcu_tim_pin_obj_t mcu_tim_pin_list[" + str(len(outlist[-1])) + "] = {") for row in outlist[-1]: print(" TIM(" + row[0] + ", " + str(row[1]) + ", " + str(row[2]) + ", &pin_" + row[3] + "),") diff --git a/ports/stm/tools/parse_pins_csv.py b/ports/stm/tools/parse_pins_csv.py index b69b4791be..4ab3fc25c9 100644 --- a/ports/stm/tools/parse_pins_csv.py +++ b/ports/stm/tools/parse_pins_csv.py @@ -25,12 +25,12 @@ import csv import sys -# Use: parse_pins_csv.py Filename.csv +# Use: parse_pins_csv.py Filename.csv # Designed for use with .csv files from Micropython, or in identical format # created via Datasheet peripheral tables with a Sheets program. -# -# See examples/nucleo_h743.csv for example formatting. - +# +# See examples/nucleo_h743.csv for example formatting. + # Open target file with open(sys.argv[1]) as csv_file: csv_reader = csv.reader(csv_file, delimiter=',') diff --git a/py/proto.h b/py/proto.h index 2d4f805659..fadf1f8822 100644 --- a/py/proto.h +++ b/py/proto.h @@ -40,4 +40,3 @@ const void *mp_proto_get_or_throw(uint16_t name, mp_const_obj_t obj); #endif #endif - diff --git a/py/stackctrl.c b/py/stackctrl.c index 46cbefc8c1..26fc065b7d 100644 --- a/py/stackctrl.c +++ b/py/stackctrl.c @@ -77,7 +77,7 @@ void mp_stack_set_bottom(void* stack_bottom) { // // The stack_dummy approach used elsewhere in this file is not safe in // all cases. That value may be below the actual top of the stack. -static void* approx_stack_pointer(void){ +static void* approx_stack_pointer(void){ __asm volatile (""); return __builtin_frame_address(0); } @@ -90,7 +90,7 @@ void mp_stack_fill_with_sentinel(void) { // Continue until we've hit the bottom of the stack (lowest address, // logical "ceiling" of stack). char* p = (char *) approx_stack_pointer() - 1; - + while(p >= MP_STATE_THREAD(stack_bottom)) { *p-- = MP_MAX_STACK_USAGE_SENTINEL_BYTE; } diff --git a/py/stream.h b/py/stream.h index 543fe8c82a..dc9fc84c96 100644 --- a/py/stream.h +++ b/py/stream.h @@ -95,7 +95,7 @@ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_ioctl_obj); // Object is assumed to have a non-NULL stream protocol with valid r/w/ioctl methods static inline const mp_stream_p_t *mp_get_stream(mp_const_obj_t self) { - return mp_proto_get(MP_QSTR_protocol_stream, self); + return mp_proto_get(MP_QSTR_protocol_stream, self); } const mp_stream_p_t *mp_get_stream_raise(mp_obj_t self_in, int flags); diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 63a4eaa17e..c953951ea5 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -55,7 +55,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| //| When ``P`` (PWM duration) is present as the 4th character of the byteorder //| string, the 4th value in the tuple/list for a pixel is the individual pixel -//| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte for each +//| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte for each //| pixel. //| //| :param ~int size: Number of pixels diff --git a/shared-bindings/aesio/__init__.c b/shared-bindings/aesio/__init__.c index fa2a2c426e..80913b70ad 100644 --- a/shared-bindings/aesio/__init__.c +++ b/shared-bindings/aesio/__init__.c @@ -63,4 +63,3 @@ const mp_obj_module_t aesio_module = { .base = {&mp_type_module}, .globals = (mp_obj_dict_t *)&aesio_module_globals, }; - diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 505e9f7665..33d0bdd3cb 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -122,4 +122,3 @@ const mp_obj_type_t displayio_colorconverter_type = { .make_new = displayio_colorconverter_make_new, .locals_dict = (mp_obj_dict_t*)&displayio_colorconverter_locals_dict, }; - diff --git a/shared-bindings/framebufferio/__init__.c b/shared-bindings/framebufferio/__init__.c index 492423464a..3e58162bf2 100644 --- a/shared-bindings/framebufferio/__init__.c +++ b/shared-bindings/framebufferio/__init__.c @@ -48,4 +48,3 @@ const mp_obj_module_t framebufferio_module = { .globals = (mp_obj_dict_t*)&framebufferio_module_globals, }; #endif - diff --git a/shared-bindings/nvm/__init__.c b/shared-bindings/nvm/__init__.c index cdcc285dc4..e9784bd187 100644 --- a/shared-bindings/nvm/__init__.c +++ b/shared-bindings/nvm/__init__.c @@ -35,7 +35,7 @@ //| //| The `nvm` module allows you to store whatever raw bytes you wish in a //| reserved section non-volatile memory. -//| +//| //| Note that this module can't be imported and used directly. The sole //| instance of :class:`ByteArray` is available at //| :attr:`microcontroller.nvm`.""" diff --git a/shared-bindings/supervisor/__init__.h b/shared-bindings/supervisor/__init__.h index d2e5689452..b79bdacca3 100755 --- a/shared-bindings/supervisor/__init__.h +++ b/shared-bindings/supervisor/__init__.h @@ -36,4 +36,4 @@ extern const super_runtime_obj_t common_hal_supervisor_runtime_obj; -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SUPERVISOR___INIT___H \ No newline at end of file +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SUPERVISOR___INIT___H diff --git a/shared-bindings/ulab/approx/__init__.pyi b/shared-bindings/ulab/approx/__init__.pyi index 89f136f690..7e012690f3 100644 --- a/shared-bindings/ulab/approx/__init__.pyi +++ b/shared-bindings/ulab/approx/__init__.pyi @@ -7,7 +7,7 @@ def bisect(fun, a, b, *, xtol=2.4e-7, maxiter=100) -> float: :param float b: The right side of the interval :param float xtol: The tolerance value :param float maxiter: The maximum number of iterations to perform - + Find a solution (zero) of the function ``f(x)`` on the interval (``a``..``b``) using the bisection method. The result is accurate to within ``xtol`` unless more than ``maxiter`` steps are required.""" @@ -46,7 +46,6 @@ def interp(x: ulab.array, xp:ulab.array, fp:ulab.array, *, left=None, right=None :param ulab.array fp: The y-coordinates of the data points, same length as xp :param left: Value to return for ``x < xp[0]``, default is ``fp[0]``. :param right: Value to return for ``x > xp[-1]``, default is ``fp[-1]``. - + Returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, fp), evaluated at x.""" ... - diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index 6b5682e149..65923fd96a 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -72,4 +72,3 @@ const mp_obj_type_t vectorio_circle_type = { .make_new = vectorio_circle_make_new, .locals_dict = (mp_obj_dict_t*)&vectorio_circle_locals_dict, }; - diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index 01045d098f..3443d9e426 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -92,4 +92,3 @@ const mp_obj_type_t vectorio_polygon_type = { .make_new = vectorio_polygon_make_new, .locals_dict = (mp_obj_dict_t*)&vectorio_polygon_locals_dict, }; - diff --git a/shared-bindings/wiznet/__init__.c b/shared-bindings/wiznet/__init__.c index 0b0b7b14b7..0d3f1e4cd6 100644 --- a/shared-bindings/wiznet/__init__.c +++ b/shared-bindings/wiznet/__init__.c @@ -52,4 +52,3 @@ const mp_obj_module_t wiznet_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t*)&mp_module_wiznet_globals, }; - diff --git a/shared-module/_bleio/ScanResults.c b/shared-module/_bleio/ScanResults.c index ae36f8863d..cb48d636dc 100644 --- a/shared-module/_bleio/ScanResults.c +++ b/shared-module/_bleio/ScanResults.c @@ -56,7 +56,7 @@ mp_obj_t common_hal_bleio_scanresults_next(bleio_scanresults_obj_t *self) { uint8_t type = ringbuf_get(&self->buf); bool connectable = (type & (1 << 0)) != 0; bool scan_response = (type & (1 << 1)) != 0; - uint64_t ticks_ms; + uint64_t ticks_ms; ringbuf_get_n(&self->buf, (uint8_t*) &ticks_ms, sizeof(ticks_ms)); uint8_t rssi = ringbuf_get(&self->buf); uint8_t peer_addr[NUM_BLEIO_ADDRESS_BYTES]; @@ -81,7 +81,7 @@ mp_obj_t common_hal_bleio_scanresults_next(bleio_scanresults_obj_t *self) { entry->time_received = ticks_ms; entry->connectable = connectable; entry->scan_response = scan_response; - + return MP_OBJ_FROM_PTR(entry); } diff --git a/shared-module/_eve/__init__.c b/shared-module/_eve/__init__.c index 2c93eb69f7..0f1e12d9fd 100644 --- a/shared-module/_eve/__init__.c +++ b/shared-module/_eve/__init__.c @@ -314,4 +314,3 @@ void common_hal__eve_VertexTranslateY(common_hal__eve_t *eve, uint32_t y) { void common_hal__eve_Vertex2ii(common_hal__eve_t *eve, uint32_t x, uint32_t y, uint32_t handle, uint32_t cell) { C4(eve, ((2 << 30) | (((x) & 511) << 21) | (((y) & 511) << 12) | (((handle) & 31) << 7) | (((cell) & 127) << 0))); } - diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index 2c9fb6d789..c2c3214aae 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -110,7 +110,7 @@ void common_hal_displayio_colorconverter_convert(displayio_colorconverter_t *sel displayio_input_pixel_t input_pixel; input_pixel.pixel = input_color; input_pixel.x = input_pixel.y = input_pixel.tile = input_pixel.tile_x = input_pixel.tile_y = 0; - + displayio_output_pixel_t output_pixel; output_pixel.pixel = 0; output_pixel.opaque = false; @@ -130,7 +130,7 @@ bool common_hal_displayio_colorconverter_get_dither(displayio_colorconverter_t* void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _displayio_colorspace_t* colorspace, const displayio_input_pixel_t *input_pixel, displayio_output_pixel_t *output_color) { uint32_t pixel = input_pixel->pixel; - + if (self->dither){ uint8_t randr = (displayio_colorconverter_dither_noise_2(input_pixel->tile_x,input_pixel->tile_y)); uint8_t randg = (displayio_colorconverter_dither_noise_2(input_pixel->tile_x+33,input_pixel->tile_y)); @@ -193,4 +193,3 @@ bool displayio_colorconverter_needs_refresh(displayio_colorconverter_t *self) { void displayio_colorconverter_finish_refresh(displayio_colorconverter_t *self) { } - diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 281c6fe90f..a3d877f1a9 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -170,7 +170,7 @@ bool common_hal_displayio_display_set_brightness(displayio_display_obj_t* self, brightness = 1.0-brightness; } bool ok = false; - + // Avoid PWM types and functions when the module isn't enabled #if (CIRCUITPY_PULSEIO) bool ispwm = (self->backlight_pwm.base.type == &pulseio_pwmout_type) ? true : false; @@ -413,7 +413,7 @@ void release_display(displayio_display_obj_t* self) { #if (CIRCUITPY_PULSEIO) if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { common_hal_pulseio_pwmout_reset_ok(&self->backlight_pwm); - common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); + common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); } else if (self->backlight_inout.base.type == &digitalio_digitalinout_type) { common_hal_digitalio_digitalinout_deinit(&self->backlight_inout); } diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index c4855c3331..2766cbecdc 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -435,7 +435,7 @@ bool displayio_tilegrid_fill_area(displayio_tilegrid_t *self, const _displayio_c } else if (MP_OBJ_IS_TYPE(self->bitmap, &displayio_ondiskbitmap_type)) { input_pixel.pixel = common_hal_displayio_ondiskbitmap_get_pixel(self->bitmap, input_pixel.tile_x, input_pixel.tile_y); } - + output_pixel.opaque = true; if (self->pixel_shader == mp_const_none) { output_pixel.pixel = input_pixel.pixel; diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 2a88b53070..f296da4095 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -57,7 +57,7 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu NULL, self->framebuffer_protocol->get_width(self->framebuffer), self->framebuffer_protocol->get_height(self->framebuffer), - ram_width, + ram_width, ram_height, 0, 0, diff --git a/shared-module/network/__init__.c b/shared-module/network/__init__.c index 925e9a2a30..a45191d8c8 100644 --- a/shared-module/network/__init__.c +++ b/shared-module/network/__init__.c @@ -37,7 +37,7 @@ #include "shared-module/network/__init__.h" -// mod_network_nic_list needs to be declared in mpconfigport.h +// mod_network_nic_list needs to be declared in mpconfigport.h void network_module_init(void) { @@ -47,7 +47,7 @@ void network_module_init(void) { void network_module_deinit(void) { for (mp_uint_t i = 0; i < MP_STATE_PORT(mod_network_nic_list).len; i++) { mp_obj_t nic = MP_STATE_PORT(mod_network_nic_list).items[i]; - mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); + mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); if (nic_type->deinit != NULL) nic_type->deinit(nic); } mp_obj_list_set_len(&MP_STATE_PORT(mod_network_nic_list), 0); @@ -61,7 +61,7 @@ void network_module_background(void) { for (mp_uint_t i = 0; i < MP_STATE_PORT(mod_network_nic_list).len; i++) { mp_obj_t nic = MP_STATE_PORT(mod_network_nic_list).items[i]; - mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); + mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); if (nic_type->timer_tick != NULL) nic_type->timer_tick(nic); } } diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index df064ff81f..6dad91679f 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -206,4 +206,3 @@ int common_hal_rgbmatrix_rgbmatrix_get_height(rgbmatrix_rgbmatrix_obj_t* self) { int computed_height = (self->rgb_count / 3) << (self->addr_count); return computed_height; } - diff --git a/shared-module/ustack/__init__.c b/shared-module/ustack/__init__.c index 947f81f8e5..1e168ad6a0 100644 --- a/shared-module/ustack/__init__.c +++ b/shared-module/ustack/__init__.c @@ -49,4 +49,3 @@ uint32_t shared_module_ustack_stack_size() { uint32_t shared_module_ustack_stack_usage() { return mp_stack_usage(); } - diff --git a/shared-module/vectorio/Circle.c b/shared-module/vectorio/Circle.c index 999d625121..73629b8cee 100644 --- a/shared-module/vectorio/Circle.c +++ b/shared-module/vectorio/Circle.c @@ -53,4 +53,3 @@ void common_hal_vectorio_circle_set_radius(void *obj, int16_t radius) { self->on_dirty.event(self->on_dirty.obj); } } - diff --git a/shared-module/vectorio/Circle.h b/shared-module/vectorio/Circle.h index 4b43d767ec..d6a77b1667 100644 --- a/shared-module/vectorio/Circle.h +++ b/shared-module/vectorio/Circle.h @@ -14,4 +14,3 @@ typedef struct { } vectorio_circle_t; #endif // MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_CIRCLE_H - diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c index aadf47911a..0025d4bfc4 100644 --- a/shared-module/vectorio/Polygon.c +++ b/shared-module/vectorio/Polygon.c @@ -136,7 +136,7 @@ uint32_t common_hal_vectorio_polygon_get_pixel(void *obj, int16_t x, int16_t y) } else if ( y2 <= y && line_side(x1, y1, x2, y2, x, y) < 0 ) { // Wind down, point is to the left of the edge vector --winding_number; - VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", -1, winding_number); + VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", -1, winding_number); } x1 = x2; @@ -144,4 +144,3 @@ uint32_t common_hal_vectorio_polygon_get_pixel(void *obj, int16_t x, int16_t y) } return winding_number == 0 ? 0 : 1; } - diff --git a/shared-module/vectorio/Rectangle.c b/shared-module/vectorio/Rectangle.c index 7fabe6ff93..5d48cc6480 100644 --- a/shared-module/vectorio/Rectangle.c +++ b/shared-module/vectorio/Rectangle.c @@ -32,4 +32,3 @@ uint32_t common_hal_vectorio_rectangle_get_height(void *rectangle) { vectorio_rectangle_t *self = rectangle; return self->height; } - diff --git a/shared-module/vectorio/Rectangle.h b/shared-module/vectorio/Rectangle.h index c1f2a7a64e..56342a6d76 100644 --- a/shared-module/vectorio/Rectangle.h +++ b/shared-module/vectorio/Rectangle.h @@ -12,4 +12,3 @@ typedef struct { } vectorio_rectangle_t; #endif // MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_RECTANGLE_H - diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c index 4fb353aae7..bfe8a7b259 100644 --- a/shared-module/vectorio/VectorShape.c +++ b/shared-module/vectorio/VectorShape.c @@ -191,7 +191,7 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ bool full_coverage = displayio_area_equal(area, &overlap); uint8_t pixels_per_byte = 8 / colorspace->depth; - + uint32_t linestride_px = displayio_area_width(area); uint32_t line_dirty_offset_px = (overlap.y1 - area->y1) * linestride_px; uint32_t column_dirty_offset_px = overlap.x1 - area->x1; @@ -332,5 +332,3 @@ void vectorio_vector_shape_update_transform(vectorio_vector_shape_t *self, displ self->absolute_transform = group_transform == NULL ? &null_transform : group_transform; common_hal_vectorio_vector_shape_set_dirty(self); } - - diff --git a/shared-module/vectorio/__init__.c b/shared-module/vectorio/__init__.c index 473c509c3c..f5227ef01f 100644 --- a/shared-module/vectorio/__init__.c +++ b/shared-module/vectorio/__init__.c @@ -1,3 +1,2 @@ // Don't need anything in here yet - diff --git a/shared-module/vectorio/__init__.h b/shared-module/vectorio/__init__.h index 6ae381f067..8da85bba43 100644 --- a/shared-module/vectorio/__init__.h +++ b/shared-module/vectorio/__init__.h @@ -12,4 +12,3 @@ typedef struct { #endif - diff --git a/supervisor/shared/bluetooth.h b/supervisor/shared/bluetooth.h index 7ebcb953f0..1fb6a879a8 100644 --- a/supervisor/shared/bluetooth.h +++ b/supervisor/shared/bluetooth.h @@ -31,4 +31,4 @@ void supervisor_start_bluetooth(void); bool supervisor_bluetooth_hook(ble_evt_t *ble_evt); void supervisor_bluetooth_background(void); -#endif \ No newline at end of file +#endif diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 23516799fa..47395bd602 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -140,4 +140,3 @@ extern void supervisor_disable_tick(void) { } common_hal_mcu_enable_interrupts(); } - diff --git a/supervisor/stub/internal_flash.c b/supervisor/stub/internal_flash.c index 5db6b5bc00..5a82f81f77 100644 --- a/supervisor/stub/internal_flash.c +++ b/supervisor/stub/internal_flash.c @@ -63,4 +63,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, void supervisor_flash_release_cache(void) { } - diff --git a/tests/basics/assign1.py b/tests/basics/assign1.py index 118747f74a..01047fa929 100644 --- a/tests/basics/assign1.py +++ b/tests/basics/assign1.py @@ -8,4 +8,3 @@ print(a, b) a = b = c = 3 print(a, b, c) - diff --git a/tests/basics/builtin_chr.py b/tests/basics/builtin_chr.py index 02d783ae66..c1a9f70530 100644 --- a/tests/basics/builtin_chr.py +++ b/tests/basics/builtin_chr.py @@ -6,4 +6,3 @@ try: chr(0x110000) except ValueError: print("ValueError") - diff --git a/tests/basics/dict_popitem.py b/tests/basics/dict_popitem.py index e37bcec19e..0e3384253f 100644 --- a/tests/basics/dict_popitem.py +++ b/tests/basics/dict_popitem.py @@ -13,4 +13,3 @@ except KeyError: else: print("Did not raise KeyError") print(sorted(els)) - diff --git a/tests/basics/dict_setdefault.py b/tests/basics/dict_setdefault.py index 57d0ba4518..87de5b3af5 100644 --- a/tests/basics/dict_setdefault.py +++ b/tests/basics/dict_setdefault.py @@ -9,5 +9,3 @@ d.pop(5) print(d.setdefault(5, 1)) print(d[1]) print(d[5]) - - diff --git a/tests/basics/gen_yield_from_throw.py b/tests/basics/gen_yield_from_throw.py index 829bf0f3b4..d6754d5cd1 100644 --- a/tests/basics/gen_yield_from_throw.py +++ b/tests/basics/gen_yield_from_throw.py @@ -21,7 +21,7 @@ except TypeError: def gen3(): yield 123 yield 456 - + g3 = gen3() print(next(g3)) try: diff --git a/tests/basics/gen_yield_from_throw2.py b/tests/basics/gen_yield_from_throw2.py index 0abfdd8cc3..5c0fc7dbc9 100644 --- a/tests/basics/gen_yield_from_throw2.py +++ b/tests/basics/gen_yield_from_throw2.py @@ -6,7 +6,7 @@ def gen(): except GeneratorExit: print('GeneratorExit') yield 456 - + # thrown a class g = gen() print(next(g)) diff --git a/tests/basics/int_big_and2.py b/tests/basics/int_big_and2.py index f8c81fe0cd..045a90ef75 100644 --- a/tests/basics/int_big_and2.py +++ b/tests/basics/int_big_and2.py @@ -1,4 +1,4 @@ -# test + + +# test + + print( 97989513389222316022151446562729620153292831887555425160965597396 & 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( 283894311 print( 40019818573920230246248826511203818792007462193311949166285967147 & 9487909752) -# test - - +# test - - print( -97989513389222316022151446562729620153292831887555425160965597396 & -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_and3.py b/tests/basics/int_big_and3.py index 788ecd823b..7a3b415af7 100644 --- a/tests/basics/int_big_and3.py +++ b/tests/basics/int_big_and3.py @@ -1,4 +1,4 @@ -# test - + +# test - + print( -97989513389222316022151446562729620153292831887555425160965597396 & 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( -283894311 print( -40019818573920230246248826511203818792007462193311949166285967147 & 9487909752) -# test + - +# test + - print( 97989513389222316022151446562729620153292831887555425160965597396 & -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_or.py b/tests/basics/int_big_or.py index 17d9935265..ccded37781 100644 --- a/tests/basics/int_big_or.py +++ b/tests/basics/int_big_or.py @@ -3,7 +3,7 @@ print(0 | (1 << 80)) a = 0xfffffffffffffffffffffffffffff print(a | (1 << 200)) -# test + + +# test + + print(0 | (1 << 80)) print((1 << 80) | (1 << 80)) @@ -15,7 +15,7 @@ print(a | (1 << 200)) print(a | a == 0) print(bool(a | a)) -# test - + +# test - + print((-1 << 80) | (1 << 80)) print((-1 << 80) | 0) @@ -25,7 +25,7 @@ print((-a) | (1 << 200)) print((-a) | a == 0) print(bool((-a) | a)) -# test + - +# test + - print(0 | (-1 << 80)) print((1 << 80) | (-1 << 80)) @@ -35,7 +35,7 @@ print(a | (-1 << 200)) print(a | (-a) == 0) print(bool(a | (-a))) -# test - - +# test - - print((-1 << 80) | (-1 << 80)) diff --git a/tests/basics/int_big_or2.py b/tests/basics/int_big_or2.py index 255495150a..92d76c7703 100644 --- a/tests/basics/int_big_or2.py +++ b/tests/basics/int_big_or2.py @@ -1,4 +1,4 @@ -# test + + +# test + + print( 97989513389222316022151446562729620153292831887555425160965597396 | 23716683549865351578586448630079789776107310103486834795830390982) @@ -23,7 +23,7 @@ print( 283894311 print( 40019818573920230246248826511203818792007462193311949166285967147 | 9487909752) -# test - - +# test - - print( -97989513389222316022151446562729620153292831887555425160965597396 | -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_or3.py b/tests/basics/int_big_or3.py index 07edaea2df..212b3da8a6 100644 --- a/tests/basics/int_big_or3.py +++ b/tests/basics/int_big_or3.py @@ -1,4 +1,4 @@ -# test - + +# test - + print( -97989513389222316022151446562729620153292831887555425160965597396 | 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( -283894311 print( -40019818573920230246248826511203818792007462193311949166285967147 | 9487909752) -# test + - +# test + - print( 97989513389222316022151446562729620153292831887555425160965597396 | -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_xor.py b/tests/basics/int_big_xor.py index cd1d9ae97f..28b191d3d9 100644 --- a/tests/basics/int_big_xor.py +++ b/tests/basics/int_big_xor.py @@ -1,4 +1,4 @@ -# test + + +# test + + print(0 ^ (1 << 80)) print((1 << 80) ^ (1 << 80)) @@ -10,7 +10,7 @@ print(a ^ (1 << 200)) print(a ^ a == 0) print(bool(a ^ a)) -# test - + +# test - + print((-1 << 80) ^ (1 << 80)) print((-1 << 80) ^ 0) @@ -22,7 +22,7 @@ print(bool((-a) ^ a)) i = -1 print(i ^ 0xffffffffffffffff) # carry overflows to higher digit -# test + - +# test + - print(0 ^ (-1 << 80)) print((1 << 80) ^ (-1 << 80)) @@ -32,7 +32,7 @@ print(a ^ (-1 << 200)) print(a ^ (-a) == 0) print(bool(a ^ (-a))) -# test - - +# test - - print((-1 << 80) ^ (-1 << 80)) diff --git a/tests/basics/int_big_xor2.py b/tests/basics/int_big_xor2.py index b5b3db60c6..21ef842f86 100644 --- a/tests/basics/int_big_xor2.py +++ b/tests/basics/int_big_xor2.py @@ -1,4 +1,4 @@ -# test + + +# test + + print( 97989513389222316022151446562729620153292831887555425160965597396 ^ 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( 283894311 print( 40019818573920230246248826511203818792007462193311949166285967147 ^ 9487909752) -# test - - +# test - - print( -97989513389222316022151446562729620153292831887555425160965597396 ^ -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_xor3.py b/tests/basics/int_big_xor3.py index 00881e3740..ff5e9aeff2 100644 --- a/tests/basics/int_big_xor3.py +++ b/tests/basics/int_big_xor3.py @@ -1,4 +1,4 @@ -# test - + +# test - + print( -97989513389222316022151446562729620153292831887555425160965597396 ^ 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( -283894311 print( -40019818573920230246248826511203818792007462193311949166285967147 ^ 9487909752) -# test + - +# test + - print( 97989513389222316022151446562729620153292831887555425160965597396 ^ -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/set_iter.py b/tests/basics/set_iter.py index 2960177303..e7da28e1b5 100644 --- a/tests/basics/set_iter.py +++ b/tests/basics/set_iter.py @@ -2,4 +2,3 @@ s = {1, 2, 3, 4} l = list(s) l.sort() print(l) - diff --git a/tests/basics/string_cr_conversion.py b/tests/basics/string_cr_conversion.py index 0c3ba16b86..b8ec7e8259 100644 --- a/tests/basics/string_cr_conversion.py +++ b/tests/basics/string_cr_conversion.py @@ -1 +1 @@ -# this file has CR line endings to test lexer's conversion of them to LF # in triple quoted strings print(repr("""abc def""")) \ No newline at end of file +# this file has CR line endings to test lexer's conversion of them to LF # in triple quoted strings print(repr("""abc def""")) diff --git a/tests/basics/subscr_tuple.py b/tests/basics/subscr_tuple.py index 85d25366da..0210e24df8 100644 --- a/tests/basics/subscr_tuple.py +++ b/tests/basics/subscr_tuple.py @@ -4,4 +4,3 @@ class Foo(tuple): foo = Foo((1,2)) foo[0] - diff --git a/tests/extmod/uctypes_array_assign_le.py b/tests/extmod/uctypes_array_assign_le.py index 6afa7e0a24..37c52388d6 100644 --- a/tests/extmod/uctypes_array_assign_le.py +++ b/tests/extmod/uctypes_array_assign_le.py @@ -55,4 +55,3 @@ assert hex(S.arr6[0]) == "0xaabbccdd" print(S.arr6[0] == S.arr8[0].l) assert S.arr6[0] == S.arr8[0].l - diff --git a/tests/extmod/uctypes_byteat.py b/tests/extmod/uctypes_byteat.py index ab2535db8f..784209f803 100644 --- a/tests/extmod/uctypes_byteat.py +++ b/tests/extmod/uctypes_byteat.py @@ -6,5 +6,5 @@ except ImportError: data = bytearray(b'01234567') -print(uctypes.bytes_at(uctypes.addressof(data), 4)) -print(uctypes.bytearray_at(uctypes.addressof(data), 4)) +print(uctypes.bytes_at(uctypes.addressof(data), 4)) +print(uctypes.bytearray_at(uctypes.addressof(data), 4)) diff --git a/tests/extmod/uctypes_error.py b/tests/extmod/uctypes_error.py index 95ba0fad44..2500e29278 100644 --- a/tests/extmod/uctypes_error.py +++ b/tests/extmod/uctypes_error.py @@ -9,29 +9,29 @@ except ImportError: data = bytearray(b"01234567") # del subscr not supported -S = uctypes.struct(uctypes.addressof(data), {}) +S = uctypes.struct(uctypes.addressof(data), {}) try: del S[0] except TypeError: print('TypeError') # list is an invalid descriptor -S = uctypes.struct(uctypes.addressof(data), []) +S = uctypes.struct(uctypes.addressof(data), []) try: - S.x + S.x except TypeError: print('TypeError') # can't access attribute with invalid descriptor S = uctypes.struct(uctypes.addressof(data), {'x':[]}) try: - S.x + S.x except TypeError: print('TypeError') # can't assign to aggregate S = uctypes.struct(uctypes.addressof(data), {'x':(uctypes.ARRAY | 0, uctypes.INT8 | 2)}) try: - S.x = 1 + S.x = 1 except TypeError: print('TypeError') diff --git a/tests/extmod/ujson_dump_iobase.py b/tests/extmod/ujson_dump_iobase.py index d30d1b561e..6280fb11b6 100644 --- a/tests/extmod/ujson_dump_iobase.py +++ b/tests/extmod/ujson_dump_iobase.py @@ -28,5 +28,5 @@ class S(io.IOBase): # dump to the user stream s = S() -json.dump([123, {}], s) +json.dump([123, {}], s) print(s.buf) diff --git a/tests/extmod/ure_sub.py b/tests/extmod/ure_sub.py index 4aeb8650a1..f5a19af8db 100644 --- a/tests/extmod/ure_sub.py +++ b/tests/extmod/ure_sub.py @@ -27,11 +27,11 @@ print(re.sub('a', A(), 'aBCBABCDabcda.')) print( re.sub( - r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', - 'static PyObject*\npy_\\1(void){\n return;\n}\n', + r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', + 'static PyObject*\npy_\\1(void){\n return;\n}\n', '\n\ndef myfunc():\n\ndef myfunc1():\n\ndef myfunc2():' ) -) +) print( re.compile( diff --git a/tests/feature_check/complex.py b/tests/feature_check/complex.py index a22eb52ce3..7576dcb953 100644 --- a/tests/feature_check/complex.py +++ b/tests/feature_check/complex.py @@ -3,4 +3,3 @@ try: print("complex") except NameError: print("no") - diff --git a/tests/float/builtin_float_minmax.py b/tests/float/builtin_float_minmax.py index 266ed133d5..8a53746e5d 100644 --- a/tests/float/builtin_float_minmax.py +++ b/tests/float/builtin_float_minmax.py @@ -29,4 +29,3 @@ print(min([1, 2.9, 4, 6.5, -1, 2])) print(max([1, 2.9, 4, 6.5, -1, 2])) print(min([1, 2.9, 4, -6.5, -1, 2])) print(max([1, 2.9, 4, -6.5, -1, 2])) - diff --git a/tests/float/float_struct.py b/tests/float/float_struct.py index c4c186b89e..dd7a418ad5 100644 --- a/tests/float/float_struct.py +++ b/tests/float/float_struct.py @@ -15,4 +15,3 @@ for fmt in ('f', 'd', '>f', '>d', ' Date: Sat, 30 May 2020 10:44:57 +0100 Subject: [PATCH 097/131] Add a pre-commit configuration to enforce basic file hygiene. --- .github/workflows/pre-commit.yml | 24 ++++++++++++++++++++++++ .pre-commit-config.yaml | 13 +++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000000..116829296d --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: Copyright (c) 2019 Anthony Sottile +# +# SPDX-License-Identifier: MIT + +name: pre-commit + +on: + pull_request: + push: + branches: [master] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + - name: set PY + run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" + - uses: actions/cache@v1 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - uses: pre-commit/action@v1.1.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..7c41ca3ce8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò +# +# SPDX-License-Identifier: Unlicense + +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)' + - id: trailing-whitespace + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)' From c93ccd1e918b58b68dfdb783b3770233e884c32b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 3 Jun 2020 12:04:40 -0400 Subject: [PATCH 098/131] Disable pin resets on the 1060 --- ports/mimxrt10xx/boards/teensy41/board.c | 1 + ports/mimxrt10xx/supervisor/port.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ports/mimxrt10xx/boards/teensy41/board.c b/ports/mimxrt10xx/boards/teensy41/board.c index f9dea01f70..28786ab902 100644 --- a/ports/mimxrt10xx/boards/teensy41/board.c +++ b/ports/mimxrt10xx/boards/teensy41/board.c @@ -27,6 +27,7 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" void board_init(void) { // FLEX flash diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index acec3cf727..40d28d2ef8 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -306,7 +306,9 @@ void reset_port(void) { //reset_event_system(); + #if !defined (MIMXRT1062_SERIES) reset_all_pins(); + #endif } void reset_to_bootloader(void) { From 660081ece233b7c9caaa15fd63dcdeba50081443 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 3 Jun 2020 17:28:08 -0500 Subject: [PATCH 099/131] tools/cpboard.py: change 'async' variable usage; 'async' became a keyword in CPython 3.7 --- tools/cpboard.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/cpboard.py b/tools/cpboard.py index 0b9c43c614..7bb6daaeb5 100644 --- a/tools/cpboard.py +++ b/tools/cpboard.py @@ -118,7 +118,7 @@ class REPL: self.write(b'\r' + REPL.CHAR_CTRL_B) # enter or reset friendly repl data = self.read_until(b'>>> ') - def execute(self, code, timeout=10, async=False): + def execute(self, code, timeout=10, wait_for_response=False): self.read() # Throw away self.write(REPL.CHAR_CTRL_A) @@ -127,7 +127,7 @@ class REPL: self.write(code) self.write(REPL.CHAR_CTRL_D) - if async: + if wait_for_response: return b'', b'' self.read_until(b'OK') @@ -424,10 +424,11 @@ class CPboard: self.serial.close() self.serial = None - def exec(self, command, timeout=10, async=False): + def exec(self, command, timeout=10, wait_for_response=False): with self.repl as repl: try: - output, error = repl.execute(command, timeout=timeout, async=async) + output, error = repl.execute(command, timeout=timeout, + wait_for_response=wait_for_response) except OSError as e: if self.debug: print('exec: session: ', self.repl.session) @@ -451,7 +452,8 @@ class CPboard: def _reset(self, mode='NORMAL'): self.exec("import microcontroller;microcontroller.on_next_reset(microcontroller.RunMode.%s)" % mode) try: - self.exec("import microcontroller;microcontroller.reset()", async=True) + self.exec("import microcontroller;microcontroller.reset()", + wait_for_response=True) except OSError: pass From cf9da5982996f0eab8b0cb1ff4559050533db905 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 3 Jun 2020 17:39:31 -0500 Subject: [PATCH 100/131] tools/cpboard.py: update pyserial usage to match 3.x version --- tools/cpboard.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/cpboard.py b/tools/cpboard.py index 7bb6daaeb5..8c60077c2c 100644 --- a/tools/cpboard.py +++ b/tools/cpboard.py @@ -73,8 +73,8 @@ class REPL: return self.board.serial def read(self): - if self.serial.inWaiting(): - data = self.serial.read(self.serial.inWaiting()) + if self.serial.in_waiting: + data = self.serial.read(self.serial.in_waiting) else: data = b'' self.session += data @@ -86,7 +86,7 @@ class REPL: while True: if data.endswith(ending): break - elif self.serial.inWaiting() > 0: + elif self.serial.in_waiting > 0: new_data = self.serial.read(1) data += new_data self.session += new_data @@ -401,7 +401,10 @@ class CPboard: delayed = False for attempt in range(wait + 1): try: - self.serial = serial.Serial(self.device, baudrate=self.baudrate, timeout=self.timeout, write_timeout=self.timeout, interCharTimeout=1) + self.serial = serial.Serial(self.device, baudrate=self.baudrate, + timeout=self.timeout, + inter_byte_timeout=10, + write_timeout=self.timeout) break except (OSError, IOError): # Py2 and Py3 have different errors if wait == 0: From 074697a89fa78e749971df5824c97e48839e4ffc Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 3 Jun 2020 18:01:12 -0500 Subject: [PATCH 101/131] tools/cpboard.py: run black formatter --- tools/cpboard.py | 350 +++++++++++++++++++++++++++-------------------- 1 file changed, 201 insertions(+), 149 deletions(-) diff --git a/tools/cpboard.py b/tools/cpboard.py index 8c60077c2c..e5a29ab254 100644 --- a/tools/cpboard.py +++ b/tools/cpboard.py @@ -39,27 +39,34 @@ import serial.tools.list_ports import sh import shutil + class CPboardError(BaseException): pass + # supervisor/messages/default.h: MSG_NEWLINE = b"\r\n" MSG_SAFE_MODE_CRASH = b"Looks like our core CircuitPython code crashed hard. Whoops!" -MSG_SAFE_MODE_BROWN_OUT_LINE_1 = b"The microcontroller's power dipped. Please make sure your power supply provides" -MSG_SAFE_MODE_BROWN_OUT_LINE_2 = b"enough power for the whole circuit and press reset (after ejecting CIRCUITPY)." +MSG_SAFE_MODE_BROWN_OUT_LINE_1 = ( + b"The microcontroller's power dipped. Please make sure your power supply provides" +) +MSG_SAFE_MODE_BROWN_OUT_LINE_2 = ( + b"enough power for the whole circuit and press reset (after ejecting CIRCUITPY)." +) MSG_WAIT_BEFORE_REPL = b"Press any key to enter the REPL. Use CTRL-D to reload." + class REPL: - CHAR_CTRL_A = b'\x01' - CHAR_CTRL_B = b'\x02' - CHAR_CTRL_C = b'\x03' - CHAR_CTRL_D = b'\x04' + CHAR_CTRL_A = b"\x01" + CHAR_CTRL_B = b"\x02" + CHAR_CTRL_C = b"\x03" + CHAR_CTRL_D = b"\x04" def __init__(self, board): self.board = board self.write_chunk_size = 32 self.safe_mode = False - self.session = b'' + self.session = b"" def __enter__(self): self.reset() @@ -76,12 +83,12 @@ class REPL: if self.serial.in_waiting: data = self.serial.read(self.serial.in_waiting) else: - data = b'' + data = b"" self.session += data return data def read_until(self, ending, timeout=10): - data = b'' + data = b"" timeout_count = 0 while True: if data.endswith(ending): @@ -102,10 +109,10 @@ class REPL: if chunk_size is None: chunk_size = self.write_chunk_size if not isinstance(data, bytes): - data = bytes(data, encoding='utf8') + data = bytes(data, encoding="utf8") for i in range(0, len(data), chunk_size): - chunk = data[i:min(i + chunk_size, len(data))] + chunk = data[i : min(i + chunk_size, len(data))] self.session += chunk self.serial.write(chunk) time.sleep(0.01) @@ -113,28 +120,30 @@ class REPL: def reset(self): # Use read() since serial.reset_input_buffer() fails with termios.error now and then self.read() - self.session = b'' - self.write(b'\r' + REPL.CHAR_CTRL_C + REPL.CHAR_CTRL_C) # interrupt any running program - self.write(b'\r' + REPL.CHAR_CTRL_B) # enter or reset friendly repl - data = self.read_until(b'>>> ') + self.session = b"" + self.write( + b"\r" + REPL.CHAR_CTRL_C + REPL.CHAR_CTRL_C + ) # interrupt any running program + self.write(b"\r" + REPL.CHAR_CTRL_B) # enter or reset friendly repl + data = self.read_until(b">>> ") def execute(self, code, timeout=10, wait_for_response=False): - self.read() # Throw away + self.read() # Throw away self.write(REPL.CHAR_CTRL_A) - self.read_until(b'\r\n>') + self.read_until(b"\r\n>") self.write(code) self.write(REPL.CHAR_CTRL_D) if wait_for_response: - return b'', b'' - self.read_until(b'OK') + return b"", b"" + self.read_until(b"OK") - output = self.read_until(b'\x04', timeout=timeout) + output = self.read_until(b"\x04", timeout=timeout) output = output[:-1] - error = self.read_until(b'\x04') + error = self.read_until(b"\x04") error = error[:-1] return output, error @@ -146,8 +155,8 @@ class REPL: self.reset() self.write(REPL.CHAR_CTRL_D) - data = self.read_until(b' output:\r\n') - if b'Running in safe mode' in data: + data = self.read_until(b" output:\r\n") + if b"Running in safe mode" in data: self.safe_mode = True raise RuntimeError("Can't run in safe mode") @@ -159,7 +168,7 @@ class REPL: data = data.split(marker)[0] # Haven't found out why we have to strip off this... - if data.endswith(b'\r\n\r\n'): + if data.endswith(b"\r\n\r\n"): data = data[:-4] return data @@ -168,9 +177,13 @@ class Disk: def __init__(self, dev): self.dev = os.path.realpath(dev) self.mountpoint = None - with open('/etc/mtab', 'r') as f: + with open("/etc/mtab", "r") as f: mtab = f.read() - mount = [mount.split(' ') for mount in mtab.splitlines() if mount.startswith(self.dev)] + mount = [ + mount.split(" ") + for mount in mtab.splitlines() + if mount.startswith(self.dev) + ] if mount: self._path = mount[0][1] else: @@ -245,22 +258,22 @@ class Firmware: @property def info(self): with self.disk as disk: - fname = os.path.join(disk.path, 'INFO_UF2.TXT') - with open(fname, 'r') as f: + fname = os.path.join(disk.path, "INFO_UF2.TXT") + with open(fname, "r") as f: info = f.read() lines = info.splitlines() res = {} - res['header'] = lines[0] + res["header"] = lines[0] for line in lines[1:]: - k, _, v = line.partition(':') - res[k.replace(':', '')] = v.strip() + k, _, v = line.partition(":") + res[k.replace(":", "")] = v.strip() return res def upload(self, fw): - with open(fw, 'rb') as f: + with open(fw, "rb") as f: header = f.read(32) - if header[0:4] != b'UF2\n': - raise ValueError('Only UF2 files are supported') + if header[0:4] != b"UF2\n": + raise ValueError("Only UF2 files are supported") self.board.close() with self.disk as disk: disk.copy(fw, sync=False) @@ -274,35 +287,37 @@ class CPboard: except ValueError: pass - vendor, _, product = name.partition(':') + vendor, _, product = name.partition(":") if vendor and product: - return CPboard.from_usb(**kwargs, idVendor=int(vendor, 16), idProduct=int(product, 16)) + return CPboard.from_usb( + **kwargs, idVendor=int(vendor, 16), idProduct=int(product, 16) + ) return CPboard(name, **kwargs) @classmethod def from_build_name(cls, name, **kwargs): boards = { - #'arduino_zero' - 'circuitplayground_express' : (0x239a, 0x8019), - #'feather_m0_adalogger' : (0x239a, ), - #'feather_m0_basic' : (0x239a, ), - 'feather_m0_express' : (0x239a, 0x8023), - #'feather_m0_rfm69' : (0x239a, ), - #'feather_m0_rfm9x' : (0x239a, ), - #'feather_m0_supersized' : (0x239a, ), - #'feather_m4_express' : (0x239a, ), - #'gemma_m0' : (0x239a, ), - #'itsybitsy_m0_express' : (0x239a, ), - #'itsybitsy_m4_express' : (0x239a, ), - 'metro_m0_express' : (0x239a, 0x8014), - 'metro_m4_express' : (0x239a, 0x8021), - #'metro_m4_express_revb' : (0x239a, ), - #'pirkey_m0' : (0x239a, ), - #'trinket_m0' : (0x239a, ), - #'trinket_m0_haxpress' : (0x239a, ), - #'ugame10' - } + #'arduino_zero' + "circuitplayground_express": (0x239A, 0x8019), + #'feather_m0_adalogger' : (0x239a, ), + #'feather_m0_basic' : (0x239a, ), + "feather_m0_express": (0x239A, 0x8023), + #'feather_m0_rfm69' : (0x239a, ), + #'feather_m0_rfm9x' : (0x239a, ), + #'feather_m0_supersized' : (0x239a, ), + #'feather_m4_express' : (0x239a, ), + #'gemma_m0' : (0x239a, ), + #'itsybitsy_m0_express' : (0x239a, ), + "itsybitsy_m4_express": (0x239A, 0x802C), + "metro_m0_express": (0x239A, 0x8014), + "metro_m4_express": (0x239A, 0x8021), + #'metro_m4_express_revb' : (0x239a, ), + #'pirkey_m0' : (0x239a, ), + #'trinket_m0' : (0x239a, ), + #'trinket_m0_haxpress' : (0x239a, ), + #'ugame10' + } try: vendor, product = boards[name] @@ -314,26 +329,26 @@ class CPboard: @classmethod def from_build_name_bootloader(cls, name, **kwargs): boards = { - #'arduino_zero' - #'circuitplayground_express' : (0x239a, ), - #'feather_m0_adalogger' : (0x239a, ), - #'feather_m0_basic' : (0x239a, ), - 'feather_m0_express' : (0x239a, 0x001b), - #'feather_m0_rfm69' : (0x239a, ), - #'feather_m0_rfm9x' : (0x239a, ), - #'feather_m0_supersized' : (0x239a, ), - #'feather_m4_express' : (0x239a, ), - #'gemma_m0' : (0x239a, ), - #'itsybitsy_m0_express' : (0x239a, ), - #'itsybitsy_m4_express' : (0x239a, ), - #'metro_m0_express' : (0x239a, 0x8014), - 'metro_m4_express' : (0x239a, 0x0021), - #'metro_m4_express_revb' : (0x239a, ), - #'pirkey_m0' : (0x239a, ), - #'trinket_m0' : (0x239a, ), - #'trinket_m0_haxpress' : (0x239a, ), - #'ugame10' - } + #'arduino_zero' + #'circuitplayground_express' : (0x239a, ), + #'feather_m0_adalogger' : (0x239a, ), + #'feather_m0_basic' : (0x239a, ), + "feather_m0_express": (0x239A, 0x001B), + #'feather_m0_rfm69' : (0x239a, ), + #'feather_m0_rfm9x' : (0x239a, ), + #'feather_m0_supersized' : (0x239a, ), + #'feather_m4_express' : (0x239a, ), + #'gemma_m0' : (0x239a, ), + #'itsybitsy_m0_express' : (0x239a, ), + "itsybitsy_m4_express": (0x239A, 0x002B), + #'metro_m0_express' : (0x239a, 0x8014), + "metro_m4_express": (0x239A, 0x0021), + #'metro_m4_express_revb' : (0x239a, ), + #'pirkey_m0' : (0x239a, ), + #'trinket_m0' : (0x239a, ), + #'trinket_m0_haxpress' : (0x239a, ), + #'ugame10' + } try: vendor, product = boards[name] @@ -347,16 +362,17 @@ class CPboard: @classmethod def from_usb(cls, baudrate=115200, wait=0, timeout=10, **kwargs): import usb.core + dev = usb.core.find(**kwargs) if not dev: s = "Can't find USB device: " args = [] for x in kwargs.items(): try: - args.append('%s=0x%x' % x) + args.append("%s=0x%x" % x) except: - args.append('%s = %s' % x) - raise RuntimeError("Can't find USB device: " + ', '.join(args)) + args.append("%s = %s" % x) + raise RuntimeError("Can't find USB device: " + ", ".join(args)) return cls(dev, baudrate=baudrate, wait=wait, timeout=timeout) def __init__(self, device, baudrate=115200, wait=0, timeout=10): @@ -364,11 +380,15 @@ class CPboard: self.usb_dev = None try: # Is it a usb.core.Device? - portstr = ':' + '.'.join(map(str, device.port_numbers)) + ':' + portstr = ":" + ".".join(map(str, device.port_numbers)) + ":" except: pass else: - serials = [serial for serial in os.listdir("/dev/serial/by-path") if portstr in serial] + serials = [ + serial + for serial in os.listdir("/dev/serial/by-path") + if portstr in serial + ] if len(serials) != 1: raise RuntimeError("Can't find excatly one matching usb serial device") self.device = os.path.realpath("/dev/serial/by-path/" + serials[0]) @@ -401,26 +421,29 @@ class CPboard: delayed = False for attempt in range(wait + 1): try: - self.serial = serial.Serial(self.device, baudrate=self.baudrate, - timeout=self.timeout, - inter_byte_timeout=10, - write_timeout=self.timeout) + self.serial = serial.Serial( + self.device, + baudrate=self.baudrate, + timeout=self.timeout, + inter_byte_timeout=10, + write_timeout=self.timeout, + ) break - except (OSError, IOError): # Py2 and Py3 have different errors + except (OSError, IOError): # Py2 and Py3 have different errors if wait == 0: continue if attempt == 0: - sys.stdout.write('Waiting {} seconds for board '.format(wait)) + sys.stdout.write("Waiting {} seconds for board ".format(wait)) delayed = True time.sleep(1) - sys.stdout.write('.') + sys.stdout.write(".") sys.stdout.flush() else: if delayed: - print('') - raise CPboardError('failed to access ' + self.device) + print("") + raise CPboardError("failed to access " + self.device) if delayed: - print('') + print("") def close(self): if self.serial: @@ -430,38 +453,43 @@ class CPboard: def exec(self, command, timeout=10, wait_for_response=False): with self.repl as repl: try: - output, error = repl.execute(command, timeout=timeout, - wait_for_response=wait_for_response) + output, error = repl.execute( + command, timeout=timeout, wait_for_response=wait_for_response + ) except OSError as e: if self.debug: - print('exec: session: ', self.repl.session) - raise CPboardError('timeout', e) + print("exec: session: ", self.repl.session) + raise CPboardError("timeout", e) if error: - raise CPboardError('exception', output, error) + raise CPboardError("exception", output, error) return output def eval(self, expression, timeout=10): - command = 'print({})'.format(expression) + command = "print({})".format(expression) with self.repl as repl: output, error = repl.execute(command, timeout=timeout) if error: - raise CPboardError('exception', output, error) + raise CPboardError("exception", output, error) try: - res = eval(str(output, encoding='utf8')) + res = eval(str(output, encoding="utf8")) except: - raise CPboardError('failed to eval: %s' % output) + raise CPboardError("failed to eval: %s" % output) return res - def _reset(self, mode='NORMAL'): - self.exec("import microcontroller;microcontroller.on_next_reset(microcontroller.RunMode.%s)" % mode) + def _reset(self, mode="NORMAL"): + self.exec( + "import microcontroller;microcontroller.on_next_reset(microcontroller.RunMode.%s)" + % mode + ) try: - self.exec("import microcontroller;microcontroller.reset()", - wait_for_response=True) + self.exec( + "import microcontroller;microcontroller.reset()", wait_for_response=True + ) except OSError: pass def reset(self, safe_mode=False, delay=5, wait=10): - self._reset('SAFE_MODE' if safe_mode else 'NORMAL') + self._reset("SAFE_MODE" if safe_mode else "NORMAL") self.close() time.sleep(delay) self.open(wait) @@ -469,7 +497,7 @@ class CPboard: def reset_to_bootloader(self, repl=False): if repl: - self._reset('BOOTLOADER') + self._reset("BOOTLOADER") self.close() else: self.close() @@ -486,7 +514,7 @@ class CPboard: @property def serial_number(self): - try: # Permissions are needed to read the value + try: # Permissions are needed to read the value return self.usb_dev.serial_number except: pass @@ -495,18 +523,26 @@ class CPboard: def get_disks(self): if self.usb_dev: - portstr = ':' + '.'.join(map(str, self.usb_dev.port_numbers)) + ':' - return ["/dev/disk/by-path/" + disk for disk in os.listdir("/dev/disk/by-path") if portstr in disk] + portstr = ":" + ".".join(map(str, self.usb_dev.port_numbers)) + ":" + return [ + "/dev/disk/by-path/" + disk + for disk in os.listdir("/dev/disk/by-path") + if portstr in disk + ] serial = self.serial_number if not serial: raise RuntimeError("Serial number not found for: " + self.device) - return ["/dev/disk/by-id/" + disk for disk in os.listdir("/dev/disk/by-id") if serial in disk] + return [ + "/dev/disk/by-id/" + disk + for disk in os.listdir("/dev/disk/by-id") + if serial in disk + ] @property def disk(self): disks = self.get_disks() - part = [part for part in disks if 'part1' in part] + part = [part for part in disks if "part1" in part] if not part: raise RuntimeError("Disk not found for: " + self.device) @@ -518,13 +554,13 @@ class CPboard: def execfile_disk(self, filename): with self.disk as disk: - disk.copy(filename, 'code.py') + disk.copy(filename, "code.py") with self.repl as repl: try: output = repl.run() except OSError as e: - raise CPboardError('timeout', e) + raise CPboardError("timeout", e) except RuntimeError: if self.repl.safe_mode: raise PyboardError("Can't run in safe mode") @@ -534,10 +570,10 @@ class CPboard: return output def execfile(self, filename, timeout=10): - if os.environ.get('CPBOARD_EXEC_MODE') == 'disk': + if os.environ.get("CPBOARD_EXEC_MODE") == "disk": return self.execfile_disk(filename) else: - with open(filename, 'rb') as f: + with open(filename, "rb") as f: pyfile = f.read() return self.exec(pyfile, timeout=timeout) @@ -545,11 +581,14 @@ class CPboard: # Implement just enough to make tests/run-tests work PyboardError = CPboardError + class Pyboard: - def __init__(self, device, baudrate=115200, user='micro', password='python', wait=0): + def __init__( + self, device, baudrate=115200, user="micro", password="python", wait=0 + ): self.board = CPboard.from_try_all(device, baudrate=baudrate, wait=wait) with self.board.disk as disk: - disk.copy('skip_if.py') + disk.copy("skip_if.py") def close(self): self.board.close() @@ -563,12 +602,13 @@ class Pyboard: def eval_namedtuple(board, command): from collections import namedtuple + s = board.exec("print(%s)" % command) s = s.decode().strip() - items = [key.split('=') for key in s[1:-1].split(', ')] + items = [key.split("=") for key in s[1:-1].split(", ")] keys = [item[0] for item in items] vals = [item[1] for item in items] - nt = namedtuple('eval', keys) + nt = namedtuple("eval", keys) res = nt(*[eval(val) for val in vals]) return res @@ -576,14 +616,16 @@ def eval_namedtuple(board, command): def os_uname(board): return eval_namedtuple(board, "__import__('os').uname()") + def print_verbose(cargs, *args, **kwargs): if cargs.verbose: print(*args, flush=True, **kwargs) + def upload(args): try: board = CPboard.from_build_name_bootloader(args.board) - print_verbose(args, 'Board is already in the bootloader') + print_verbose(args, "Board is already in the bootloader") except (ValueError, RuntimeError): board = CPboard.from_try_all(args.board) @@ -591,29 +633,32 @@ def upload(args): if not (args.quiet or board.bootloader): board.open() - print('Current version:', os_uname(board).version, flush=True) + print("Current version:", os_uname(board).version, flush=True) if not board.bootloader: - print_verbose(args, 'Reset to bootloader...', end='') - board.reset_to_bootloader(repl=True) # Feather M0 Express doesn't respond to 1200 baud + print_verbose(args, "Reset to bootloader...", end="") + board.reset_to_bootloader( + repl=True + ) # Feather M0 Express doesn't respond to 1200 baud time.sleep(5) - print_verbose(args, 'done') + print_verbose(args, "done") - print_verbose(args, 'Bootloader:', board.firmware.info) + print_verbose(args, "Bootloader:", board.firmware.info) - print_verbose(args, 'Upload firmware...', end='') + print_verbose(args, "Upload firmware...", end="") board.firmware.upload(args.firmware) - print_verbose(args, 'done') + print_verbose(args, "done") - print_verbose(args, 'Wait for board...', end='') + print_verbose(args, "Wait for board...", end="") time.sleep(5) - print_verbose(args, 'done') + print_verbose(args, "done") if not args.quiet: if board.bootloader: board = CPboard.from_try_all(args.board) board.open(wait=10) - print('New version:', os_uname(board).version, flush=True) + print("New version:", os_uname(board).version, flush=True) + def print_error_exit(args, e): if args.debug: @@ -622,16 +667,20 @@ def print_error_exit(args, e): print(e, file=sys.stderr) sys.exit(1) + def main(): import argparse - cmd_parser = argparse.ArgumentParser(description='Circuit Python Board Tool') - cmd_parser.add_argument('board', help='build_name, vid:pid or /dev/tty') - cmd_parser.add_argument('-f', '--firmware', help='upload UF2 firmware file') - cmd_parser.add_argument('-c', '--command', help='program passed in as string') - cmd_parser.add_argument('--tty', action='store_true', help='print tty') - cmd_parser.add_argument('--verbose', '-v', action='count', default=0, help='be verbose') - cmd_parser.add_argument('-q', '--quiet', action='store_true', help='be quiet') - cmd_parser.add_argument('--debug', action='store_true', help='raise exceptions') + + cmd_parser = argparse.ArgumentParser(description="Circuit Python Board Tool") + cmd_parser.add_argument("board", help="build_name, vid:pid or /dev/tty") + cmd_parser.add_argument("-f", "--firmware", help="upload UF2 firmware file") + cmd_parser.add_argument("-c", "--command", help="program passed in as string") + cmd_parser.add_argument("--tty", action="store_true", help="print tty") + cmd_parser.add_argument( + "--verbose", "-v", action="count", default=0, help="be verbose" + ) + cmd_parser.add_argument("-q", "--quiet", action="store_true", help="be quiet") + cmd_parser.add_argument("--debug", action="store_true", help="raise exceptions") args = cmd_parser.parse_args() if args.quiet: @@ -653,9 +702,9 @@ def main(): raise if args.verbose: - exec_mode = os.environ.get('CPBOARD_EXEC_MODE') + exec_mode = os.environ.get("CPBOARD_EXEC_MODE") if exec_mode: - print('CPBOARD_EXEC_MODE =', exec_mode) + print("CPBOARD_EXEC_MODE =", exec_mode) # Make sure we can open serial try: @@ -672,18 +721,21 @@ def main(): print(b.eval(args.command)) else: with board as b: - print('Device: ', end='') + print("Device: ", end="") if b.usb_dev: - print('%04x:%04x on ' % (b.usb_dev.idVendor, b.usb_dev.idProduct), end='') + print( + "%04x:%04x on " % (b.usb_dev.idVendor, b.usb_dev.idProduct), end="" + ) print(b.device) - print('Serial number:', b.serial_number) + print("Serial number:", b.serial_number) uname = os_uname(b) - print('os.uname:') - print(' sysname:', uname.sysname) - print(' nodename:', uname.nodename) - print(' release:', uname.release) - print(' version:', uname.version) - print(' machine:', uname.machine) + print("os.uname:") + print(" sysname:", uname.sysname) + print(" nodename:", uname.nodename) + print(" release:", uname.release) + print(" version:", uname.version) + print(" machine:", uname.machine) + if __name__ == "__main__": main() From 1e7ff52bb738e02695b1b87f8e4644152a576508 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 3 Jun 2020 21:51:33 -0500 Subject: [PATCH 102/131] tools/cpboard.py: fix backwards logic of 'wait_for_response' in #3005 --- tools/cpboard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/cpboard.py b/tools/cpboard.py index e5a29ab254..7769cb4f46 100644 --- a/tools/cpboard.py +++ b/tools/cpboard.py @@ -127,7 +127,7 @@ class REPL: self.write(b"\r" + REPL.CHAR_CTRL_B) # enter or reset friendly repl data = self.read_until(b">>> ") - def execute(self, code, timeout=10, wait_for_response=False): + def execute(self, code, timeout=10, wait_for_response=True): self.read() # Throw away self.write(REPL.CHAR_CTRL_A) @@ -136,7 +136,7 @@ class REPL: self.write(code) self.write(REPL.CHAR_CTRL_D) - if wait_for_response: + if not wait_for_response: return b"", b"" self.read_until(b"OK") @@ -450,7 +450,7 @@ class CPboard: self.serial.close() self.serial = None - def exec(self, command, timeout=10, wait_for_response=False): + def exec(self, command, timeout=10, wait_for_response=True): with self.repl as repl: try: output, error = repl.execute( @@ -483,7 +483,7 @@ class CPboard: ) try: self.exec( - "import microcontroller;microcontroller.reset()", wait_for_response=True + "import microcontroller;microcontroller.reset()", wait_for_response=False ) except OSError: pass From d14e34449b5b70ea5e39938324e27af76498b0dd Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 2 Jun 2020 17:51:51 -0400 Subject: [PATCH 103/131] Rework LSE clock init, allow clock overrides --- ports/stm/Makefile | 4 +- .../stm/boards/espruino_pico/mpconfigboard.h | 3 +- .../stm/boards/espruino_wifi/mpconfigboard.h | 3 +- .../feather_stm32f405_express/mpconfigboard.h | 4 +- ports/stm/boards/meowbit_v121/mpconfigboard.h | 5 +- .../stm/boards/nucleo_f746zg/mpconfigboard.h | 6 +- .../stm/boards/nucleo_f767zi/mpconfigboard.h | 6 +- .../boards/nucleo_h743zi_2/mpconfigboard.h | 6 +- ports/stm/boards/openmv_h7/mpconfigboard.h | 3 +- ports/stm/boards/pyb_nano_v2/mpconfigboard.h | 3 +- ports/stm/boards/pyboard_v11/mpconfigboard.h | 5 +- .../stm32f411ce_blackpill/mpconfigboard.h | 4 +- .../stm32f411ve_discovery/mpconfigboard.h | 4 +- .../stm32f412zg_discovery/mpconfigboard.h | 5 +- .../boards/stm32f4_discovery/mpconfigboard.h | 3 +- .../stm32f746g_discovery/mpconfigboard.h | 15 ++- ports/stm/boards/thunderpack/mpconfigboard.h | 3 +- ports/stm/peripherals/stm32f4/clocks.c | 120 +++++++++++++++++ .../peripherals/stm32f4/stm32f401xe/clocks.c | 62 --------- .../peripherals/stm32f4/stm32f401xe/clocks.h | 63 +++++++++ .../peripherals/stm32f4/stm32f405xx/clocks.c | 64 --------- .../peripherals/stm32f4/stm32f405xx/clocks.h | 63 +++++++++ .../peripherals/stm32f4/stm32f407xx/clocks.c | 62 --------- .../peripherals/stm32f4/stm32f407xx/clocks.h | 63 +++++++++ .../peripherals/stm32f4/stm32f411xe/clocks.c | 62 --------- .../peripherals/stm32f4/stm32f411xe/clocks.h | 67 ++++++++++ .../peripherals/stm32f4/stm32f412zx/clocks.c | 75 ----------- .../peripherals/stm32f4/stm32f412zx/clocks.h | 66 ++++++++++ ports/stm/peripherals/stm32f7/clocks.c | 118 +++++++++++++++++ .../peripherals/stm32f7/stm32f746xx/clocks.c | 96 -------------- .../peripherals/stm32f7/stm32f746xx/clocks.h | 63 +++++++++ .../peripherals/stm32f7/stm32f767xx/clocks.c | 66 ---------- .../peripherals/stm32f7/stm32f767xx/clocks.h | 63 +++++++++ ports/stm/peripherals/stm32h7/clocks.c | 123 ++++++++++++++++++ .../peripherals/stm32h7/stm32h743xx/clocks.c | 83 ------------ .../peripherals/stm32h7/stm32h743xx/clocks.h | 70 ++++++++++ ports/stm/supervisor/port.c | 60 +-------- 37 files changed, 926 insertions(+), 665 deletions(-) create mode 100644 ports/stm/peripherals/stm32f4/clocks.c delete mode 100644 ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h delete mode 100644 ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f405xx/clocks.h delete mode 100644 ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f407xx/clocks.h delete mode 100644 ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h delete mode 100644 ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h create mode 100644 ports/stm/peripherals/stm32f7/clocks.c delete mode 100644 ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h delete mode 100644 ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h create mode 100644 ports/stm/peripherals/stm32h7/clocks.c delete mode 100644 ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c create mode 100644 ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h diff --git a/ports/stm/Makefile b/ports/stm/Makefile index bd69d6fd7a..a7b519ffcb 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -207,11 +207,11 @@ SRC_C += \ mphalport.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ + peripherals/stm32$(MCU_SERIES_LOWER)/clocks.c \ peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/pins.c \ - peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/clocks.c \ peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/gpio.c \ peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/periph.c \ - packages/$(MCU_PACKAGE).c\ + packages/$(MCU_PACKAGE).c \ lib/libc/string0.c \ lib/mp-readline/readline.c \ lib/oofatfs/ff.c \ diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.h b/ports/stm/boards/espruino_pico/mpconfigboard.h index 890b1b88e7..12e24244ff 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.h +++ b/ports/stm/boards/espruino_pico/mpconfigboard.h @@ -35,6 +35,7 @@ #define AUTORESET_DELAY_MS (500) #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) -#define BOARD_OSC_DIV (8) +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.h b/ports/stm/boards/espruino_wifi/mpconfigboard.h index 80aae3ad42..b7f38f69be 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.h +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.h @@ -32,6 +32,7 @@ #define FLASH_SIZE (0x80000) //512K #define FLASH_PAGE_SIZE (0x4000) //16K -#define BOARD_OSC_DIV (8) +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) #define BOARD_OVERWRITE_SWD (1) diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h index 8f8e245665..0d49748c84 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h @@ -34,8 +34,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_PC00) -#define BOARD_OSC_DIV (12) -#define HSE_VALUE ((uint32_t)12000000U) +#define HSE_VALUE ((uint32_t)12000000U) +#define LSE_VALUE ((uint32_t)32768) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // On-board flash diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.h b/ports/stm/boards/meowbit_v121/mpconfigboard.h index 268a660159..106f25b15c 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.h +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.h @@ -35,10 +35,9 @@ #define AUTORESET_DELAY_MS 500 #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) -#define BOARD_OSC_DIV (12) +#define HSE_VALUE ((uint32_t)12000000U) +#define LSE_VALUE ((uint32_t)32000U) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -#define HSE_VALUE ((uint32_t)12000000U) -#define LSE_VALUE ((uint32_t)32000U) #define BOARD_NO_VBUS_SENSE (1) #define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index cd2c61b919..c1f0d59b2d 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -33,8 +33,10 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 1dcb26f49e..21e0ef0ba4 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -32,5 +32,7 @@ #define FLASH_SIZE (0x200000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 14c2dfe308..1ae7f81a47 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -31,5 +31,7 @@ #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 9a049ed2cf..300f38aff0 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -31,7 +31,6 @@ #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (12) -#define HSE_VALUE ((uint32_t)12000000) +#define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h index 721a91defc..7c1ab31e34 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h @@ -32,7 +32,8 @@ #define FLASH_SIZE (0x80000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // On-board flash diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.h b/ports/stm/boards/pyboard_v11/mpconfigboard.h index 77fab2c69e..50a90c52b0 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.h +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.h @@ -32,10 +32,9 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (12) +#define HSE_VALUE ((uint32_t)12000000) +#define LSE_VALUE ((uint32_t)32000U) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -#define HSE_VALUE ((uint32_t)12000000U) -#define LSE_VALUE ((uint32_t)32000U) #define DEFAULT_I2C_BUS_SCL (&pin_PB06) #define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h index a21060a848..83a8bded39 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -32,11 +32,9 @@ #define FLASH_SIZE (0x80000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (25) +#define HSE_VALUE ((uint32_t)25000000) #define BOARD_NO_VBUS_SENSE (1) - #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) -#define HSE_VALUE ((uint32_t)25000000U) // On-board flash // #define SPI_FLASH_MOSI_PIN (&pin_PA07) diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h index 3956a365cf..0be43f4fb7 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h @@ -32,8 +32,8 @@ #define FLASH_SIZE (0x80000) //512K #define FLASH_PAGE_SIZE (0x4000) //16K -#define BOARD_OSC_DIV (8) - +#define HSE_VALUE ((uint32_t)8000000) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // The schematic has a 32k crystal that isn't fitted. Uncommented the line below if you add it. diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h index c0590b80c1..6b9ab64678 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h @@ -32,8 +32,11 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +#define CPY_CLK_USB_USES_AUDIOPLL (1) #define DEFAULT_I2C_BUS_SCL (&pin_PB10) #define DEFAULT_I2C_BUS_SDA (&pin_PB09) diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h index 6274345ade..44ee073780 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h @@ -32,5 +32,6 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) +#define HSE_VALUE ((uint32_t)8000000) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index cace54e9b0..1fa69182a6 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -34,12 +34,15 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (25) -#define HSE_VALUE ((uint32_t)25000000) -#define BOARD_OSC_PLLN (400) -#define BOARD_OSC_PLLQ (9) +// Lower frequency to allow external RAM use +#define HSE_VALUE ((uint32_t)25000000) +#define LSE_VALUE ((uint32_t)32768) +#define CPY_CLK_PLLN (400) +#define CPY_CLK_PLLQ (9) +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_6) +#define CPY_CLK_USB_USES_AUDIOPLL (1) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -#define BOARD_FLASH_LATENCY FLASH_LATENCY_6 #define BOARD_NO_VBUS_SENSE 1 diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index 7102b12429..394fbfd84f 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -40,12 +40,11 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000) -#define BOARD_OSC_DIV (24) +#define HSE_VALUE ((uint32_t)24000000U) #define BOARD_OVERWRITE_SWD (1) #define BOARD_NO_VBUS_SENSE (1) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) -#define HSE_VALUE ((uint32_t)24000000U) // Status LEDs #define MICROPY_HW_LED_STATUS (&pin_PA02) diff --git a/ports/stm/peripherals/stm32f4/clocks.c b/ports/stm/peripherals/stm32f4/clocks.c new file mode 100644 index 0000000000..7a16812b36 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/clocks.c @@ -0,0 +1,120 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" +#include "supervisor/shared/safe_mode.h" +#include + +// F4 Series +#ifdef STM32F401xE +#include "stm32f4/stm32f401xe/clocks.h" +#endif +#ifdef STM32F411xE +#include "stm32f4/stm32f411xe/clocks.h" +#endif +#ifdef STM32F412Zx +#include "stm32f4/stm32f412zx/clocks.h" +#endif +#ifdef STM32F405xx +#include "stm32f4/stm32f405xx/clocks.h" +#endif +#ifdef STM32F407xx +#include "stm32f4/stm32f407xx/clocks.h" +#endif + +void stm32_peripherals_clocks_init(void) { + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; + bool lse_failure = false; + + // Set voltage scaling in accordance with system clock speed + __HAL_RCC_PWR_CLK_ENABLE(); + __HAL_PWR_VOLTAGESCALING_CONFIG(CPY_CLK_VSCALE); + + // Set up primary PLL and HSE clocks + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSE; + RCC_OscInitStruct.LSEState = RCC_LSE_ON; + #else + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; + RCC_OscInitStruct.LSIState = RCC_LSI_ON; + #endif + RCC_OscInitStruct.HSEState = BOARD_HSE_SOURCE; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; + RCC_OscInitStruct.PLL.PLLN = CPY_CLK_PLLN; + RCC_OscInitStruct.PLL.PLLP = CPY_CLK_PLLP; + RCC_OscInitStruct.PLL.PLLQ = CPY_CLK_PLLQ; + #if (CPY_CLK_USB_USES_AUDIOPLL) + RCC_OscInitStruct.PLL.PLLR = 2; // Unused but required by HAL + #endif + + if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + // Failure likely means a LSE issue - attempt to swap to LSI, and set to crash + RCC_OscInitStruct.LSEState = RCC_LSE_OFF; + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; + RCC_OscInitStruct.LSIState = RCC_LSI_ON; + if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + // No HSE means no USB, so just fail forever + while(1); + } + lse_failure = true; + } + + // Configure bus clock sources and divisors + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = CPY_CLK_AHBDIV; + RCC_ClkInitStruct.APB1CLKDivider = CPY_CLK_APB1DIV; + RCC_ClkInitStruct.APB2CLKDivider = CPY_CLK_APB2DIV; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, CPY_CLK_FLASH_LATENCY); + + // Set up non-bus peripherals + // TODO: I2S settings go here + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; + #else + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI; + #endif + #if (CPY_CLK_USB_USES_AUDIOPLL) + // Not supported by all lines. Should always result in 48M. + PeriphClkInitStruct.PLLI2S.PLLI2SM = HSE_VALUE/1000000; + PeriphClkInitStruct.PLLI2S.PLLI2SQ = 4; + PeriphClkInitStruct.PLLI2S.PLLI2SN = 192; + PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_CK48; + PeriphClkInitStruct.Clk48ClockSelection = RCC_CK48CLKSOURCE_PLLI2SQ; + #endif + + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + + if (lse_failure) { + reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT? + } +} diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c deleted file mode 100644 index 194992e819..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h new file mode 100644 index 0000000000..be62370d88 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h @@ -0,0 +1,63 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" + +// Chip: STM32F401 +// Line Type: Access Line +// Speed: 84MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE2) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (336) +#endif +#ifndef (CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV4) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (7) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV1) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_2) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c deleted file mode 100644 index f4c5830686..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c +++ /dev/null @@ -1,64 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - // APB1 must always be on so that we can talk to the RTC for timing. - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - // TODO: Only turn on APB2 when it is needed to save power. - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); -} diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.h b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.h new file mode 100644 index 0000000000..87faec035d --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.h @@ -0,0 +1,63 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" + +// Chip: STM32F405 +// Line Type: Foundation Line +// Speed: 168MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (336) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (7) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV4) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_5) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c deleted file mode 100644 index a545aaec56..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); -} diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.h b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.h new file mode 100644 index 0000000000..5894b4ae8b --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.h @@ -0,0 +1,63 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" + +// Chip: STM32F407 +// Line Type: Foundation Line +// Speed: 168MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (336) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (7) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV4) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_5) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c deleted file mode 100644 index 194992e819..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h new file mode 100644 index 0000000000..adb60e8a9e --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h @@ -0,0 +1,67 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" + +// Chip: STM32F411 +// Line Type: Access Line +// Speed: 96MHz + +// Note - the actual maximum frequency is 100MHz, but this requires divisors +// which are incompatible with USB, and there is no additional PLL such as on +// the F412. + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (192) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (4) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV1) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_3) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c deleted file mode 100644 index 6c4cb5b322..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c +++ /dev/null @@ -1,75 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the - * device is clocked below the maximum system frequency, to update the - * voltage scaling value regarding system frequency refer to product - * datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 200; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - RCC_OscInitStruct.PLL.PLLR = 2; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLLSAI output as USB clock source */ - PeriphClkInitStruct.PLLI2S.PLLI2SM = 8; - PeriphClkInitStruct.PLLI2S.PLLI2SQ = 4; - PeriphClkInitStruct.PLLI2S.PLLI2SN = 192; - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CK48; - PeriphClkInitStruct.Clk48ClockSelection = RCC_CK48CLKSOURCE_PLLI2SQ; - HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - * clocks dividers */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | - RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h new file mode 100644 index 0000000000..8f092adbac --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h @@ -0,0 +1,66 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" + +// Chip: STM32F412 +// Line Type: Access Line +// Speed: 200MHz (MAX) + +// Note - uses the I2S PLL for SUSB to enable full 100MHz operation, since USB +// can't get the right divisors from 100MHz PLL settings. + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (200) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (7) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV1) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_3) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (1) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f7/clocks.c b/ports/stm/peripherals/stm32f7/clocks.c new file mode 100644 index 0000000000..93016f6828 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/clocks.c @@ -0,0 +1,118 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f7xx_hal.h" +#include "supervisor/shared/safe_mode.h" +#include + +// F7 Series +#ifdef STM32F746xx +#include "stm32f7/stm32f746xx/clocks.h" +#endif +#ifdef STM32F767xx +#include "stm32f7/stm32f767xx/clocks.h" +#endif + +void stm32_peripherals_clocks_init(void) { + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; + bool lse_failure = false; + + // Configure LSE Drive + HAL_PWR_EnableBkUpAccess(); + __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW); + + // Set voltage scaling in accordance with system clock speed + __HAL_RCC_PWR_CLK_ENABLE(); + __HAL_PWR_VOLTAGESCALING_CONFIG(CPY_CLK_VSCALE); + + // Set up primary PLL and HSE clocks + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSE; + RCC_OscInitStruct.LSEState = RCC_LSE_ON; + #else + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; + RCC_OscInitStruct.LSIState = RCC_LSI_ON; + #endif + RCC_OscInitStruct.HSEState = BOARD_HSE_SOURCE; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; + RCC_OscInitStruct.PLL.PLLN = CPY_CLK_PLLN; + RCC_OscInitStruct.PLL.PLLP = CPY_CLK_PLLP; + RCC_OscInitStruct.PLL.PLLQ = CPY_CLK_PLLQ; + + if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + // Failure likely means a LSE issue - attempt to swap to LSI, and set to crash + RCC_OscInitStruct.LSEState = RCC_LSE_OFF; + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; + RCC_OscInitStruct.LSIState = RCC_LSI_ON; + if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + // No HSE means no USB, so just fail forever + while(1); + } + lse_failure = true; + } + + /* Activate the OverDrive to reach the 216 MHz Frequency */ + HAL_PWREx_EnableOverDrive(); + + // Configure bus clock sources and divisors + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = CPY_CLK_AHBDIV; + RCC_ClkInitStruct.APB1CLKDivider = CPY_CLK_APB1DIV; + RCC_ClkInitStruct.APB2CLKDivider = CPY_CLK_APB2DIV; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, CPY_CLK_FLASH_LATENCY); + + // Set up non-bus peripherals + // TODO: I2S settings go here + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; + #else + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI; + #endif + #if (CPY_CLK_USB_USES_AUDIOPLL) + // Should always result in 48M. + PeriphClkInitStruct.PLLSAI.PLLSAIN = 192; + PeriphClkInitStruct.PLLSAI.PLLSAIR = 2; + PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2; + PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV4; + PeriphClkInitStruct.PLLSAIDivQ = 1; + PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2; + PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_CK48; + PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48SOURCE_PLLSAIP; + #endif + + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + + if (lse_failure) { + reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT? + } +} diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c deleted file mode 100644 index 2afa2e377a..0000000000 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c +++ /dev/null @@ -1,96 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Lucian Copeland for Adafruit Industries - * Copyright (c) 2020 Mark Olsson - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include STM32_HAL_H - -#ifndef BOARD_OSC_DIV -#define BOARD_OSC_DIV (8) -#endif -#ifndef BOARD_OSC_PLLN -#define BOARD_OSC_PLLN (432) -#endif -#ifndef BOARD_OSC_PLLQ -#define BOARD_OSC_PLLQ (9) -#endif -#ifndef BOARD_FLASH_LATENCY -#define BOARD_FLASH_LATENCY FLASH_LATENCY_7 -#endif -#ifndef BOARD_OSC_HSESTATE -#define BOARD_OSC_HSESTATE RCC_HSE_BYPASS -#endif - -void stm32_peripherals_clocks_init(void) { - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = BOARD_OSC_HSESTATE; - RCC_OscInitStruct.HSIState = RCC_HSI_OFF; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = BOARD_OSC_PLLN; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = BOARD_OSC_PLLQ; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Activate the OverDrive to reach the 216 MHz Frequency */ - HAL_PWREx_EnableOverDrive(); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, BOARD_FLASH_LATENCY); - - #ifdef STM32F746G_DISCO - RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48; - PeriphClkInitStruct.PLLSAI.PLLSAIN = 192; - PeriphClkInitStruct.PLLSAI.PLLSAIR = 2; - PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2; - PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV4; - PeriphClkInitStruct.PLLSAIDivQ = 1; - PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2; - PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48SOURCE_PLLSAIP; - HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); - #endif -} diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h new file mode 100644 index 0000000000..eb44625143 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h @@ -0,0 +1,63 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f7xx_hal.h" + +// Chip: STM32F746 +// Line Type: Advanced Line +// Speed: 216MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (432) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (9) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV4) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_7) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c deleted file mode 100644 index 18b202df56..0000000000 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c +++ /dev/null @@ -1,66 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f7xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 432; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 9; - RCC_OscInitStruct.PLL.PLLR = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Activate the OverDrive to reach the 216 MHz Frequency */ - HAL_PWREx_EnableOverDrive(); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7); - -} diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h new file mode 100644 index 0000000000..187a024ad0 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h @@ -0,0 +1,63 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f7xx_hal.h" + +// Chip: STM32F767 +// Line Type: Advanced Line +// Speed: 216MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (432) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (9) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV4) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_7) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32h7/clocks.c b/ports/stm/peripherals/stm32h7/clocks.c new file mode 100644 index 0000000000..d68137df0f --- /dev/null +++ b/ports/stm/peripherals/stm32h7/clocks.c @@ -0,0 +1,123 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32h7xx_hal.h" +#include "supervisor/shared/safe_mode.h" +#include + +// H7 Series +#ifdef STM32H743xx +#include "stm32h7/stm32h743xx/clocks.h" +#endif + +void stm32_peripherals_clocks_init(void) { + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; + bool lse_failure = false; + + // Set voltage scaling in accordance with system clock speed + HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY); + __HAL_PWR_VOLTAGESCALING_CONFIG(CPY_CLK_VSCALE); + while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {} + + // Configure LSE Drive + HAL_PWR_EnableBkUpAccess(); + __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW); + + // Set up primary PLL and HSE clocks + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSE; + RCC_OscInitStruct.LSEState = RCC_LSE_ON; + #else + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; + RCC_OscInitStruct.LSIState = RCC_LSI_ON; + #endif + #if (CPY_CLK_USB_USES_AUDIOPLL) // Not actually audio PLL in this case, swap macro? + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSI48; + RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; + #endif + RCC_OscInitStruct.HSEState = BOARD_HSE_SOURCE; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/2000000; + RCC_OscInitStruct.PLL.PLLN = CPY_CLK_PLLN; + RCC_OscInitStruct.PLL.PLLP = CPY_CLK_PLLP; + RCC_OscInitStruct.PLL.PLLQ = CPY_CLK_PLLQ; + RCC_OscInitStruct.PLL.PLLR = 2; + RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_1; + RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE; + RCC_OscInitStruct.PLL.PLLFRACN = 0; + if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + // Failure likely means a LSE issue - attempt to swap to LSI, and set to crash + RCC_OscInitStruct.LSEState = RCC_LSE_OFF; + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; + RCC_OscInitStruct.LSIState = RCC_LSI_ON; + if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + // No HSE means no USB, so just fail forever + while(1); + } + lse_failure = true; + } + + // Configure bus clock sources and divisors + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK + |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2 + |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.AHBCLKDivider = CPY_CLK_AHBDIV; + RCC_ClkInitStruct.APB1CLKDivider = CPY_CLK_APB1DIV; + RCC_ClkInitStruct.APB2CLKDivider = CPY_CLK_APB2DIV; + RCC_ClkInitStruct.APB3CLKDivider = CPY_CLK_APB3DIV; + RCC_ClkInitStruct.APB4CLKDivider = CPY_CLK_APB4DIV; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, CPY_CLK_FLASH_LATENCY); + + // Set up non-bus peripherals + // TODO: I2S settings go here + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_USART3 + |RCC_PERIPHCLK_USB; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; + #else + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI; + #endif + PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_D2PCLK1; + #if (CPY_CLK_USB_USES_AUDIOPLL) // Not actually audio PLL in this case, swap macro? + PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48; + #else + PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL; + #endif + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + + // Enable USB Voltage detector + HAL_PWREx_EnableUSBVoltageDetector(); + + if (lse_failure) { + reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT? + } +} \ No newline at end of file diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c deleted file mode 100644 index 8ede6080e8..0000000000 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c +++ /dev/null @@ -1,83 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32h7xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* The PWR block is always enabled on the H7 series- there is no clock - enable. For now, use the default VOS3 scale mode (lowest) and limit clock - frequencies to avoid potential current draw problems from bus - power when using the max clock speeds throughout the chip. */ - - /* Enable HSE Oscillator and activate PLL1 with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.HSIState = RCC_HSI_OFF; - RCC_OscInitStruct.CSIState = RCC_CSI_OFF; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = 2; - RCC_OscInitStruct.PLL.PLLQ = 7; - RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_0; - RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM; - RCC_OscInitStruct.PLL.PLLFRACN = 0; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | \ - RCC_CLOCKTYPE_D1PCLK1 | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2 | \ - RCC_CLOCKTYPE_D3PCLK1); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1; - - /* Unlike on the STM32F4 family, it appears the maximum APB frequencies are - device-dependent- 120 MHz for this board according to Figure 2 of - the datasheet. Dividing by half will be safe for now. */ - RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2; - RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; - RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2; - - /* 4 wait states required for 168MHz and VOS3. */ - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4); - - /* Like on F4, on H7, USB's actual peripheral clock and bus clock are - separate. However, the main system PLL (PLL1) doesn't have a direct - connection to the USB peripheral clock to generate 48 MHz, so we do this - dance. This will connect PLL1's Q output to the USB peripheral clock. */ - RCC_PeriphCLKInitTypeDef RCC_PeriphCLKInitStruct; - - RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; - RCC_PeriphCLKInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL; - HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct); - -} diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h new file mode 100644 index 0000000000..ad241b7ef6 --- /dev/null +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h @@ -0,0 +1,70 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32h7xx_hal.h" + +// Chip: STM32H743 +// Line Type: Single-Core +// Speed: 480MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE0) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (480) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (20) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_APB1_DIV2) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_APB2_DIV2) +#endif +#ifndef CPY_CLK_APB3DIV +#define CPY_CLK_APB3DIV (RCC_APB3_DIV2) +#endif +#ifndef CPY_CLK_APB4DIV +#define CPY_CLK_APB4DIV (RCC_APB4_DIV2) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_4) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 9b62fa2eb1..cb500addee 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -169,64 +169,7 @@ safe_mode_t port_init(void) { stm32_peripherals_clocks_init(); stm32_peripherals_gpio_init(); - HAL_PWR_EnableBkUpAccess(); - - // TODO: move all of this to clocks.c - #if BOARD_HAS_LOW_SPEED_CRYSTAL - uint32_t tickstart = HAL_GetTick(); - - // H7/F7 untested with LSE, so autofail them until above move is done - #if (CPY_STM32F4) - bool lse_setupsuccess = true; - #else - bool lse_setupsuccess = false; - #endif - - // Update LSE configuration in Backup Domain control register - // Requires to enable write access to Backup Domain of necessary - // TODO: should be using the HAL OSC initializer, otherwise we'll need - // preprocessor defines for every register to account for F7/H7 - #if (CPY_STM32F4) - if(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) - { - // Enable write access to Backup domain - SET_BIT(PWR->CR, PWR_CR_DBP); - // Wait for Backup domain Write protection disable - tickstart = HAL_GetTick(); - while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) - { - if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE) - { - lse_setupsuccess = false; - } - } - } - #endif - - __HAL_RCC_LSE_CONFIG(RCC_LSE_ON); - tickstart = HAL_GetTick(); - while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) { - if((HAL_GetTick() - tickstart ) > LSE_STARTUP_TIMEOUT) - { - lse_setupsuccess = false; - __HAL_RCC_LSE_CONFIG(RCC_LSE_OFF); - __HAL_RCC_LSI_ENABLE(); - rtc_clock_frequency = LSI_VALUE; - break; - } - } - - if (lse_setupsuccess) { - __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); - } else { - __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); - } - - #else - __HAL_RCC_LSI_ENABLE(); - __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); - #endif - + // RTC oscillator selection is handled in peripherals///clocks.c __HAL_RCC_RTC_ENABLE(); _hrtc.Instance = RTC; _hrtc.Init.HourFormat = RTC_HOURFORMAT_24; @@ -237,7 +180,6 @@ safe_mode_t port_init(void) { _hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; HAL_RTC_Init(&_hrtc); - HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn); return NO_SAFE_MODE; From 74effeeefd832e31ea2a2e80d37e71a1d8e685e0 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 4 Jun 2020 13:30:07 -0400 Subject: [PATCH 104/131] Add temporary fix warning --- ports/mimxrt10xx/supervisor/port.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 40d28d2ef8..c36595e041 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -306,6 +306,7 @@ void reset_port(void) { //reset_event_system(); + // TODO: implement a proper fix for 1060 resets #if !defined (MIMXRT1062_SERIES) reset_all_pins(); #endif From ad0971fb25347a8cc36ace2c45449ef7eac6995e Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 5 Jun 2020 11:42:34 -0400 Subject: [PATCH 105/131] Override HAL_Delay and HAL_GetTick --- .../peripherals/stm32f4/stm32f401xe/clocks.h | 2 +- .../peripherals/stm32f4/stm32f411xe/clocks.h | 2 +- .../peripherals/stm32f4/stm32f412zx/clocks.h | 2 +- ports/stm/peripherals/stm32h7/clocks.c | 2 +- ports/stm/supervisor/port.c | 32 +++++++++++++++++-- 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h index be62370d88..d157d944a3 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h @@ -37,7 +37,7 @@ #ifndef CPY_CLK_PLLN #define CPY_CLK_PLLN (336) #endif -#ifndef (CPY_CLK_PLLP +#ifndef CPY_CLK_PLLP #define CPY_CLK_PLLP (RCC_PLLP_DIV4) #endif #ifndef CPY_CLK_PLLQ diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h index adb60e8a9e..a2fb7bd544 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h @@ -32,7 +32,7 @@ // Note - the actual maximum frequency is 100MHz, but this requires divisors // which are incompatible with USB, and there is no additional PLL such as on -// the F412. +// the F412. // Defaults: #ifndef CPY_CLK_VSCALE diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h index 8f092adbac..e1355c8f34 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h @@ -30,7 +30,7 @@ // Line Type: Access Line // Speed: 200MHz (MAX) -// Note - uses the I2S PLL for SUSB to enable full 100MHz operation, since USB +// Note - uses the I2S PLL for SUSB to enable full 100MHz operation, since USB // can't get the right divisors from 100MHz PLL settings. // Defaults: diff --git a/ports/stm/peripherals/stm32h7/clocks.c b/ports/stm/peripherals/stm32h7/clocks.c index d68137df0f..0e4e79f9f7 100644 --- a/ports/stm/peripherals/stm32h7/clocks.c +++ b/ports/stm/peripherals/stm32h7/clocks.c @@ -120,4 +120,4 @@ void stm32_peripherals_clocks_init(void) { if (lse_failure) { reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT? } -} \ No newline at end of file +} diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 8156b2272a..25504ddece 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -147,9 +147,10 @@ __attribute__((used, naked)) void Reset_Handler(void) { __enable_irq(); main(); } - #endif //end H7 specific code +// Low power clock variables +static volatile uint32_t systick_ms; static RTC_HandleTypeDef _hrtc; #if BOARD_HAS_LOW_SPEED_CRYSTAL @@ -159,7 +160,7 @@ static uint32_t rtc_clock_frequency = LSI_VALUE; #endif safe_mode_t port_init(void) { - HAL_Init(); + HAL_Init(); // Turns on SysTick __HAL_RCC_SYSCFG_CLK_ENABLE(); #if (CPY_STM32F4) @@ -182,13 +183,38 @@ safe_mode_t port_init(void) { HAL_RTC_Init(&_hrtc); HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn); + // Turn off SysTick + SysTick->CTRL = 0; + return NO_SAFE_MODE; } +void HAL_Delay(uint32_t delay_ms) { + if (SysTick->CTRL != 0) { + // SysTick is on, so use it + uint32_t tickstart = systick_ms; + while (systick_ms - tickstart < delay_ms) { + } + } else { + mp_hal_delay_ms(delay_ms); + } +} + +uint32_t HAL_GetTick() { + if (SysTick->CTRL != 0) { + return systick_ms; + } else { + uint8_t subticks; + uint32_t result = (uint32_t)port_get_raw_ticks(&subticks); + return result; + } +} + + void SysTick_Handler(void) { + systick_ms += 1; // Read the CTRL register to clear the SysTick interrupt. SysTick->CTRL; - HAL_IncTick(); } void reset_port(void) { From 93cffaa87e0cd42130c198fd2f9a69b7f4330474 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 5 Jun 2020 16:43:08 -0400 Subject: [PATCH 106/131] Fix pin macros typo, add extra flash protection --- ports/mimxrt10xx/boards/teensy40/board.c | 2 ++ ports/mimxrt10xx/boards/teensy41/board.c | 2 ++ .../peripherals/mimxrt10xx/MIMXRT1062/pins.c | 24 +++++++++---------- ports/mimxrt10xx/supervisor/port.c | 3 --- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ports/mimxrt10xx/boards/teensy40/board.c b/ports/mimxrt10xx/boards/teensy40/board.c index 28786ab902..09f0bf3f2a 100644 --- a/ports/mimxrt10xx/boards/teensy40/board.c +++ b/ports/mimxrt10xx/boards/teensy40/board.c @@ -48,6 +48,8 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_EMC_01); common_hal_never_reset_pin(&pin_GPIO_B0_13); common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); + // Data strobe needs protection despite being grounded + common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/teensy41/board.c b/ports/mimxrt10xx/boards/teensy41/board.c index 28786ab902..09f0bf3f2a 100644 --- a/ports/mimxrt10xx/boards/teensy41/board.c +++ b/ports/mimxrt10xx/boards/teensy41/board.c @@ -48,6 +48,8 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_EMC_01); common_hal_never_reset_pin(&pin_GPIO_B0_13); common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); + // Data strobe needs protection despite being grounded + common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c index 9f25225bb6..ce098ea2bc 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c @@ -141,15 +141,15 @@ const mcu_pin_obj_t pin_GPIO_SD_B0_02 = PIN(GPIO3, 14, GPIO_SD_B0_02, NO_ADC, 0, const mcu_pin_obj_t pin_GPIO_SD_B0_03 = PIN(GPIO3, 15, GPIO_SD_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); const mcu_pin_obj_t pin_GPIO_SD_B0_04 = PIN(GPIO3, 16, GPIO_SD_B0_04, NO_ADC, 0, 0x00000005, 0x000010B0); const mcu_pin_obj_t pin_GPIO_SD_B0_05 = PIN(GPIO3, 17, GPIO_SD_B0_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 0, GPIO_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 1, GPIO_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 2, GPIO_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 3, GPIO_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 4, GPIO_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 5, GPIO_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 6, GPIO_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 7, GPIO_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 8, GPIO_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 9, GPIO_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 10, GPIO_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 11, GPIO_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 0, GPIO_SD_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 1, GPIO_SD_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 2, GPIO_SD_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 3, GPIO_SD_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 4, GPIO_SD_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 5, GPIO_SD_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 6, GPIO_SD_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 7, GPIO_SD_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 8, GPIO_SD_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 9, GPIO_SD_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 10, GPIO_SD_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 11, GPIO_SD_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 3ac66fd2a6..ed5824732d 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -306,10 +306,7 @@ void reset_port(void) { //reset_event_system(); - // TODO: implement a proper fix for 1060 resets - #if !defined (MIMXRT1062_SERIES) reset_all_pins(); - #endif } void reset_to_bootloader(void) { From 33496e9c68a33028e472defdcda7fff35b7db8b0 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 5 Jun 2020 19:58:54 -0500 Subject: [PATCH 107/131] Add nice!nano board support --- .github/workflows/build.yml | 1 + ports/nrf/boards/nice_nano/board.c | 38 +++++++++++++ ports/nrf/boards/nice_nano/mpconfigboard.h | 45 ++++++++++++++++ ports/nrf/boards/nice_nano/mpconfigboard.mk | 8 +++ ports/nrf/boards/nice_nano/pins.c | 60 +++++++++++++++++++++ 5 files changed, 152 insertions(+) create mode 100644 ports/nrf/boards/nice_nano/board.c create mode 100644 ports/nrf/boards/nice_nano/mpconfigboard.h create mode 100644 ports/nrf/boards/nice_nano/mpconfigboard.mk create mode 100644 ports/nrf/boards/nice_nano/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0719b40e94..00454cc2da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -205,6 +205,7 @@ jobs: - "monster_m4sk" - "ndgarage_ndbit6" - "nfc_copy_cat" + - "nice_nano" - "nucleo_f746zg" - "nucleo_f767zi" - "nucleo_h743zi_2" diff --git a/ports/nrf/boards/nice_nano/board.c b/ports/nrf/boards/nice_nano/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/nice_nano/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/nice_nano/mpconfigboard.h b/ports/nrf/boards/nice_nano/mpconfigboard.h new file mode 100644 index 0000000000..5f61947007 --- /dev/null +++ b/ports/nrf/boards/nice_nano/mpconfigboard.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "nice!nano" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_LED_STATUS (&pin_P0_15) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_20) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_17) + +#define DEFAULT_SPI_BUS_SCK (&pin_P1_13) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_10) +#define DEFAULT_SPI_BUS_MISO (&pin_P1_11) + +#define DEFAULT_UART_BUS_RX (&pin_P0_08) +#define DEFAULT_UART_BUS_TX (&pin_P0_06) diff --git a/ports/nrf/boards/nice_nano/mpconfigboard.mk b/ports/nrf/boards/nice_nano/mpconfigboard.mk new file mode 100644 index 0000000000..511a754e69 --- /dev/null +++ b/ports/nrf/boards/nice_nano/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x239A +USB_PID = 0x80B4 +USB_PRODUCT = "nice!nano" +USB_MANUFACTURER = "Nice Keyboards" + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/nice_nano/pins.c b/ports/nrf/boards/nice_nano/pins.c new file mode 100644 index 0000000000..98c1251fe3 --- /dev/null +++ b/ports/nrf/boards/nice_nano/pins.c @@ -0,0 +1,60 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_P0_02), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_P0_04), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_P0_06), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_P0_08), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_P0_09), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_P0_10), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_P0_11), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_P0_12), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_P0_13), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_P0_15), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_P0_17), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_P0_20), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_P0_22), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_P0_24), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_P0_26), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_P0_29), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_P0_31), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_P1_00), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_P1_01), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_P1_02), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_P1_04), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_P1_06), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_P1_07), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_P1_11), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_P1_13), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_P1_15), MP_ROM_PTR(&pin_P1_15) }, + + { MP_ROM_QSTR(MP_QSTR_AIN0), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_AIN2), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_AIN5), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_AIN7), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_BAT_VOLT), MP_ROM_PTR(&pin_P0_04) }, // Read battery voltage + + { MP_ROM_QSTR(MP_QSTR_VCC_OFF), MP_ROM_PTR(&pin_P0_13) }, // Turn off external VCC by MOSFET + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_15) }, // Controls blue LED, high is on + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_06) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_17) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_11) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 07fa458767d05a36ebe3e03293bea7ce52d0e389 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 2 Jun 2020 21:43:57 +0000 Subject: [PATCH 108/131] Translated using Weblate (Swedish) Currently translated at 100.0% (764 of 764 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 58e810c4c2..09d3faa181 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-02 21:42+0000\n" +"PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -153,7 +153,7 @@ msgstr "'%s' heltal %d ligger inte inom intervallet %d..%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' integer 0x%x does not fit in mask 0x%x" -msgstr "'%s' heltal 0x%x får inte plats i mask 0x%x" +msgstr "'%s' heltal 0x%x ryms inte i mask 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" @@ -166,12 +166,12 @@ msgstr "Objektet '%s' har inte stöd för '%q'" #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" -msgstr "Objektet \"%s\" stöder inte tilldelning av objekt" +msgstr "Objektet '%s' stöder inte tilldelningen" #: py/obj.c #, c-format msgid "'%s' object does not support item deletion" -msgstr "'%s'-objekt stöder inte borttagning av objekt" +msgstr "Objektet '%s' stöder inte borttagning av objekt" #: py/runtime.c msgid "'%s' object has no attribute '%q'" @@ -190,16 +190,16 @@ msgstr "Objektet '%s' kan inte anropas" #: py/runtime.c #, c-format msgid "'%s' object is not iterable" -msgstr "Objektet '%s' är inte itererbar" +msgstr "Objektet '%s' är inte itererable" #: py/obj.c #, c-format msgid "'%s' object is not subscriptable" -msgstr "Objektet \"%s\" är inte indexbar" +msgstr "Objektet '%s' är inte indexbar" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" -msgstr "'='-justering tillåts inte i strängformatspecificerare" +msgstr "'='-justering tillåts inte i strängformatspecifikation" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" @@ -211,7 +211,7 @@ msgstr "'align' kräver 1 argument" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "'async for' eller 'async with' utanför asynk-funktion" +msgstr "'async for' eller 'async with' utanför async-funktion" #: py/compile.c msgid "'await' outside function" @@ -264,7 +264,7 @@ msgstr "3-arguments pow() stöds inte" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" -msgstr "En kanal för hårdvaruavbrotts används redan" +msgstr "En kanal för hårdvaruavbrott används redan" #: shared-bindings/_bleio/Address.c #, c-format @@ -285,7 +285,7 @@ msgstr "All SPI-kringutrustning används" #: ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" -msgstr "Alla UART-tillbehör används" +msgstr "Alla UART-kringutrustning används" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" @@ -316,7 +316,7 @@ msgstr "Annonserar redan." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn stöds inte på en given pinne" +msgstr "AnalogIn stöds inte på angiven pinne" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -326,16 +326,16 @@ msgstr "AnalogOut-funktionalitet stöds inte" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut är bara 16 bitar. Värdet måste vara mindre än 65536." +msgstr "AnalogOut hanterar bara 16 bitar. Värdet måste vara mindre än 65536." #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut stöds inte på given pinne" +msgstr "AnalogOut stöds inte på angiven pinne" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c msgid "Another send is already active" -msgstr "En annan sändning är redan aktiv" +msgstr "En annan send är redan aktiv" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" @@ -343,7 +343,7 @@ msgstr "Matrisen måste innehålla halfwords (typ \"H\")" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "Matrisvärden ska vara enstaka byte." +msgstr "Matrisvärden ska bestå av enstaka bytes." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" @@ -351,7 +351,7 @@ msgstr "Högst %d %q kan anges (inte %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." -msgstr "Försökte tilldelning av heap när MicroPython VM inte körs." +msgstr "Försökte tilldela heap när MicroPython VM inte körs." #: main.c msgid "Auto-reload is off.\n" @@ -376,7 +376,7 @@ msgstr "Bitklocka och ordval måste dela en klockenhet" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "Bitdjupet måste vara multipel av 8." +msgstr "Bitdjup måste vara multipel av 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" @@ -390,16 +390,16 @@ msgstr "Båda pinnarna måste stödja maskinvaruavbrott" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "Ljusstyrkan måste vara 0-1,0" +msgstr "Ljusstyrkan måste vara mellan 0 och 1,0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" -msgstr "Ljusstyrkan måste vara mellan 0 och 255" +msgstr "Ljusstyrka måste vara mellan 0 och 255" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "Ljusstyrkan kan inte justeras" +msgstr "Ljusstyrka kan inte justeras" #: shared-bindings/_bleio/UUID.c #, c-format @@ -437,7 +437,7 @@ msgstr "Bufferten är för stor och kan inte allokeras" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "Buffert för kort med %d bytes" +msgstr "Buffert år %d bytes för kort" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -459,7 +459,7 @@ msgstr "CBC-block måste vara multiplar om 16 byte" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "Anropa super().__init__() innan du använder det nativa objektet." +msgstr "Anropa super().__init__() innan du använder det ursprungliga objektet." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" @@ -504,9 +504,7 @@ msgstr "Kan inte återmontera '/' när USB är aktivt." #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "" -"Det går inte att återställa till bootloader eftersom det inte finns någon " -"bootloader." +msgstr "Det går inte att återställa till bootloader eftersom bootloader saknas." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." From 53a1b68649fc4efa310fa875f3b6dbe2a65fb8d4 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 3 Jun 2020 20:59:52 +0200 Subject: [PATCH 109/131] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/ --- locale/sv.po | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locale/sv.po b/locale/sv.po index 09d3faa181..bf9bb3f5d9 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -504,7 +504,8 @@ msgstr "Kan inte återmontera '/' när USB är aktivt." #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Det går inte att återställa till bootloader eftersom bootloader saknas." +msgstr "" +"Det går inte att återställa till bootloader eftersom bootloader saknas." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." From 6502ec5dffe705642c26c81eb35b599fd2103942 Mon Sep 17 00:00:00 2001 From: aberwag Date: Thu, 4 Jun 2020 19:17:25 +0000 Subject: [PATCH 110/131] Translated using Weblate (French) Currently translated at 100.0% (764 of 764 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 9c7adb7e00..587f098771 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-02 19:50+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2020-06-05 17:29+0000\n" +"Last-Translator: aberwag \n" "Language-Team: French \n" "Language: fr\n" @@ -1735,7 +1735,7 @@ msgstr "WatchDogTimer.timeout doit être supérieur à 0" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "" +msgstr "Le minuteur Watchdog a expiré." #: py/builtinhelp.c #, c-format From d8bb2d7c6d32781addf07afdc2b6514386b6f30e Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 8 Jun 2020 10:52:27 -0500 Subject: [PATCH 111/131] Correct ticks being returned from port_get_raw_ticks() Issue #2958 . Correct calculation of usec back to ticks in port_get_raw_ticks(). --- ports/esp32s2/supervisor/port.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 4c42f11af9..f5a4ae48e3 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -118,11 +118,12 @@ uint32_t port_get_saved_word(void) { uint64_t port_get_raw_ticks(uint8_t* subticks) { struct timeval tv_now; gettimeofday(&tv_now, NULL); - uint64_t all_subticks = (uint64_t)tv_now.tv_usec / 32768; + // convert usec back to ticks + uint64_t all_subticks = (uint64_t)tv_now.tv_usec / 1024; if (subticks != NULL) { *subticks = all_subticks % 32; } - return (uint64_t)tv_now.tv_sec * 1024L + all_subticks / 32; + return (uint64_t)tv_now.tv_sec * 1024L + all_subticks; } // Enable 1/1024 second tick. From ec7a3feeba913b615c785fb03015f9edbedbaa95 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Tue, 9 Jun 2020 10:08:49 -0500 Subject: [PATCH 112/131] Redid formula for calculating subticks changed subticks calculation to give a range from 0 to 32767. --- ports/esp32s2/supervisor/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index f5a4ae48e3..2437b4f341 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -119,11 +119,11 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { struct timeval tv_now; gettimeofday(&tv_now, NULL); // convert usec back to ticks - uint64_t all_subticks = (uint64_t)tv_now.tv_usec / 1024; + uint64_t all_subticks = (uint64_t)(tv_now.tv_usec * 2) / 71; if (subticks != NULL) { *subticks = all_subticks % 32; } - return (uint64_t)tv_now.tv_sec * 1024L + all_subticks; + return (uint64_t)tv_now.tv_sec * 1024L + all_subticks / 32; } // Enable 1/1024 second tick. From eeb3825646453762b6e40f012cc3b9bbd9442d20 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 9 Jun 2020 13:04:42 -0700 Subject: [PATCH 113/131] Update precommit check branch --- .github/workflows/pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 116829296d..9663103046 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -7,7 +7,7 @@ name: pre-commit on: pull_request: push: - branches: [master] + branches: [main] jobs: pre-commit: From b414f82669ad2106d8705a485fcfde13ac5cf358 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 9 Jun 2020 18:01:52 -0400 Subject: [PATCH 114/131] Add DTCM and ITCM support to F7 series --- ports/stm/boards/STM32F746xG_fs.ld | 10 ++++++++-- ports/stm/boards/STM32F767_fs.ld | 11 +++++++++-- ports/stm/boards/nucleo_f746zg/mpconfigboard.h | 8 ++++++++ ports/stm/boards/nucleo_f746zg/mpconfigboard.mk | 2 +- ports/stm/boards/nucleo_f767zi/mpconfigboard.h | 8 ++++++++ ports/stm/boards/nucleo_f767zi/mpconfigboard.mk | 2 +- ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h | 8 ++++++++ ports/stm/supervisor/port.c | 14 +++++++------- 8 files changed, 50 insertions(+), 13 deletions(-) diff --git a/ports/stm/boards/STM32F746xG_fs.ld b/ports/stm/boards/STM32F746xG_fs.ld index 6c9ea4de31..7419c43d2e 100644 --- a/ports/stm/boards/STM32F746xG_fs.ld +++ b/ports/stm/boards/STM32F746xG_fs.ld @@ -26,6 +26,11 @@ * THE SOFTWARE. */ + /* Entry Point */ +ENTRY(Reset_Handler) + +_ld_default_stack_size = 24K; + /* Specify the memory areas */ MEMORY { @@ -33,7 +38,8 @@ MEMORY FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 896K /* sector 4 is 128K, sectors 5,6,7 are 256K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K + DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20010000, LENGTH = 256K /* AXI SRAM */ ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K } @@ -44,7 +50,7 @@ _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); +_estack = ORIGIN(DTCM) + LENGTH(DTCM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld index 2feb422257..2ab73e907c 100644 --- a/ports/stm/boards/STM32F767_fs.ld +++ b/ports/stm/boards/STM32F767_fs.ld @@ -2,6 +2,11 @@ GNU linker script for STM32F767 with filesystem */ +/* Entry Point */ +ENTRY(Reset_Handler) + +_ld_default_stack_size = 24K; + /* Specify the memory areas */ MEMORY { @@ -9,7 +14,9 @@ MEMORY FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 1920K /* sector 4 is 128K, sectors 5,6,7 are 256K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K + DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + RAM (xrw) : ORIGIN = 0x20020000, LENGTH = 384K /* AXI SRAM */ + ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K } /* produce a link error if there is not this amount of RAM for these sections */ @@ -19,7 +26,7 @@ _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); +_estack = ORIGIN(DTCM) + LENGTH(DTCM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index c1f0d59b2d..e2b54335a5 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -33,6 +33,14 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_1MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_16KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_256KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x20010000 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk index f23f642e7e..6e88e6d882 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_default.ld +LLD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 21e0ef0ba4..327651923a 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -32,6 +32,14 @@ #define FLASH_SIZE (0x200000) #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_2MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_16KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_512KB +#define CPY_SRAM_SUBMASK 0xFC // Mask 512 to 384 +#define CPY_SRAM_START_ADDR 0x20020000 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk index 4e5e1bc7c8..c5d956b994 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F767xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F767_fs.ld diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 1ae7f81a47..2ac986701e 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -31,6 +31,14 @@ #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_2MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_64KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_512KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x24000000 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 25504ddece..713803d55d 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -49,7 +49,7 @@ #include STM32_HAL_H //only enable the Reset Handler overwrite for the H7 for now -#if (CPY_STM32H7) +#if (CPY_STM32H7) || (CPY_STM32F7) // Device memories must be accessed in order. #define DEVICE 2 @@ -86,7 +86,7 @@ extern uint32_t _ld_itcm_flash_copy; extern void main(void); extern void SystemInit(void); -// This replaces the Reset_Handler in startup_*.S and SystemInit in system_*.c. +// This replaces the Reset_Handler in gcc/startup_*.s, calls SystemInit from system_*.c __attribute__((used, naked)) void Reset_Handler(void) { __disable_irq(); __set_MSP((uint32_t) &_ld_stack_top); @@ -105,20 +105,20 @@ __attribute__((used, naked)) void Reset_Handler(void) { // Mark all the flash the same until instructed otherwise. MPU->RBAR = ARM_MPU_RBAR(11, 0x08000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_2MB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, CPY_FLASH_REGION_SIZE); // This the ITCM. Set it to read-only because we've loaded everything already and it's easy to // accidentally write the wrong value to 0x00000000 (aka NULL). MPU->RBAR = ARM_MPU_RBAR(12, 0x00000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_RO, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_64KB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_RO, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, CPY_ITCM_REGION_SIZE); // This the DTCM. MPU->RBAR = ARM_MPU_RBAR(14, 0x20000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_128KB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, CPY_DTCM_REGION_SIZE); // This is AXI SRAM (D1). - MPU->RBAR = ARM_MPU_RBAR(15, 0x24000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_512KB); + MPU->RBAR = ARM_MPU_RBAR(15, CPY_SRAM_START_ADDR); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, CPY_SRAM_SUBMASK, CPY_SRAM_REGION_SIZE); /* Enable MPU */ ARM_MPU_Enable(MPU_CTRL_PRIVDEFENA_Msk); From 7cc8b784c36d1fc01867a00c9a6e40353eedc599 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 10 Jun 2020 09:49:35 -0400 Subject: [PATCH 115/131] Add missing openmv definitions --- ports/stm/boards/nucleo_f746zg/mpconfigboard.mk | 2 +- ports/stm/boards/openmv_h7/mpconfigboard.h | 8 ++++++++ ports/stm/boards/stm32f746g_discovery/mpconfigboard.h | 8 ++++++++ ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk index 6e88e6d882..651f3c2292 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = LQFP144 -LLD_COMMON = boards/common_tcm.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index cf9d6e7d14..77ae235ecf 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -31,5 +31,13 @@ #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_2MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_64KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_512KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x24000000 + #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 1fa69182a6..769990a98c 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -34,6 +34,14 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_1MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_16KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_256KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x20010000 + // Lower frequency to allow external RAM use #define HSE_VALUE ((uint32_t)25000000) #define LSE_VALUE ((uint32_t)32768) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk index ff8456df66..94a50853cb 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = TFBGA216 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F746xG_fs.ld From c88a8e66c6552294671e4282bdaa52d97c6e6c2c Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 10 Jun 2020 13:22:21 -0400 Subject: [PATCH 116/131] Minor comment fix --- ports/stm/supervisor/port.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 713803d55d..07a93c025b 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -48,7 +48,6 @@ #include STM32_HAL_H -//only enable the Reset Handler overwrite for the H7 for now #if (CPY_STM32H7) || (CPY_STM32F7) // Device memories must be accessed in order. From c08702414e410769de3d4821aa07f419c9ef7508 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 10 Jun 2020 16:36:44 -0400 Subject: [PATCH 117/131] Add macros for setting correct F7 and H7 I2C timing --- ports/stm/boards/nucleo_f746zg/mpconfigboard.h | 4 ++++ ports/stm/boards/nucleo_f767zi/mpconfigboard.h | 4 ++++ ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h | 6 ++++++ ports/stm/boards/openmv_h7/mpconfigboard.h | 4 ++++ ports/stm/boards/stm32f746g_discovery/mpconfigboard.h | 4 ++++ ports/stm/common-hal/busio/I2C.c | 8 +++++++- 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index e2b54335a5..13ec369bf3 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -46,5 +46,9 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x6000030D +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 + #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 327651923a..b08a0062e2 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -40,6 +40,10 @@ #define CPY_SRAM_SUBMASK 0xFC // Mask 512 to 384 #define CPY_SRAM_START_ADDR 0x20020000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x6000030D +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 2ac986701e..15186e89d6 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -39,6 +39,12 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 + + + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 77ae235ecf..2f61e24213 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -39,5 +39,9 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 + #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 769990a98c..35a28ca3d1 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -50,6 +50,10 @@ #define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_6) #define CPY_CLK_USB_USES_AUDIOPLL (1) +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00401959 +#define CPY_I2CSTANDARD_TIMINGR 0x00C0EAFF + #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 48c4c1933a..01d0703ca1 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -120,7 +120,13 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, // Handle the HAL handle differences #if (CPY_STM32H7 || CPY_STM32F7) - self->handle.Init.Timing = 0x40604E73; //Taken from STCube examples + if (frequency == 400000) { + self->handle.Init.Timing = CPY_I2CFAST_TIMINGR; + } else if (frequency == 100000) { + self->handle.Init.Timing = CPY_I2CSTANDARD_TIMINGR; + } else { + mp_raise_ValueError(translate("MCU supports only I2C Standard and Fast modes")); + } #else self->handle.Init.ClockSpeed = frequency; self->handle.Init.DutyCycle = I2C_DUTYCYCLE_2; From 058c16e98c4036c8a53547062f513a0d74eb90c4 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Wed, 10 Jun 2020 17:11:28 -0500 Subject: [PATCH 118/131] Issue #3014 - refresh after changing to transparent Adding self->needs_refresh = true; in common_hal_displayio_palette_make_opaque() and common_hal_displayio_palette_make_transparent() --- shared-module/displayio/Palette.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-module/displayio/Palette.c b/shared-module/displayio/Palette.c index 1ef03aab44..facb1fa732 100644 --- a/shared-module/displayio/Palette.c +++ b/shared-module/displayio/Palette.c @@ -35,10 +35,12 @@ void common_hal_displayio_palette_construct(displayio_palette_t* self, uint16_t void common_hal_displayio_palette_make_opaque(displayio_palette_t* self, uint32_t palette_index) { self->colors[palette_index].transparent = false; + self->needs_refresh = true; } void common_hal_displayio_palette_make_transparent(displayio_palette_t* self, uint32_t palette_index) { self->colors[palette_index].transparent = true; + self->needs_refresh = true; } uint32_t common_hal_displayio_palette_get_len(displayio_palette_t* self) { From 724637faa3b96b20f4deed32d58dcb7b50672479 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 11 Jun 2020 11:17:51 -0400 Subject: [PATCH 119/131] Move I2C speed to clock-style definition --- .../stm/boards/nucleo_f746zg/mpconfigboard.h | 4 --- .../stm/boards/nucleo_f767zi/mpconfigboard.h | 4 --- .../boards/nucleo_h743zi_2/mpconfigboard.h | 6 ---- ports/stm/boards/openmv_h7/mpconfigboard.h | 4 --- ports/stm/common-hal/busio/I2C.c | 3 +- ports/stm/peripherals/clocks.h | 30 +++++++++++++++++++ .../peripherals/stm32f7/stm32f746xx/clocks.h | 8 +++++ .../peripherals/stm32f7/stm32f767xx/clocks.h | 8 +++++ .../peripherals/stm32h7/stm32h743xx/clocks.h | 8 +++++ 9 files changed, 56 insertions(+), 19 deletions(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index 13ec369bf3..e2b54335a5 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -46,9 +46,5 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x6000030D -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 - #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index b08a0062e2..327651923a 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -40,10 +40,6 @@ #define CPY_SRAM_SUBMASK 0xFC // Mask 512 to 384 #define CPY_SRAM_START_ADDR 0x20020000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x6000030D -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 - #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 15186e89d6..2ac986701e 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -39,12 +39,6 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 - - - #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 2f61e24213..77ae235ecf 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -39,9 +39,5 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 - #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 01d0703ca1..00f15aaa60 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -33,6 +33,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" +#include "clocks.h" // Arrays use 0 based numbering: I2C1 is stored at index 0 #define MAX_I2C 4 @@ -125,7 +126,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } else if (frequency == 100000) { self->handle.Init.Timing = CPY_I2CSTANDARD_TIMINGR; } else { - mp_raise_ValueError(translate("MCU supports only I2C Standard and Fast modes")); + mp_raise_ValueError(translate("Unsupported baudrate")); } #else self->handle.Init.ClockSpeed = frequency; diff --git a/ports/stm/peripherals/clocks.h b/ports/stm/peripherals/clocks.h index 1f837c79ee..192190e5ee 100644 --- a/ports/stm/peripherals/clocks.h +++ b/ports/stm/peripherals/clocks.h @@ -24,4 +24,34 @@ * THE SOFTWARE. */ +// F4 Series +#ifdef STM32F401xE +#include "stm32f4/stm32f401xe/clocks.h" +#endif +#ifdef STM32F411xE +#include "stm32f4/stm32f411xe/clocks.h" +#endif +#ifdef STM32F412Zx +#include "stm32f4/stm32f412zx/clocks.h" +#endif +#ifdef STM32F405xx +#include "stm32f4/stm32f405xx/clocks.h" +#endif +#ifdef STM32F407xx +#include "stm32f4/stm32f407xx/clocks.h" +#endif + +// F7 Series +#ifdef STM32F746xx +#include "stm32f7/stm32f746xx/clocks.h" +#endif +#ifdef STM32F767xx +#include "stm32f7/stm32f767xx/clocks.h" +#endif + +// H7 Series +#ifdef STM32H743xx +#include "stm32h7/stm32h743xx/clocks.h" +#endif + void stm32_peripherals_clocks_init(void); diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h index eb44625143..bd53c38cd9 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h @@ -61,3 +61,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h index 187a024ad0..a89756db05 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h @@ -61,3 +61,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h index ad241b7ef6..e7c5170966 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h @@ -68,3 +68,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 +#endif From 3c3cad5ae6f050150931373e1472098671779973 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 11:11:44 -0500 Subject: [PATCH 120/131] docs: Improve 5.0.x <-> main branch doc linkrot This improves, but does not entirely fix, the broken links that result from the autoapi change. It fixes module-level links, but class links still do not work (e.g., /shared-bindings/displayio/Palette.html (5.0.x) is now just /shared-bindings/displayio/#displayio.Palette). --- .gitignore | 1 + conf.py | 1 + ports/atmel-samd/README.rst | 2 +- shared-bindings/index.rst | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f5edb89f0e..8a773970d3 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ _build ###################### genrst/ /autoapi/ +/shared-bindings/**/*.rst # ctags and similar ################### diff --git a/conf.py b/conf.py index 3980ea8e1b..06aab271b2 100644 --- a/conf.py +++ b/conf.py @@ -79,6 +79,7 @@ autoapi_add_toctree_entry = False autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary'] autoapi_template_dir = 'docs/autoapi/templates' autoapi_python_use_implicit_namespaces = True +autoapi_root = "shared-bindings" # The encoding of source files. #source_encoding = 'utf-8-sig' diff --git a/ports/atmel-samd/README.rst b/ports/atmel-samd/README.rst index a6881902e9..0746d1de06 100644 --- a/ports/atmel-samd/README.rst +++ b/ports/atmel-samd/README.rst @@ -21,4 +21,4 @@ Port Specific modules --------------------- .. toctree:: - ../../autoapi/samd/index + ../../shared-bindings/samd/index diff --git a/shared-bindings/index.rst b/shared-bindings/index.rst index d941773943..bf04ae18b1 100644 --- a/shared-bindings/index.rst +++ b/shared-bindings/index.rst @@ -19,5 +19,5 @@ Modules :glob: :maxdepth: 2 - ../autoapi/*/index + ../shared-bindings/*/index help From f83b0c2507611a95ab4dea0c87b25ba85a0de9d6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 12:56:22 -0500 Subject: [PATCH 121/131] docs: conf.py: alphabetize imports --- conf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf.py b/conf.py index 06aab271b2..99423841b8 100644 --- a/conf.py +++ b/conf.py @@ -14,11 +14,12 @@ # serve to show the default. import json -import sys import os +import subprocess +import sys +import urllib.parse import recommonmark -import subprocess # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the From cb8539b06dd4bce11207341a311bffca741d190c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 13:04:21 -0500 Subject: [PATCH 122/131] docs: Generate redirects for autoapi renaming --- conf.py | 45 ++++++++++++++++++++++ docs/redirects.txt | 94 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 docs/redirects.txt diff --git a/conf.py b/conf.py index 99423841b8..d39f74bd7d 100644 --- a/conf.py +++ b/conf.py @@ -14,6 +14,7 @@ # serve to show the default. import json +import logging import os import subprocess import sys @@ -82,6 +83,8 @@ autoapi_template_dir = 'docs/autoapi/templates' autoapi_python_use_implicit_namespaces = True autoapi_root = "shared-bindings" +redirects_file = 'docs/redirects.txt' + # The encoding of source files. #source_encoding = 'utf-8-sig' @@ -376,5 +379,47 @@ intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None), "bus_device": ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None), "register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)} +# Adapted from sphinxcontrib-redirects +from sphinx.builders import html as builders + +TEMPLATE = """ + + +""" + + +def generate_redirects(app): + path = os.path.join(app.srcdir, app.config.redirects_file) + if not os.path.exists(path): + app.info("Could not find redirects file at '%s'" % path) + return + + # TODO(stephenfin): Add support for DirectoryHTMLBuilder + if not type(app.builder) == builders.StandaloneHTMLBuilder: + logging.warn("The 'sphinxcontib-redirects' plugin is only supported " + "by the 'html' builder. Skipping...") + return + + with open(path) as redirects: + for line in redirects.readlines(): + from_path, to_path = line.rstrip().split(' ') + + logging.debug("Redirecting '%s' to '%s'" % (from_path, to_path)) + + from_path = os.path.splitext(from_path)[0] + ".html" + to_path_prefix = '..%s' % os.path.sep * ( + len(from_path.split(os.path.sep)) - 1) + to_path = to_path_prefix + to_path + + redirected_filename = os.path.join(app.builder.outdir, from_path) + redirected_directory = os.path.dirname(redirected_filename) + if not os.path.exists(redirected_directory): + os.makedirs(redirected_directory) + + with open(redirected_filename, 'w') as f: + f.write(TEMPLATE % urllib.parse.quote(to_path, '#/')) + def setup(app): app.add_css_file("customstyle.css") + app.add_config_value('redirects_file', 'redirects', 'env') + app.connect('builder-inited', generate_redirects) diff --git a/docs/redirects.txt b/docs/redirects.txt new file mode 100644 index 0000000000..68d0b2de2e --- /dev/null +++ b/docs/redirects.txt @@ -0,0 +1,94 @@ +shared-bindings/frequencyio/FrequencyIn.rst shared-bindings/frequencyio/#frequencyio.FrequencyIn +shared-bindings/fontio/BuiltinFont.rst shared-bindings/fontio/#fontio.BuiltinFont +shared-bindings/fontio/Glyph.rst shared-bindings/fontio/#fontio.Glyph +shared-bindings/aesio/AES.rst shared-bindings/aesio/#aesio.AES +shared-bindings/supervisor/Runtime.rst shared-bindings/supervisor/#supervisor.Runtime +shared-bindings/terminalio/Terminal.rst shared-bindings/terminalio/#terminalio.Terminal +shared-bindings/audiopwmio/PWMAudioOut.rst shared-bindings/audiopwmio/#audiopwmio.PWMAudioOut +shared-bindings/gamepadshift/GamePadShift.rst shared-bindings/gamepadshift/#gamepadshift.GamePadShift +shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle +shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon +shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle +shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape +shared-bindings/displayio/Bitmap.rst shared-bindings/displayio/#displayio.Bitmap +shared-bindings/displayio/ColorConverter.rst shared-bindings/displayio/#displayio.ColorConverter +shared-bindings/displayio/Display.rst shared-bindings/displayio/#displayio.Display +shared-bindings/displayio/EPaperDisplay.rst shared-bindings/displayio/#displayio.EPaperDisplay +shared-bindings/displayio/FourWire.rst shared-bindings/displayio/#displayio.FourWire +shared-bindings/displayio/Group.rst shared-bindings/displayio/#displayio.Group +shared-bindings/displayio/I2CDisplay.rst shared-bindings/displayio/#displayio.I2CDisplay +shared-bindings/displayio/OnDiskBitmap.rst shared-bindings/displayio/#displayio.OnDiskBitmap +shared-bindings/displayio/Palette.rst shared-bindings/displayio/#displayio.Palette +shared-bindings/displayio/ParallelBus.rst shared-bindings/displayio/#displayio.ParallelBus +shared-bindings/displayio/Shape.rst shared-bindings/displayio/#displayio.Shape +shared-bindings/displayio/TileGrid.rst shared-bindings/displayio/#displayio.TileGrid +shared-bindings/_pixelbuf/PixelBuf.rst shared-bindings/_pixelbuf/#_pixelbuf.PixelBuf +shared-bindings/gamepad/GamePad.rst shared-bindings/gamepad/#gamepad.GamePad +shared-bindings/_pew/PewPew.rst shared-bindings/_pew/#_pew.PewPew +shared-bindings/rotaryio/IncrementalEncoder.rst shared-bindings/rotaryio/#rotaryio.IncrementalEncoder +shared-bindings/audiomixer/Mixer.rst shared-bindings/audiomixer/#audiomixer.Mixer +shared-bindings/audiomixer/MixerVoice.rst shared-bindings/audiomixer/#audiomixer.MixerVoice +shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut +shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn +shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut +shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time +shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cslave/#i2cslave.I2CSlave +shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cslave/#i2cslave.I2CSlaveRequest +shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray +shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C +shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire +shared-bindings/busio/SPI.rst shared-bindings/busio/#busio.SPI +shared-bindings/busio/UART.rst shared-bindings/busio/#busio.UART +shared-bindings/busio/Parity.rst shared-bindings/busio/#busio.Parity +shared-bindings/ulab/array.rst shared-bindings/ulab/#ulab.array +shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode +shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer +shared-bindings/audioio/AudioOut.rst shared-bindings/audioio/#audioio.AudioOut +shared-bindings/ps2io/Ps2.rst shared-bindings/ps2io/#ps2io.Ps2 +shared-bindings/touchio/TouchIn.rst shared-bindings/touchio/#touchio.TouchIn +shared-bindings/rgbmatrix/RGBMatrix.rst shared-bindings/rgbmatrix/#rgbmatrix.RGBMatrix +shared-bindings/audiomp3/MP3.rst shared-bindings/audiomp3/#audiomp3.MP3 +shared-bindings/usb_midi/PortIn.rst shared-bindings/usb_midi/#usb_midi.PortIn +shared-bindings/usb_midi/PortOut.rst shared-bindings/usb_midi/#usb_midi.PortOut +shared-bindings/usb_hid/Device.rst shared-bindings/usb_hid/#usb_hid.Device +shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K +shared-bindings/_bleio/BluetoothError.rst shared-bindings/_bleio/#_bleio.BluetoothError +shared-bindings/_bleio/ConnectionError.rst shared-bindings/_bleio/#_bleio.ConnectionError +shared-bindings/_bleio/RoleError.rst shared-bindings/_bleio/#_bleio.RoleError +shared-bindings/_bleio/SecurityError.rst shared-bindings/_bleio/#_bleio.SecurityError +shared-bindings/_bleio/Adapter.rst shared-bindings/_bleio/#_bleio.Adapter +shared-bindings/_bleio/Address.rst shared-bindings/_bleio/#_bleio.Address +shared-bindings/_bleio/Attribute.rst shared-bindings/_bleio/#_bleio.Attribute +shared-bindings/_bleio/Characteristic.rst shared-bindings/_bleio/#_bleio.Characteristic +shared-bindings/_bleio/CharacteristicBuffer.rst shared-bindings/_bleio/#_bleio.CharacteristicBuffer +shared-bindings/_bleio/Connection.rst shared-bindings/_bleio/#_bleio.Connection +shared-bindings/_bleio/Descriptor.rst shared-bindings/_bleio/#_bleio.Descriptor +shared-bindings/_bleio/PacketBuffer.rst shared-bindings/_bleio/#_bleio.PacketBuffer +shared-bindings/_bleio/ScanEntry.rst shared-bindings/_bleio/#_bleio.ScanEntry +shared-bindings/_bleio/ScanResults.rst shared-bindings/_bleio/#_bleio.ScanResults +shared-bindings/_bleio/Service.rst shared-bindings/_bleio/#_bleio.Service +shared-bindings/_bleio/UUID.rst shared-bindings/_bleio/#_bleio.UUID +shared-bindings/socket/socket.rst shared-bindings/socket/#socket.socket +shared-bindings/microcontroller/Pin.rst shared-bindings/microcontroller/#microcontroller.Pin +shared-bindings/microcontroller/Processor.rst shared-bindings/microcontroller/#microcontroller.Processor +shared-bindings/microcontroller/RunMode.rst shared-bindings/microcontroller/#microcontroller.RunMode +shared-bindings/audiocore/RawSample.rst shared-bindings/audiocore/#audiocore.RawSample +shared-bindings/audiocore/WaveFile.rst shared-bindings/audiocore/#audiocore.WaveFile +shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebufferio/#framebufferio.FramebufferDisplay +shared-bindings/audiobusio/I2SOut.rst shared-bindings/audiobusio/#audiobusio.I2SOut +shared-bindings/audiobusio/PDMIn.rst shared-bindings/audiobusio/#audiobusio.PDMIn +shared-bindings/countio/Counter.rst shared-bindings/countio/#countio.Counter +shared-bindings/storage/VfsFat.rst shared-bindings/storage/#storage.VfsFat +shared-bindings/digitalio/DigitalInOut.rst shared-bindings/digitalio/#digitalio.DigitalInOut +shared-bindings/digitalio/Direction.rst shared-bindings/digitalio/#digitalio.Direction +shared-bindings/digitalio/DriveMode.rst shared-bindings/digitalio/#digitalio.DriveMode +shared-bindings/digitalio/Pull.rst shared-bindings/digitalio/#digitalio.Pull +shared-bindings/bitbangio/I2C.rst shared-bindings/bitbangio/#bitbangio.I2C +shared-bindings/bitbangio/OneWire.rst shared-bindings/bitbangio/#bitbangio.OneWire +shared-bindings/bitbangio/SPI.rst shared-bindings/bitbangio/#bitbangio.SPI +shared-bindings/rtc/RTC.rst shared-bindings/rtc/#rtc.RTC +shared-bindings/analogio/AnalogIn.rst shared-bindings/analogio/#analogio.AnalogIn +shared-bindings/analogio/AnalogOut.rst shared-bindings/analogio/#analogio.AnalogOut +shared-bindings/_stage/Layer.rst shared-bindings/_stage/#_stage.Layer +shared-bindings/_stage/Text.rst shared-bindings/_stage/#_stage.Text +shared-bindings/samd/Clock.rst shared-bindings/samd/#samd.Clock From 32a29ffdff4f757b818be9d63df44366a9ea389c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 13:04:58 -0500 Subject: [PATCH 123/131] shared-bindings: Change docstrings with '\x...' chars to raw strings Closes: #3032 --- shared-bindings/_bleio/Address.c | 2 +- shared-bindings/displayio/Display.c | 2 +- shared-bindings/displayio/Palette.c | 2 +- shared-bindings/nvm/ByteArray.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index ccbab1b9d2..9beaff2ab2 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -78,7 +78,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, } //| address_bytes: Any = ... -//| """The bytes that make up the device address (read-only). +//| r"""The bytes that make up the device address (read-only). //| //| Note that the ``bytes`` object returned is in little-endian order: //| The least significant byte is ``address_bytes[0]``. So the address will diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 62ef0f5d00..6e454f34bd 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -50,7 +50,7 @@ //| contain the initialization sequence at minimum.""" //| //| def __init__(self, display_bus: Any, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60): -//| """Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). +//| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a //| command byte followed by a byte to determine the parameter count and if a delay is need after. diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 871b2b06af..37cfbd82e9 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -85,7 +85,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } //| def __setitem__(self, index: Any, value: Any) -> Any: -//| """Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. +//| r"""Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. //| //| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value). //| Value can be an int, bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)), bytearray, diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 326f719a83..06d7d4c95b 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -32,7 +32,7 @@ #include "supervisor/shared/translate.h" //| class ByteArray: -//| """Presents a stretch of non-volatile memory as a bytearray. +//| r"""Presents a stretch of non-volatile memory as a bytearray. //| //| Non-volatile memory is available as a byte array that persists over reloads //| and power cycles. Each assignment causes an erase and write cycle so its recommended to assign From 03c04e77ae5f94750408009cfa91f06b96a5898d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 18:54:05 -0500 Subject: [PATCH 124/131] actions: Try checkout v2.2.0 This version is supposed to > Fetch all history for all tags and branches when fetch-depth=0 We leave the tags fetch in place so that actions _in cloned repos_ work. Cloned repos' tags do not necessarily match adafruit/circuitpython, but we want version reporting to be able to use adafruit/circuitpython tags when they are most relevant according to "git describe"'s heuristics. Submodules are different, as they always point to the repo specified in .gitmodules, so they don't need special handling to get the most relevant tags. --- .github/workflows/build.yml | 25 +++++-------------------- .github/workflows/create_website_pr.yml | 3 +-- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00454cc2da..ae73b3a655 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,14 +16,11 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Set up Python 3.8 @@ -110,14 +107,11 @@ jobs: gcc --version python3 --version msgfmt --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Build mpy-cross @@ -286,14 +280,11 @@ jobs: gcc --version arm-none-eabi-gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: mpy-cross run: make -C mpy-cross -j2 - name: build @@ -337,14 +328,11 @@ jobs: gcc --version riscv64-unknown-elf-gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: mpy-cross run: make -C mpy-cross -j2 - name: build @@ -377,14 +365,11 @@ jobs: uses: actions/setup-python@v1 with: python-version: 3.8 - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - uses: actions/cache@v1 diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 79a6c68a75..9907c08ae6 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -23,12 +23,11 @@ jobs: run: | gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Website From 2aac3cbdceffbeb1d70ac9de1412a29335f18158 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 15 Jun 2020 13:51:09 -0400 Subject: [PATCH 125/131] Revert I2C timing overrides, reduce scope to module only --- .../stm32f746g_discovery/mpconfigboard.h | 4 --- ports/stm/common-hal/busio/I2C.c | 19 +++++++++++- ports/stm/peripherals/clocks.h | 30 ------------------- .../peripherals/stm32f7/stm32f746xx/clocks.h | 8 ----- .../peripherals/stm32f7/stm32f767xx/clocks.h | 8 ----- .../peripherals/stm32h7/stm32h743xx/clocks.h | 8 ----- 6 files changed, 18 insertions(+), 59 deletions(-) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 35a28ca3d1..769990a98c 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -50,10 +50,6 @@ #define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_6) #define CPY_CLK_USB_USES_AUDIOPLL (1) -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00401959 -#define CPY_I2CSTANDARD_TIMINGR 0x00C0EAFF - #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 00f15aaa60..6adcf55750 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -33,7 +33,24 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" -#include "clocks.h" + +// I2C timing specs for the H7 and F7 +// Configured for maximum possible clock settings for the family +#if (CPY_STM32F7) +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif +#elif (CPY_STM32H7) +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 +#endif +#endif // Arrays use 0 based numbering: I2C1 is stored at index 0 #define MAX_I2C 4 diff --git a/ports/stm/peripherals/clocks.h b/ports/stm/peripherals/clocks.h index 192190e5ee..1f837c79ee 100644 --- a/ports/stm/peripherals/clocks.h +++ b/ports/stm/peripherals/clocks.h @@ -24,34 +24,4 @@ * THE SOFTWARE. */ -// F4 Series -#ifdef STM32F401xE -#include "stm32f4/stm32f401xe/clocks.h" -#endif -#ifdef STM32F411xE -#include "stm32f4/stm32f411xe/clocks.h" -#endif -#ifdef STM32F412Zx -#include "stm32f4/stm32f412zx/clocks.h" -#endif -#ifdef STM32F405xx -#include "stm32f4/stm32f405xx/clocks.h" -#endif -#ifdef STM32F407xx -#include "stm32f4/stm32f407xx/clocks.h" -#endif - -// F7 Series -#ifdef STM32F746xx -#include "stm32f7/stm32f746xx/clocks.h" -#endif -#ifdef STM32F767xx -#include "stm32f7/stm32f767xx/clocks.h" -#endif - -// H7 Series -#ifdef STM32H743xx -#include "stm32h7/stm32h743xx/clocks.h" -#endif - void stm32_peripherals_clocks_init(void); diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h index bd53c38cd9..eb44625143 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h @@ -61,11 +61,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x6000030D -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 -#endif diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h index a89756db05..187a024ad0 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h @@ -61,11 +61,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x6000030D -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 -#endif diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h index e7c5170966..ad241b7ef6 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h @@ -68,11 +68,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 -#endif From 81896930c7a91447c8830003e8cf92dce28db3d4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 15 Jun 2020 16:35:51 -0400 Subject: [PATCH 126/131] Fix ScanEntry prefix matching for all --- shared-module/_bleio/ScanEntry.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/shared-module/_bleio/ScanEntry.c b/shared-module/_bleio/ScanEntry.c index 785209c4ab..91712baadc 100644 --- a/shared-module/_bleio/ScanEntry.c +++ b/shared-module/_bleio/ScanEntry.c @@ -56,12 +56,19 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t if (prefixes_length == 0) { return true; } + if (len == 0) { + // Prefixes exist, but no data. + return false; + } size_t i = 0; while(i < prefixes_length) { uint8_t prefix_length = prefixes[i]; i += 1; size_t j = 0; + bool prefix_matched = false; + mp_printf(&mp_plat_print,"i %d\n", i); // XXX while (j < len) { + mp_printf(&mp_plat_print," j %d\n", j); // XXX uint8_t structure_length = data[j]; j += 1; if (structure_length == 0) { @@ -71,13 +78,21 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t if (any) { return true; } - } else if (!any) { - return false; + prefix_matched = true; + mp_printf(&mp_plat_print," match\n"); // XXX + break; } j += structure_length; } + // If all (!any), the current prefix must have matched at least one field. + if (!prefix_matched && !any) { + mp_printf(&mp_plat_print," Date: Mon, 15 Jun 2020 16:50:33 -0500 Subject: [PATCH 127/131] docs: conf.py: Remove an irrelevant TODO This TODO made sense in the context of the original project, but for use in CircuitPython it does not appear to be relevant. Remove it. --- conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conf.py b/conf.py index d39f74bd7d..38546a5d0a 100644 --- a/conf.py +++ b/conf.py @@ -394,7 +394,6 @@ def generate_redirects(app): app.info("Could not find redirects file at '%s'" % path) return - # TODO(stephenfin): Add support for DirectoryHTMLBuilder if not type(app.builder) == builders.StandaloneHTMLBuilder: logging.warn("The 'sphinxcontib-redirects' plugin is only supported " "by the 'html' builder. Skipping...") From c91435eff2e0ec0fa92fb383e2e96a18237d5c3f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 15 Jun 2020 18:10:34 -0400 Subject: [PATCH 128/131] remove debugging prints --- shared-module/_bleio/ScanEntry.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/shared-module/_bleio/ScanEntry.c b/shared-module/_bleio/ScanEntry.c index 91712baadc..af9e4b3471 100644 --- a/shared-module/_bleio/ScanEntry.c +++ b/shared-module/_bleio/ScanEntry.c @@ -66,9 +66,7 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t i += 1; size_t j = 0; bool prefix_matched = false; - mp_printf(&mp_plat_print,"i %d\n", i); // XXX while (j < len) { - mp_printf(&mp_plat_print," j %d\n", j); // XXX uint8_t structure_length = data[j]; j += 1; if (structure_length == 0) { @@ -79,20 +77,17 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t return true; } prefix_matched = true; - mp_printf(&mp_plat_print," match\n"); // XXX break; } j += structure_length; } // If all (!any), the current prefix must have matched at least one field. if (!prefix_matched && !any) { - mp_printf(&mp_plat_print," Date: Tue, 16 Jun 2020 12:03:56 -0400 Subject: [PATCH 129/131] Add meowbit UF2 download override to website --- tools/build_board_info.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 4433023305..6c670930f4 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -56,7 +56,10 @@ extension_by_board = { "makerdiary_nrf52840_mdk_usb_dongle": HEX_UF2, "pca10056": BIN_UF2, "pca10059": BIN_UF2, - "electronut_labs_blip": HEX + "electronut_labs_blip": HEX, + + # stm32 + "meowbit_v121": UF2 } aliases_by_board = { From fd4aafacbe9251177694598ea65f51f59af3f614 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 16 Jun 2020 12:33:15 -0400 Subject: [PATCH 130/131] Add port D to LQFP64 --- ports/stm/common-hal/microcontroller/Pin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 6102134978..e966f709f6 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -46,8 +46,8 @@ bool neopixel_in_use; #define GPIO_PORT_COUNT 5 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; #elif defined(LQFP64) - #define GPIO_PORT_COUNT 3 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; + #define GPIO_PORT_COUNT 4 + GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD}; #elif defined(UFQFPN48) #define GPIO_PORT_COUNT 3 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; From 80fdb18da130afed96316bdcd05e39134aea619e Mon Sep 17 00:00:00 2001 From: Andreas Buchen Date: Tue, 16 Jun 2020 05:50:40 +0000 Subject: [PATCH 131/131] Translated using Weblate (German) Currently translated at 98.0% (749 of 764 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/de/ --- locale/de_DE.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 76a0eec831..1359ce6dd0 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-05-29 17:42+0000\n" -"Last-Translator: Thomas Friehoff \n" +"PO-Revision-Date: 2020-06-16 18:24+0000\n" +"Last-Translator: Andreas Buchen \n" "Language-Team: German \n" "Language: de_DE\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.1-dev\n" +"X-Generator: Weblate 4.1.1-dev\n" #: main.c msgid "" @@ -1717,7 +1717,7 @@ msgstr "" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimer läuft aktuell nicht" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET"