Skip to content

Commit 15764b4

Browse files
committed
Merge remote-tracking branch 'upstream/main' into nrf52-sleep
2 parents c8f36e6 + 11b9a5e commit 15764b4

File tree

2,028 files changed

+42296
-31151
lines changed

Some content is hidden

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

2,028 files changed

+42296
-31151
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,3 @@ TimeoutError: Clock stretch too long
5252

5353
<!-- Optionally, add any other information like hardware connection, scope output etc.
5454
If you have already done some debugging, mention it here. -->
55-
56-
Removing [this](url) line resolves the issue.

.github/workflows/build.yml

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,11 @@ jobs:
3838
sudo apt-get update
3939
sudo apt-get install -y eatmydata
4040
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra
41-
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli mypy
41+
pip install -r requirements-dev.txt
4242
- name: Versions
4343
run: |
4444
gcc --version
4545
python3 --version
46-
- name: Translations
47-
run: make check-translate
4846
- name: New boards check
4947
run: python3 -u ci_new_boards_check.py
5048
working-directory: tools
@@ -134,15 +132,6 @@ jobs:
134132
env:
135133
GITHUB_CONTEXT: ${{ toJson(github) }}
136134
run: echo "$GITHUB_CONTEXT"
137-
- name: Install dependencies
138-
run: |
139-
brew install gettext
140-
echo >>$GITHUB_PATH /usr/local/opt/gettext/bin
141-
- name: Versions
142-
run: |
143-
gcc --version
144-
python3 --version
145-
msgfmt --version
146135
- uses: actions/[email protected]
147136
with:
148137
submodules: true
@@ -152,6 +141,15 @@ jobs:
152141
run: |
153142
git describe --dirty --tags
154143
echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
144+
- name: Install dependencies
145+
run: |
146+
brew install gettext
147+
echo >>$GITHUB_PATH /usr/local/opt/gettext/bin
148+
- name: Versions
149+
run: |
150+
gcc --version
151+
python3 --version
152+
msgfmt --version
155153
- name: Build mpy-cross
156154
run: make -C mpy-cross -j2
157155
- uses: actions/upload-artifact@v2
@@ -179,6 +177,8 @@ jobs:
179177
- "ADM_B_NRF52840_1"
180178
- "TG-Watch"
181179
- "adafruit_feather_rp2040"
180+
- "adafruit_itsybitsy_rp2040"
181+
- "adafruit_qtpy_rp2040"
182182
- "aloriumtech_evo_m51"
183183
- "aramcon_badge_2019"
184184
- "arduino_mkr1300"
@@ -190,6 +190,7 @@ jobs:
190190
- "bastble"
191191
- "bdmicro_vina_d21"
192192
- "bdmicro_vina_d51"
193+
- "bdmicro_vina_d51_pcb7"
193194
- "bless_dev_board_multi_sensor"
194195
- "blm_badge"
195196
- "capablerobot_usbhub"
@@ -239,6 +240,7 @@ jobs:
239240
- "hallowing_m0_express"
240241
- "hallowing_m4_express"
241242
- "hiibot_bluefi"
243+
- "huntercat_nfc"
242244
- "ikigaisense_vita"
243245
- "imxrt1010_evk"
244246
- "imxrt1020_evk"
@@ -300,10 +302,10 @@ jobs:
300302
- "pyruler"
301303
- "qtpy_m0"
302304
- "qtpy_m0_haxpress"
303-
- "qtpy_rp2040"
304305
- "raspberry_pi_pico"
305306
- "raytac_mdbt50q-db-40"
306307
- "robohatmm1_m4"
308+
- "rotary_trinkey_m0"
307309
- "sam32"
308310
- "same54_xplained"
309311
- "seeeduino_wio_terminal"
@@ -314,13 +316,16 @@ jobs:
314316
- "simmel"
315317
- "snekboard"
316318
- "sparkfun_lumidrive"
319+
- "sparkfun_nrf52840_micromod"
317320
- "sparkfun_nrf52840_mini"
321+
- "sparkfun_pro_micro_rp2040"
318322
- "sparkfun_qwiic_micro_no_flash"
319323
- "sparkfun_qwiic_micro_with_flash"
320324
- "sparkfun_redboard_turbo"
321325
- "sparkfun_samd21_dev"
322326
- "sparkfun_samd21_mini"
323327
- "sparkfun_samd51_thing_plus"
328+
- "sparkfun_thing_plus_rp2040"
324329
- "spresense"
325330
- "stackrduino_m0_pro"
326331
- "stm32f411ce_blackpill"
@@ -352,22 +357,22 @@ jobs:
352357
uses: actions/setup-python@v1
353358
with:
354359
python-version: 3.8
360+
- uses: actions/[email protected]
361+
with:
362+
submodules: true
363+
fetch-depth: 0
364+
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
355365
- name: Install deps
356366
run: |
357367
sudo apt-get install -y gettext
358-
pip install requests sh click setuptools awscli
368+
pip install -r requirements-dev.txt
359369
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
360370
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
361371
- name: Versions
362372
run: |
363373
gcc --version
364374
arm-none-eabi-gcc --version
365375
python3 --version
366-
- uses: actions/[email protected]
367-
with:
368-
submodules: true
369-
fetch-depth: 0
370-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
371376
- name: mpy-cross
372377
run: make -C mpy-cross -j2
373378
- name: build
@@ -401,6 +406,11 @@ jobs:
401406
uses: actions/setup-python@v1
402407
with:
403408
python-version: 3.8
409+
- uses: actions/[email protected]
410+
with:
411+
submodules: true
412+
fetch-depth: 0
413+
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
404414
- name: Install deps
405415
run: |
406416
sudo apt-get install -y gettext
@@ -412,11 +422,6 @@ jobs:
412422
gcc --version
413423
riscv64-unknown-elf-gcc --version
414424
python3 --version
415-
- uses: actions/[email protected]
416-
with:
417-
submodules: true
418-
fetch-depth: 0
419-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
420425
- name: mpy-cross
421426
run: make -C mpy-cross -j2
422427
- name: build
@@ -444,12 +449,16 @@ jobs:
444449
board:
445450
- "adafruit_feather_esp32s2_nopsram"
446451
- "adafruit_feather_esp32s2_tftback_nopsram"
452+
- "adafruit_funhouse"
447453
- "adafruit_magtag_2.9_grayscale"
448454
- "adafruit_metro_esp32s2"
455+
- "artisense_rd00"
449456
- "electroniccats_bastwifi"
450457
- "espressif_kaluga_1"
451458
- "espressif_saola_1_wroom"
452459
- "espressif_saola_1_wrover"
460+
- "franzininho_wifi_wroom"
461+
- "franzininho_wifi_wrover"
453462
- "lilygo_ttgo_t8_s2_st7789"
454463
- "microdev_micro_s2"
455464
- "muselab_nanoesp32_s2"
@@ -494,7 +503,7 @@ jobs:
494503
- name: Install CircuitPython deps
495504
run: |
496505
source $IDF_PATH/export.sh
497-
pip install requests sh click setuptools awscli
506+
pip install -r requirements-dev.txt
498507
sudo apt-get install -y gettext ninja-build
499508
env:
500509
IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf

