Skip to content

Commit d35a307

Browse files
committed
Merge branch 'sleep-api-update' into stm-alarm
2 parents 529fb52 + 00178ca commit d35a307

File tree

2,097 files changed

+49214
-29354
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,097 files changed

+49214
-29354
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
<!-- Thanks! for testing out CircuitPython. Now that you have got a problem...
11+
you can file a bug report for it. Feel free to modify the below format to better
12+
suit your issue. :) -->
13+
14+
**Firmware**
15+
16+
<!-- Include the version of CircuitPython you're running. You can see it in the
17+
`boot_out.txt` file, as well as in the REPL. -->
18+
19+
```python
20+
Adafruit CircuitPython 6.2.0-beta.2 on 2021-03-01; Raspberry Pi Pico with rp2040
21+
```
22+
23+
**Code/REPL**
24+
25+
<!-- Include your code that reproduces the bug here. Try to distill down to the
26+
minimum possible to reproduce. -->
27+
28+
```python
29+
import busio, bitbangio
30+
i2c = bitbangio.I2C(board.GP1, board.GP0)
31+
```
32+
33+
**Behavior**
34+
35+
<!-- What happens when you run the code above? Include any error messages. -->
36+
37+
```python
38+
Traceback (most recent call last):
39+
File "<stdin>", line 1, in <module>
40+
TimeoutError: Clock stretch too long
41+
```
42+
43+
**Description**
44+
45+
<!-- Optionally, describe the issue in more detail. Here are some examples: -->
46+
47+
- Error while using i2c...
48+
- Only happens when...
49+
- might be related to #4291...
50+
51+
**Additional Info**
52+
53+
<!-- Optionally, add any other information like hardware connection, scope output etc.
54+
If you have already done some debugging, mention it here. -->
55+
56+
Removing [this](url) line resolves the issue.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
contact_links:
2+
- name: Adafruit Forum
3+
url: https://forums.adafruit.com/
4+
about: Official Adafruit technical support forum. Good for getting help on getting a project working.
5+
- name: Adafruit Discord
6+
url: https://adafru.it/discord
7+
about: Unofficial chat with many helpful folks and normally prompt replies.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
<!-- We are always adding new features and enhancements to CircuitPython 🚀
11+
and would love ❤ to see what new challenge you have got for us... 🙂 -->

.github/workflows/build.yml

