From f7eac46c7814a8c8cdc1f8841d3087fcf0a0632c Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sat, 27 Feb 2021 00:07:30 +0100 Subject: [PATCH 1/4] Update StateMachine.c Changed woring to use max instead --- ports/raspberrypi/bindings/rp2pio/StateMachine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index 77f61acd0318..b29e070e4834 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -468,12 +468,12 @@ STATIC mp_obj_t rp2pio_statemachine_write_readinto(size_t n_args, const mp_obj_t int in_stride_in_bytes = mp_binary_get_size('@', buf_in_info.typecode, NULL); if (in_stride_in_bytes > 4) { - mp_raise_ValueError(translate("In buffer elements must be 4 bytes long or less")); + mp_raise_ValueError(translate("In buffer elements must be max 4 bytes long")); } int out_stride_in_bytes = mp_binary_get_size('@', buf_out_info.typecode, NULL); if (out_stride_in_bytes > 4) { - mp_raise_ValueError(translate("Out buffer elements must be 4 bytes long or less")); + mp_raise_ValueError(translate("Out buffer elements must be max 4 bytes long")); } bool ok = common_hal_rp2pio_statemachine_write_readinto(self, From 94edff9063ca29d0a060c44d92a85aa9eff37f13 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Feb 2021 15:42:53 -0800 Subject: [PATCH 2/4] translation update --- locale/circuitpython.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index bc5c4084d7ea..db14966a5154 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1086,7 +1086,7 @@ msgid "IV must be %d bytes long" msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "In buffer elements must be 4 bytes long or less" +msgid "In buffer elements must be max 4 bytes long" msgstr "" #: py/persistentcode.c @@ -1688,7 +1688,7 @@ msgid "Operation timed out" msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Out buffer elements must be 4 bytes long or less" +msgid "Out buffer elements must be max 4 bytes long" msgstr "" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c From f41fb6fafc1fad51154c476ddfe5aa6772d08d8d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 2 Mar 2021 12:01:50 -0500 Subject: [PATCH 3/4] Apply suggestions from code review copyediting --- ports/raspberrypi/bindings/rp2pio/StateMachine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index b29e070e4834..444e00ace30b 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -468,12 +468,12 @@ STATIC mp_obj_t rp2pio_statemachine_write_readinto(size_t n_args, const mp_obj_t int in_stride_in_bytes = mp_binary_get_size('@', buf_in_info.typecode, NULL); if (in_stride_in_bytes > 4) { - mp_raise_ValueError(translate("In buffer elements must be max 4 bytes long")); + mp_raise_ValueError(translate("In-buffer elements must be <= 4 bytes long")); } int out_stride_in_bytes = mp_binary_get_size('@', buf_out_info.typecode, NULL); if (out_stride_in_bytes > 4) { - mp_raise_ValueError(translate("Out buffer elements must be max 4 bytes long")); + mp_raise_ValueError(translate("Out-buffer elements must be <= 4 bytes long")); } bool ok = common_hal_rp2pio_statemachine_write_readinto(self, From 3268330b3a54415817a315f862952dc2263a6291 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 2 Mar 2021 12:04:32 -0500 Subject: [PATCH 4/4] make translate --- locale/circuitpython.pot | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index db14966a5154..cfda0b67d63d 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1086,7 +1086,7 @@ msgid "IV must be %d bytes long" msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "In buffer elements must be max 4 bytes long" +msgid "In-buffer elements must be <= 4 bytes long" msgstr "" #: py/persistentcode.c @@ -1687,10 +1687,6 @@ msgstr "" msgid "Operation timed out" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Out buffer elements must be max 4 bytes long" -msgstr "" - #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -1699,6 +1695,10 @@ msgstr "" msgid "Out of sockets" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out-buffer elements must be <= 4 bytes long" +msgstr "" + #: shared-bindings/bitops/__init__.c #, c-format msgid "Output buffer must be at least %d bytes"