Skip to content

Commit

Permalink
Merge branch 'master' into update-ulab
Browse files Browse the repository at this point in the history
  • Loading branch information
tannewt authored Jun 1, 2020
2 parents 7f3fd20 + bdbb16e commit a170c5e
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 67 deletions.
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions locale/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \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 <jepler@gmail.com>\n"
"POT-Creation-Date: 2020-05-27 20:51-0500\n"
"PO-Revision-Date: 2020-06-01 13:17+0000\n"
"Last-Translator: David Glaude <david.glaude@gmail.com>\n"
"Language-Team: French <https://later.unpythonic.net/projects/circuitpython/"
"circuitpython-master/fr/>\n"
"Language: fr\n"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -1282,7 +1282,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"
Expand Down
2 changes: 1 addition & 1 deletion locale/sv.po
Original file line number Diff line number Diff line change
Expand Up @@ -3196,7 +3196,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"
Expand Down
15 changes: 7 additions & 8 deletions ports/cxd56/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <sys/boardctl.h>
#include <sys/time.h>

#include <cxd56_rtc.h>

#include "sched/sched.h"

#include "boards/board.h"
Expand All @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
97 changes: 49 additions & 48 deletions shared-bindings/storage/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
};

Expand Down
18 changes: 18 additions & 0 deletions supervisor/shared/external_flash/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {\
Expand Down
2 changes: 1 addition & 1 deletion tools/build_board_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

# 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
Expand Down

0 comments on commit a170c5e

Please sign in to comment.