Lines changed: 37 additions & 26 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
@@ -81,6 +79,7 @@ jobs:
8179
working-directory: tests
8280
- name: Print failure info
8381
run: |
82+
shopt -s nullglob;
8483
for exp in *.exp;
8584
do testbase=$(basename $exp .exp);
8685
echo -e "\nFAILURE $testbase";
@@ -133,15 +132,6 @@ jobs:
133132
env:
134133
GITHUB_CONTEXT: ${{ toJson(github) }}
135134
run: echo "$GITHUB_CONTEXT"
136-
- name: Install dependencies
137-
run: |
138-
brew install gettext
139-
echo >>$GITHUB_PATH /usr/local/opt/gettext/bin
140-
- name: Versions
141-
run: |
142-
gcc --version
143-
python3 --version
144-
msgfmt --version
145135
- uses: actions/[email protected]
146136
with:
147137
submodules: true
@@ -151,6 +141,15 @@ jobs:
151141
run: |
152142
git describe --dirty --tags
153143
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
154153
- name: Build mpy-cross
155154
run: make -C mpy-cross -j2
156155
- uses: actions/upload-artifact@v2
@@ -178,6 +177,8 @@ jobs:
178177
- "ADM_B_NRF52840_1"
179178
- "TG-Watch"
180179
- "adafruit_feather_rp2040"
180+
- "adafruit_itsybitsy_rp2040"
181+
- "adafruit_qtpy_rp2040"
181182
- "aloriumtech_evo_m51"
182183
- "aramcon_badge_2019"
183184
- "arduino_mkr1300"
@@ -281,6 +282,9 @@ jobs:
281282
- "pewpew10"
282283
- "pewpew_m4"
283284
- "picoplanet"
285+
- "pimoroni_keybow2040"
286+
- "pimoroni_picosystem"
287+
- "pimoroni_tiny2040"
284288
- "pirkey_m0"
285289
- "pitaya_go"
286290
- "pyb_nano_v2"
@@ -296,10 +300,10 @@ jobs:
296300
- "pyruler"
297301
- "qtpy_m0"
298302
- "qtpy_m0_haxpress"
299-
- "qtpy_rp2040"
300303
- "raspberry_pi_pico"
301304
- "raytac_mdbt50q-db-40"
302305
- "robohatmm1_m4"
306+
- "rotary_trinkey_m0"
303307
- "sam32"
304308
- "same54_xplained"
305309
- "seeeduino_wio_terminal"
@@ -310,13 +314,16 @@ jobs:
310314
- "simmel"
311315
- "snekboard"
312316
- "sparkfun_lumidrive"
317+
- "sparkfun_nrf52840_micromod"
313318
- "sparkfun_nrf52840_mini"
319+
- "sparkfun_pro_micro_rp2040"
314320
- "sparkfun_qwiic_micro_no_flash"
315321
- "sparkfun_qwiic_micro_with_flash"
316322
- "sparkfun_redboard_turbo"
317323
- "sparkfun_samd21_dev"
318324
- "sparkfun_samd21_mini"
319325
- "sparkfun_samd51_thing_plus"
326+
- "sparkfun_thing_plus_rp2040"
320327
- "spresense"
321328
- "stackrduino_m0_pro"
322329
- "stm32f411ce_blackpill"
@@ -348,22 +355,22 @@ jobs:
348355
uses: actions/setup-python@v1
349356
with:
350357
python-version: 3.8
358+
- uses: actions/[email protected]
359+
with:
360+
submodules: true
361+
fetch-depth: 0
362+
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
351363
- name: Install deps
352364
run: |
353365
sudo apt-get install -y gettext
354-
pip install requests sh click setuptools awscli
366+
pip install -r requirements-dev.txt
355367
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
356368
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
357369
- name: Versions
358370
run: |
359371
gcc --version
360372
arm-none-eabi-gcc --version
361373
python3 --version
362-
- uses: actions/[email protected]
363-
with:
364-
submodules: true
365-
fetch-depth: 0
366-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
367374
- name: mpy-cross
368375
run: make -C mpy-cross -j2
369376
- name: build
@@ -397,6 +404,11 @@ jobs:
397404
uses: actions/setup-python@v1
398405
with:
399406
python-version: 3.8
407+
- uses: actions/[email protected]
408+
with:
409+
submodules: true
410+
fetch-depth: 0
411+
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
400412
- name: Install deps
401413
run: |
402414
sudo apt-get install -y gettext
@@ -408,11 +420,6 @@ jobs:
408420
gcc --version
409421
riscv64-unknown-elf-gcc --version
410422
python3 --version
411-
- uses: actions/[email protected]
412-
with:
413-
submodules: true
414-
fetch-depth: 0
415-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
416423
- name: mpy-cross
417424
run: make -C mpy-cross -j2
418425
- name: build
@@ -440,19 +447,23 @@ jobs:
440447
board:
441448
- "adafruit_feather_esp32s2_nopsram"
442449
- "adafruit_feather_esp32s2_tftback_nopsram"
450+
- "adafruit_funhouse"
443451
- "adafruit_magtag_2.9_grayscale"
444452
- "adafruit_metro_esp32s2"
445453
- "electroniccats_bastwifi"
446454
- "espressif_kaluga_1"
447455
- "espressif_saola_1_wroom"
448456
- "espressif_saola_1_wrover"
457+
- "franzininho_wifi_wroom"
458+
- "franzininho_wifi_wrover"
449459
- "lilygo_ttgo_t8_s2_st7789"
450460
- "microdev_micro_s2"
451461
- "muselab_nanoesp32_s2"
452462
- "targett_module_clip_wroom"
453463
- "targett_module_clip_wrover"
454464
- "unexpectedmaker_feathers2"
455465
- "unexpectedmaker_feathers2_prerelease"
466+
- "unexpectedmaker_tinys2"
456467

457468
steps:
458469
- name: Set up Python 3.8
@@ -471,7 +482,7 @@ jobs:
471482
id: idf-cache
472483
with:
473484
path: ${{ github.workspace }}/.idf_tools
474-
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210128
485+
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210304
475486
- name: Clone IDF submodules
476487
run: |
477488
(cd $IDF_PATH && git submodule update --init)
@@ -489,7 +500,7 @@ jobs:
489500
- name: Install CircuitPython deps
490501
run: |
491502
source $IDF_PATH/export.sh
492-
pip install requests sh click setuptools awscli
503+
pip install -r requirements-dev.txt
493504
sudo apt-get install -y gettext ninja-build
494505
env:
495506
IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf

.github/workflows/create_website_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
python-version: 3.8
2323
- name: Install deps
2424
run: |
25-
pip install requests sh click
25+
pip install -r requirements-dev.txt
2626
- name: Versions
2727
run: |
2828
gcc --version

.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.

0 commit comments

Comments
 (0)