.github/workflows/create_website_pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ jobs:
1616
env:
1717
GITHUB_CONTEXT: ${{ toJson(github) }}
1818
run: echo "$GITHUB_CONTEXT"
19+
- uses: actions/[email protected]
20+
with:
21+
submodules: true
22+
fetch-depth: 0
1923
- name: Set up Python 3.8
2024
uses: actions/setup-python@v1
2125
with:
2226
python-version: 3.8
2327
- name: Install deps
2428
run: |
25-
pip install requests sh click
29+
pip install -r requirements-dev.txt
2630
- name: Versions
2731
run: |
2832
gcc --version
2933
python3 --version
30-
- uses: actions/[email protected]
31-
with:
32-
submodules: true
33-
fetch-depth: 0
3434
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
3535
- name: CircuitPython version
3636
run: git describe --dirty --tags

.github/workflows/pre-commit.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ name: pre-commit
77
on:
88
pull_request:
99
push:
10-
branches: [main]
1110

1211
jobs:
1312
pre-commit:
@@ -16,10 +15,13 @@ jobs:
1615
- uses: actions/checkout@v1
1716
- uses: actions/setup-python@v1
1817
- name: Install deps
19-
run: sudo apt-get update && sudo apt-get install -y gettext
18+
run: |
19+
sudo apt-add-repository -y -u ppa:pybricks/ppa
20+
sudo apt-get install -y black gettext uncrustify
21+
pip3 install -r requirements-dev.txt
2022
- name: Populate selected submodules
2123
run: git submodule update --init extmod/ulab
22-
- name: set PY
24+
- name: Set PY
2325
run: echo >>$GITHUB_ENV PY="$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
2426
- uses: actions/cache@v2
2527
with:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,6 @@ TAGS
8686
####################
8787
.venv
8888
.env
89+
90+
# Uncrustify formatting
91+
*.uncrustify

