Skip to content

Commit e08ad22

Browse files
authored
Merge pull request #8317 from jepler/merge-82x
Merge 8.2.x into main
2 parents dfb070b + 6e8a59a commit e08ad22

File tree

29 files changed

+195
-70
lines changed

29 files changed

+195
-70
lines changed

docs/rstjinja.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Derived from code on Eric Holscher's blog, found at:
22
# https://www.ericholscher.com/blog/2016/jul/25/integrating-jinja-rst-sphinx/
33

4+
import re
5+
6+
def render_with_jinja(docname, source):
7+
if re.search('^\s*.. jinja$', source[0], re.M):
8+
return True
9+
return False
10+
411
def rstjinja(app, docname, source):
512
"""
613
Render our pages as a jinja template for fancy templating goodness.
@@ -9,12 +16,12 @@ def rstjinja(app, docname, source):
916
if app.builder.format not in ("html", "latex"):
1017
return
1118

12-
# we only want our one jinja template to run through this func
13-
if "shared-bindings/support_matrix" not in docname:
19+
# we only want specific files to run through this func
20+
if not render_with_jinja(docname, source):
1421
return
1522

1623
src = rendered = source[0]
17-
print(docname)
24+
print(f"rendering {docname} as jinja templates")
1825

1926
if app.builder.format == "html":
2027
rendered = app.builder.templates.render_string(

docs/shared_bindings_matrix.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,23 @@
6969
"array": "CIRCUITPY_ARRAY",
7070
# always available, so depend on something that's always 1.
7171
"builtins": "CIRCUITPY",
72+
"builtins.pow3": "CIRCUITPY_BUILTINS_POW3",
73+
"busio.SPI": "CIRCUITPY_BUSIO_SPI",
74+
"busio.UART": "CIRCUITPY_BUSIO_UART",
7275
"collections": "CIRCUITPY_COLLECTIONS",
7376
"fontio": "CIRCUITPY_DISPLAYIO",
7477
"io": "CIRCUITPY_IO",
78+
"keypad.KeyMatrix": "CIRCUITPY_KEYPAD_KEYMATRIX",
79+
"keypad.Keys": "CIRCUITPY_KEYPAD_KEYS",
80+
"keypad.ShiftRegisterKeys": "CIRCUITPY_KEYPAD_SHIFTREGISTERKEYS",
81+
"os.getenv": "CIRCUITPY_OS_GETENV",
7582
"select": "MICROPY_PY_USELECT_SELECT",
76-
"terminalio": "CIRCUITPY_DISPLAYIO",
7783
"sys": "CIRCUITPY_SYS",
84+
"terminalio": "CIRCUITPY_DISPLAYIO",
7885
"usb": "CIRCUITPY_USB_HOST",
7986
}
8087

81-
MODULES_NOT_IN_BINDINGS = [
82-
"_asyncio",
83-
"array",
84-
"binascii",
85-
"builtins",
86-
"collections",
87-
"errno",
88-
"json",
89-
"re",
90-
"select",
91-
"sys",
92-
"ulab",
93-
]
88+
MODULES_NOT_IN_BINDINGS = [ "binascii", "errno", "json", "re", "ulab" ]
9489

9590
FROZEN_EXCLUDES = ["examples", "docs", "tests", "utils", "conf.py", "setup.py"]
9691
"""Files and dirs at the root of a frozen directory that should be ignored.
@@ -117,7 +112,7 @@ def get_bindings():
117112
bindings_modules = []
118113
for d in get_circuitpython_root_dir().glob("ports/*/bindings"):
119114
bindings_modules.extend(module.name for module in d.iterdir() if d.is_dir())
120-
return shared_bindings_modules + bindings_modules + MODULES_NOT_IN_BINDINGS
115+
return shared_bindings_modules + bindings_modules + MODULES_NOT_IN_BINDINGS + list(ADDITIONAL_MODULES.keys())
121116

122117

