Skip to content

Commit 51964da

Browse files
committed
Add SPI and merge zephyr_(serial|i2c) into busio
Also: * Add enabling modules based on other available modules. (Such as displayio when busio is available.) * Implement ticks for display refreshes. * Be more rigorous finding flash and RAM regions. Add tests.
1 parent 97b8343 commit 51964da

File tree

49 files changed

+1820
-1631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1820
-1631
lines changed

.github/workflows/run-tests.yml

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,38 @@ jobs:
2323
TEST_native: --emit native
2424
TEST_native_mpy: --via-mpy --emit native -d basics float micropython
2525
steps:
26-
- name: Set up repository
27-
uses: actions/checkout@v4
28-
with:
29-
submodules: false
30-
show-progress: false
31-
fetch-depth: 1
32-
- name: Set up python
33-
uses: actions/setup-python@v5
34-
with:
35-
python-version: 3.12
36-
- name: Set up submodules
37-
uses: ./.github/actions/deps/submodules
38-
with:
39-
target: tests
40-
- name: Set up external
41-
if: matrix.test == 'all'
42-
uses: ./.github/actions/deps/external
43-
- name: Set up mpy-cross
44-
uses: ./.github/actions/mpy_cross
45-
with:
46-
cp-version: ${{ inputs.cp-version }}
47-
- name: Build unix port
48-
run: make -C ports/unix VARIANT=coverage -j4
49-
- name: Run tests
50-
run: ./run-tests.py -j4 ${{ env[format('TEST_{0}', matrix.test)] }}
51-
working-directory: tests
52-
- name: Print failure info
53-
run: ./run-tests.py -j4 --print-failures
54-
if: failure()
55-
working-directory: tests
26+
- name: Set up repository
27+
uses: actions/checkout@v4
28+
with:
29+
submodules: false
30+
show-progress: false
31+
fetch-depth: 1
32+
- name: Set up python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: 3.12
36+
- name: Set up submodules
37+
uses: ./.github/actions/deps/submodules
38+
with:
39+
target: tests
40+
- name: Set up external
41+
if: matrix.test == 'all'
42+
uses: ./.github/actions/deps/external
43+
- name: Set up mpy-cross
44+
uses: ./.github/actions/mpy_cross
45+
with:
46+
cp-version: ${{ inputs.cp-version }}
47+
- name: Build unix port
48+
run: make -C ports/unix VARIANT=coverage -j4
49+
- name: Run tests
50+
run: ./run-tests.py -j4 ${{ env[format('TEST_{0}', matrix.test)] }}
51+
working-directory: tests
52+
- name: Print failure info
53+
run: ./run-tests.py -j4 --print-failures
54+
if: failure()
55+
working-directory: tests
56+
- name: Run Zephyr build tests
57+
run: make -C ports/zephyr-cp test
5658
# Not working after MicroPython v1.23 merge.
5759
# - name: Build native modules
5860
# if: matrix.test == 'all'

locale/circuitpython.pot

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,9 +1117,8 @@ msgid ""
11171117
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
11181118
msgstr ""
11191119

1120-
#: ports/zephyr-cp/bindings/zephyr_i2c/I2C.c shared-bindings/bitbangio/I2C.c
1121-
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/I2C.c
1122-
#: shared-bindings/busio/SPI.c
1120+
#: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c
1121+
#: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c
11231122
msgid "Function requires lock"
11241123
msgstr ""
11251124

@@ -1462,8 +1461,7 @@ msgstr ""
14621461
msgid "Mount point directory missing"
14631462
msgstr ""
14641463

1465-
#: ports/zephyr-cp/bindings/zephyr_serial/UART.c shared-bindings/busio/UART.c
1466-
#: shared-bindings/displayio/Group.c
1464+
#: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c
14671465
msgid "Must be a %q subclass."
14681466
msgstr ""
14691467

@@ -2396,6 +2394,12 @@ msgstr ""
23962394
msgid "Update failed"
23972395
msgstr ""
23982396

2397+
#: ports/zephyr-cp/common-hal/busio/I2C.c
2398+
#: ports/zephyr-cp/common-hal/busio/SPI.c
2399+
#: ports/zephyr-cp/common-hal/busio/UART.c
2400+
msgid "Use device tree to define %q devices"
2401+
msgstr ""
2402+
23992403
#: ports/espressif/common-hal/_bleio/Characteristic.c
24002404
#: ports/nordic/common-hal/_bleio/Characteristic.c
24012405
#: ports/nordic/common-hal/_bleio/Descriptor.c

ports/zephyr-cp/Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ BUILD ?= build-$(BOARD)
88

99
TRANSLATION ?= en_US
1010

11-
.PHONY: $(BUILD)/zephyr-cp/zephyr/zephyr.elf flash debug clean menuconfig
11+
.PHONY: $(BUILD)/zephyr-cp/zephyr/zephyr.elf flash debug clean menuconfig all clean-all test
1212

1313
$(BUILD)/zephyr-cp/zephyr/zephyr.elf:
1414
python cptools/pre_zephyr_build_prep.py $(BOARD)
@@ -31,3 +31,14 @@ menuconfig:
3131

3232
clean:
3333
rm -rf $(BUILD)
34+
35+
# Build all boards. The + prefix allows jobserver file descriptors to be passed through.
36+
# This enables parallel builds across all boards when invoked with `make -jN all`.
37+
all:
38+
+python cptools/build_all_boards.py --continue-on-error
39+
40+
clean-all:
41+
rm -rf build build-*
42+
43+
test:
44+
pytest cptools/tests

0 commit comments

Comments
 (0)