.gitmodules

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,8 @@
173173
url = https://github.com/adafruit/Adafruit_CircuitPython_LC709203F
174174
[submodule "ports/raspberrypi/sdk"]
175175
path = ports/raspberrypi/sdk
176-
url = https://github.com/raspberrypi/pico-sdk.git
176+
url = https://github.com/adafruit/pico-sdk.git
177+
[submodule "data/nvm.toml"]
178+
path = data/nvm.toml
179+
url = https://github.com/adafruit/nvm.toml.git
180+
branch = main

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,16 @@ repos:
1111
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/esp32s2/esp-idf-config/.*|ports/esp32s2/boards/.*/sdkconfig)'
1212
- id: trailing-whitespace
1313
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)'
14+
- repo: local
15+
hooks:
16+
- id: translations
17+
name: Translations
18+
entry: sh -c "if ! make check-translate; then make translate; fi"
19+
types: [c]
20+
pass_filenames: false
21+
language: system
22+
- id: formatting
23+
name: Formatting
24+
entry: python3 tools/codeformat.py
25+
types_or: [c, python]
26+
language: system

BUILDING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,23 @@ Example:
8585

8686
If your port/build includes `arm-none-eabi-gdb-py`, consider using it instead, as it can be used for better register
8787
debugging with https://github.com/bnahill/PyCortexMDebug
88+
89+
# Code Quality Checks
90+
91+
We apply code quality checks using pre-commit. Install pre-commit once per system with
92+
93+
python3 -mpip install pre-commit
94+
95+
Activate it once per git clone with
96+
97+
pre-commit --install
98+
99+
Pre-commit also requires some additional programs to be installed through your package manager:
100+
101+
* Standard Unix tools such as make, find, etc
102+
* The gettext package, any modern version
103+
* uncrustify version 0.71 (0.72 is also tested)
104+
105+
Each time you create a git commit, the pre-commit quality checks will be run. You can also run them e.g., with `pre-commit run foo.c` or `pre-commit run --all` to run on all files whether modified or not.
106+
107+
Some pre-commit quality checks require your active attention to resolve, others (such as the formatting checks of uncrustify) are made automatically and must simply be incorporated into your code changes by committing them.

README.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ Specifically useful documentation when starting out:
5151
- `CircuitPython Essentials <https://learn.adafruit.com/circuitpython-essentials>`__
5252
- `Example Code <https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/master/CircuitPython_Essentials>`__
5353

54+
Code Search
55+
------------
56+
GitHub doesn't currently support code search on forks. Therefore, CircuitPython doesn't have code search through GitHub because it is a fork of MicroPython. Luckily, `SourceGraph <https://sourcegraph.com/github.com/adafruit/circuitpython>`_ has free code search for public repos like CircuitPython. So, visit `sourcegraph.com/github.com/adafruit/circuitpython <https://sourcegraph.com/github.com/adafruit/circuitpython>`_ to search the CircuitPython codebase online.
57+
5458
Contributing
5559
------------
5660

@@ -113,10 +117,9 @@ Behavior
113117
- ``code.py`` (or ``main.py``) is run after every reload until it
114118
finishes or is interrupted. After it is done running, the vm and
115119
hardware is reinitialized. **This means you cannot read state from**
116-
``code.py`` **in the REPL anymore.** CircuitPython's goal for this
120+
``code.py`` **in the REPL anymore, as the REPL is a fresh vm.** CircuitPython's goal for this
117121
change includes reducing confusion about pins and memory being used.
118-
- After ``code.py`` the REPL can be entered by pressing any key. It no
119-
longer shares state with ``code.py`` so it is a fresh vm.
122+
- After the main code is finished the REPL can be entered by pressing any key.
120123
- Autoreload state will be maintained across reload.
121124
- Adds a safe mode that does not run user code after a hard crash or
122125
brown out. The hope is that this will make it easier to fix code that
@@ -126,8 +129,7 @@ Behavior
126129
- RGB status LED indicating CircuitPython state, and errors through a sequence of colored flashes.
127130
- Re-runs ``code.py`` or other main file after file system writes over USB mass storage. (Disable with
128131
``supervisor.disable_autoreload()``)
129-
- Entering the REPL after the main code is finished requires a key press which enters the REPL and
130-
disables autoreload.
132+
- Autoreload is disabled while the REPL is active.
131133
- Main is one of these: ``code.txt``, ``code.py``, ``main.py``,
132134
``main.txt``
133135
- Boot is one of these: ``settings.txt``, ``settings.py``, ``boot.py``,
@@ -209,6 +211,7 @@ esp32s2 beta
209211
litex alpha
210212
mimxrt10xx alpha
211213
nrf stable
214+
raspberrypi beta
212215
stm ``F4`` stable | ``others`` beta
213216
unix alpha
214217
================ ============================================================

conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
".env",
155155
".venv",
156156
".direnv",
157+
"data",
157158
"docs/autoapi",
158159
"docs/README.md",
159160
"drivers",
@@ -283,7 +284,7 @@
283284
# Add any extra paths that contain custom files (such as robots.txt or
284285
# .htaccess) here, relative to this directory. These files are copied
285286
# directly to the root of the documentation.
286-
html_extra_path = ["docs/robots.txt"]
287+
#html_extra_path = []
287288

288289
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
289290
# using the given strftime format.

0 commit comments

Comments
 (0)