123118
def get_board_mapping():

locale/circuitpython.pot

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ msgstr ""
3131
#: supervisor/shared/safe_mode.c
3232
msgid ""
3333
"\n"
34-
"Please file an issue with your program at https://github.com/adafruit/"
35-
"circuitpython/issues."
34+
"Please file an issue with your program at github.com/adafruit/circuitpython/"
35+
"issues."
3636
msgstr ""
3737

3838
#: supervisor/shared/safe_mode.c
@@ -393,10 +393,6 @@ msgstr ""
393393
msgid "'continue' outside loop"
394394
msgstr ""
395395

396-
#: py/objgenerator.c
397-
msgid "'coroutine' object is not an iterator"
398-
msgstr ""
399-
400396
#: py/compile.c
401397
msgid "'data' requires at least 2 arguments"
402398
msgstr ""
@@ -664,11 +660,6 @@ msgstr ""
664660
msgid "Buffer is not a bytearray."
665661
msgstr ""
666662

667-
#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c
668-
#: shared-bindings/framebufferio/FramebufferDisplay.c
669-
msgid "Buffer is too small"
670-
msgstr ""
671-
672663
#: ports/stm/common-hal/audiopwmio/PWMAudioOut.c
673664
#, c-format
674665
msgid "Buffer length %d too big. It must be less than %d"
@@ -688,6 +679,12 @@ msgstr ""
688679
msgid "Buffer too short by %d bytes"
689680
msgstr ""
690681

682+
#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c
683+
#: shared-bindings/framebufferio/FramebufferDisplay.c
684+
#: shared-bindings/struct/__init__.c shared-module/struct/__init__.c
685+
msgid "Buffer too small"
686+
msgstr ""
687+
691688
#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c
692689
msgid "Buffers must be same size"
693690
msgstr ""
@@ -1030,10 +1027,6 @@ msgstr ""
10301027
msgid "Failed to write internal flash."
10311028
msgstr ""
10321029

1033-
#: supervisor/shared/safe_mode.c
1034-
msgid "Fault detected by hardware."
1035-
msgstr ""
1036-
10371030
#: py/moduerrno.c
10381031
msgid "File exists"
10391032
msgstr ""
@@ -1109,6 +1102,10 @@ msgstr ""
11091102
msgid "Half duplex SPI is not implemented"
11101103
msgstr ""
11111104

1105+
#: supervisor/shared/safe_mode.c
1106+
msgid "Hard fault: memory access or instruction error."
1107+
msgstr ""
1108+
11121109
#: ports/mimxrt10xx/common-hal/busio/SPI.c
11131110
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c
11141111
#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/busio/UART.c
@@ -1755,6 +1752,10 @@ msgstr ""
17551752
msgid "Polygon needs at least 3 points"
17561753
msgstr ""
17571754

1755+
#: supervisor/shared/safe_mode.c
1756+
msgid "Power dipped. Make sure you are providing enough power."
1757+
msgstr ""
1758+
17581759
#: shared-bindings/_bleio/Adapter.c
17591760
msgid "Prefix buffer must be on the heap"
17601761
msgstr ""
@@ -1986,10 +1987,6 @@ msgstr ""
19861987
msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30"
19871988
msgstr ""
19881989

1989-
#: supervisor/shared/safe_mode.c
1990-
msgid "The power dipped. Make sure you are providing enough power."
1991-
msgstr ""
1992-
19931990
#: shared-module/audiomixer/MixerVoice.c
19941991
msgid "The sample's bits_per_sample does not match the mixer's"
19951992
msgstr ""
@@ -2580,8 +2577,7 @@ msgstr ""
25802577
msgid "buffer slices must be of equal length"
25812578
msgstr ""
25822579

2583-
#: py/modstruct.c shared-bindings/struct/__init__.c
2584-
#: shared-module/struct/__init__.c
2580+
#: py/modstruct.c shared-module/struct/__init__.c
25852581
msgid "buffer too small"
25862582
msgstr ""
25872583

