Skip to content

Commit b56c16c

Browse files
authored
Merge pull request #1 from adafruit/main
update to most recent master
2 parents 4167778 + a05aab8 commit b56c16c

File tree

1,974 files changed

+42058
-27295
lines changed

Some content is hidden

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

1,974 files changed

+42058
-27295
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+56
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

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

+10-3
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ jobs:
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";
@@ -178,6 +177,7 @@ jobs:
178177
- "ADM_B_NRF52840_1"
179178
- "TG-Watch"
180179
- "adafruit_feather_rp2040"
180+
- "adafruit_itsybitsy_rp2040"
181181
- "aloriumtech_evo_m51"
182182
- "aramcon_badge_2019"
183183
- "arduino_mkr1300"
@@ -303,6 +303,7 @@ jobs:
303303
- "raspberry_pi_pico"
304304
- "raytac_mdbt50q-db-40"
305305
- "robohatmm1_m4"
306+
- "rotary_trinkey_m0"
306307
- "sam32"
307308
- "same54_xplained"
308309
- "seeeduino_wio_terminal"
@@ -313,13 +314,16 @@ jobs:
313314
- "simmel"
314315
- "snekboard"
315316
- "sparkfun_lumidrive"
317+
- "sparkfun_nrf52840_micromod"
316318
- "sparkfun_nrf52840_mini"
319+
- "sparkfun_pro_micro_rp2040"
317320
- "sparkfun_qwiic_micro_no_flash"
318321
- "sparkfun_qwiic_micro_with_flash"
319322
- "sparkfun_redboard_turbo"
320323
- "sparkfun_samd21_dev"
321324
- "sparkfun_samd21_mini"
322325
- "sparkfun_samd51_thing_plus"
326+
- "sparkfun_thing_plus_rp2040"
323327
- "spresense"
324328
- "stackrduino_m0_pro"
325329
- "stm32f411ce_blackpill"
@@ -443,12 +447,15 @@ jobs:
443447
board:
444448
- "adafruit_feather_esp32s2_nopsram"
445449
- "adafruit_feather_esp32s2_tftback_nopsram"
450+
- "adafruit_funhouse"
446451
- "adafruit_magtag_2.9_grayscale"
447452
- "adafruit_metro_esp32s2"
448453
- "electroniccats_bastwifi"
449454
- "espressif_kaluga_1"
450455
- "espressif_saola_1_wroom"
451456
- "espressif_saola_1_wrover"
457+
- "franzininho_wifi_wroom"
458+
- "franzininho_wifi_wrover"
452459
- "lilygo_ttgo_t8_s2_st7789"
453460
- "microdev_micro_s2"
454461
- "muselab_nanoesp32_s2"
@@ -475,7 +482,7 @@ jobs:
475482
id: idf-cache
476483
with:
477484
path: ${{ github.workspace }}/.idf_tools
478-
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
479486
- name: Clone IDF submodules
480487
run: |
481488
(cd $IDF_PATH && git submodule update --init)

.github/workflows/pre-commit.yml

+5-3
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 polib
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

+3
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,6 @@ TAGS
8686
####################
8787
.venv
8888
.env
89+
90+
# Uncrustify formatting
91+
*.uncrustify

.pre-commit-config.yaml

+13
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

+20
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

+8-5
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

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
# directories to ignore when looking for source files.
151151
exclude_patterns = ["**/build*",
152152
".git",
153+
".github",
153154
".env",
154155
".venv",
155156
".direnv",

0 commit comments

Comments
 (0)