From cf888dc02bf0409cbe6e6ecf3a03a3278a6ec0b2 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Fri, 29 May 2020 15:40:56 -0400 Subject: .../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 f99fad4e7..466ab49eb 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 {\ -- cgit v1.2.3 From 89bd87d9fca62e3d8255d9435937280a11e857e6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 31 May 2020 10:35:42 -0500 Subject: 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 8ac08d8c9..3abc5512c 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) }, }; -- cgit v1.2.3 From e0ca70119c420be8d6a65b4b9b7371fb6459af1b Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Mon, 1 Jun 2020 07:13:45 +0000 Subject: 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 7eed2c70c..443302330 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 -- cgit v1.2.3 From ce337eaa27805428b1245502b75e56ae63b8422d Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Mon, 1 Jun 2020 11:35:46 +0200 Subject: 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 9ec9dbfdf..a7e9c30a3 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. -- cgit v1.2.3 From 79e2ede7c1f4c712ba159400e10282c8f28fb033 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 07:51:32 -0500 Subject: 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 f6146bfe4..55f64b17d 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 -- cgit v1.2.3 From 9cffe28ae77d1203308c0eed03160ab91e007064 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 31 May 2020 14:20:47 +0000 Subject: 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 fe16dbdc7..1c536ab53 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" -- cgit v1.2.3 From c909b733a82385a8661ce54fa3ed0b793a0cfffb Mon Sep 17 00:00:00 2001 From: David Glaude Date: Sun, 31 May 2020 14:21:38 +0000 Subject: 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 1c536ab53..9de062b54 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 -- cgit v1.2.3 From 81452475e4ce3d3005f7eeb9990c25aa5a378ef2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 31 May 2020 14:27:55 +0000 Subject: 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 a0f0494ba..e9c7c7fdf 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" -- cgit v1.2.3