@@ -3866,10 +3862,6 @@ msgstr ""
38663862
msgid "pixel coordinates out of bounds"
38673863
msgstr ""
38683864

3869-
#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c
3870-
msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter"
3871-
msgstr ""
3872-
38733865
#: extmod/vfs_posix_file.c
38743866
msgid "poll on file not available on win32"
38753867
msgstr ""
@@ -4181,7 +4173,7 @@ msgstr ""
41814173
msgid "type is not an acceptable base type"
41824174
msgstr ""
41834175

4184-
#: py/objgenerator.c py/runtime.c
4176+
#: py/runtime.c
41854177
msgid "type object '%q' has no attribute '%q'"
41864178
msgstr ""
41874179

ports/cxd56/common-hal/camera/Camera.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ size_t common_hal_camera_take_picture(camera_obj_t *self, uint8_t *buffer, size_
184184
mp_raise_ValueError(translate("Size not supported"));
185185
}
186186
if (!camera_check_buffer_length(width, height, format, len)) {
187-
mp_raise_ValueError(translate("Buffer is too small"));
187+
mp_raise_ValueError(translate("Buffer too small"));
188188
}
189189
if (!camera_check_format(format)) {
190190
mp_raise_ValueError(translate("Format not supported"));

ports/raspberrypi/boards/adafruit_feather_rp2040_usb_host/mpconfigboard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define MICROPY_HW_MCU_NAME "rp2040"
33

44
#define MICROPY_HW_NEOPIXEL (&pin_GPIO21)
5+
#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO20)
56

67
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3)
78
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2)

ports/raspberrypi/boards/pimoroni_pico_dv_base/board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
void board_init(void) {
3434
picodvi_framebuffer_obj_t *fb = &allocate_display_bus()->picodvi;
3535
fb->base.type = &picodvi_framebuffer_type;
36-
common_hal_picodvi_framebuffer_construct(fb, 640, 480,
36+
common_hal_picodvi_framebuffer_construct(fb, 320, 240,
3737
&pin_GPIO7, &pin_GPIO6,
3838
&pin_GPIO9, &pin_GPIO8,
3939
&pin_GPIO11, &pin_GPIO10,

ports/raspberrypi/supervisor/port.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,15 @@ uint32_t *port_heap_get_top(void) {
252252
return port_stack_get_top();
253253
}
254254

255+
uint32_t __uninitialized_ram(saved_word);
255256
void port_set_saved_word(uint32_t value) {
256-
// Store in a watchdog scratch register instead of RAM. 4-7 are used by the
257-
// sdk. 0 is used by alarm. 1-3 are free.
258-
watchdog_hw->scratch[1] = value;
257+
// Store in RAM because the watchdog scratch registers don't survive
258+
// resetting by pulling the RUN pin low.
259+
saved_word = value;
259260
}
260261

261262
uint32_t port_get_saved_word(void) {
262-
return watchdog_hw->scratch[1];
263+
return saved_word;
263264
}
264265

265266
static volatile bool ticks_enabled;

shared-bindings/busio/SPI.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,22 @@
5252
//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate
5353
//| select line, often abbreviated `!CS` or `!SS`. (This is common because
5454
//| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines
55-
//| and therefore the hardware.)"""
55+
//| and therefore the hardware.)
56+
//|
57+
//| .. raw:: html
58+
//|
59+
//| <p>
60+
//| <details>
61+
//| <summary>Available on these boards</summary>
62+
//| <ul>
63+
//| {% for board in support_matrix_reverse["busio.SPI"] %}
64+
//| <li> {{ board }}
65+
//| {% endfor %}
66+
//| </ul>
67+
//| </details>
68+
//| </p>
69+
//|
70+
//| """
5671
//|
5772
//| def __init__(
5873
//| self,

0 commit comments

Comments
 (0)