Commit Graph

546 Commits

Author SHA1 Message Date
Scott Shawcroft
3940878695
Shrink builds and handle 0-length writes 2021-07-01 12:49:11 -07:00
Scott Shawcroft
f2ef586331
clean up 2021-06-29 11:54:15 -07:00
Scott Shawcroft
b36858daa0
Fix advertisement 2021-06-25 16:40:23 -07:00
Scott Shawcroft
3177973843
Add BLE serial service 2021-06-25 15:00:10 -07:00
Scott Shawcroft
d67fb852a1
Merge pull request #3454 from cwalther/setnextcode
Add supervisor.set_next_code_file()
2021-06-25 11:00:53 -07:00
Scott Shawcroft
dc76306cfa
Enable a BLE workflow
nRF CircuitPython boards will now provide the file transfer
service defined here: https://github.com/adafruit/Adafruit_CircuitPython_BLE_File_Transfer

USB capable boards will only advertise if previously bonded to a
device or if the reset button is pressed during the fast blue
flashes on start up. When pressed, the board will restart again but
the blue period will not flash.

Boards without USB will always advertise.

When previously bonded, the advertisement is private so that no
other peers can connect. If advertising publicly, the tx power is
lowered to reduce the likelihood of bonding from a distance.

This PR also fixes issues with loading identities of bonded peers
so that our address can now be resolved and we can resolve others'
addresses when scanning.
2021-06-24 12:59:14 -07:00
Scott Shawcroft
b81573d439
Merge pull request #4891 from dhalbert/keypad-scanning-events
keypad: support for vector and matrix key scanning
2021-06-24 10:25:21 -07:00
Scott Shawcroft
a7e353b80e
Merge pull request #4897 from jepler/merge-1.16
Merge 1.16
2021-06-23 10:15:10 -07:00
Dan Halbert
ed41acd879 merge from upstream to fix translations 2021-06-21 08:26:44 -04:00
Lucian Copeland
626e4e9748 Fix missed precommit formatting 2021-06-20 17:00:56 -04:00
Lucian Copeland
cf9741bd3a Merge remote-tracking branch 'upstream/main' into setnextcode 2021-06-20 15:25:37 -04:00
Jeff Epler
e1d7e46e88 fix keyboard interrupt 2021-06-18 11:15:51 -05:00
Dan Halbert
f97e0ec631 fix ulab commit 2021-06-15 11:51:28 -04:00
Dan Halbert
32eec85230 compiles 2021-06-14 20:54:43 -04:00
Jeff Epler
1d03ec12b5 supervisor: Fix assertion error in supervisor_move_memory
It was possible for _only_ a low allocation to be performed.
In this case, `high_head` is NULL, and the comparison
`MP_STATE_VM(first_embedded_allocation) < high_head` would fail.

Closes: #4871
2021-06-10 11:10:27 -05:00
Dan Halbert
95cbf3faa5 handle CIRCUITPY_USB_CDC = 0 properly (fix simmel build) 2021-06-02 15:27:20 -04:00
Dan Halbert
3930440bc5 Fix usb_cdc.enable(console=False, data=True) 2021-06-02 11:29:56 -04:00
Jeff Epler
b0dd0e344c
Merge pull request #4772 from EmergReanimator/atmel-samd
[resolves #4771] DEBUG UART supported on ATMSAME5x
2021-05-28 20:05:06 -06:00
Scott Shawcroft
20946d97a1
Merge pull request #4743 from tannewt/simplify_status_led
Simplify the status LED to save power
2021-05-21 10:55:11 -07:00
Neradoc
a8b6232402 don't print out "hard crash" when USER_SAFE_MODE demanded 2021-05-20 21:23:25 +02:00
Scott Shawcroft
5643355e90
Merge remote-tracking branch 'adafruit/main' into simplify_status_led 2021-05-20 08:35:15 -07:00
Scott Shawcroft
499a4388cf
Handle inverted neopixel power 2021-05-19 17:29:02 -07:00
Scott Shawcroft
642fbcf87a
Handle status led power
This no longer turns on status LED power before running user code.
Therefore, use of the status LED on some boards will also have to
enable the power.
2021-05-19 10:57:14 -07:00
Scott Shawcroft
9dabe882f1
Fix safe mode on rp2040 2021-05-19 10:18:43 -07:00
EmergReanimator
2b64b1d335 [resolves #4771] DEBUG UART supported on ATMSAME5x 2021-05-17 21:22:24 +02:00
Dan Halbert
fa6c06fb38 count in/out endpoints; allow more usb modules on low-endpoint boards 2021-05-13 21:59:02 -04:00
Scott Shawcroft
1a0b4193b7
Simplify the status LED to save power
This also removes the need to pin share because we don't use the
status LED while user code is running.

The status flashes fallback to the HW_STATUS LED if no RGB LED is
present. Each status has a unique blink pattern as well.

One caveat is the REPL state. In order to not pin share, we set the
RGB color once. PWM and single color will be shutoff immediately but
DotStars and NeoPixels will hold the color until the user overrides
it.

Fixes #4133
2021-05-13 14:41:20 -07:00
Dan Halbert
0651ef17dd Fix endpoint checking; Clean up safe mode printing. 2021-05-12 15:53:52 -04:00
Scott Shawcroft
4eb4f14840
Merge pull request #4734 from dhalbert/dynamic-usb-fixes
fix HID; fix interface name table creation
2021-05-10 12:55:29 -07:00
Dan Halbert
f504af3127 fix HID; fix interface name table creation 2021-05-09 00:42:45 -04:00
Jeff Epler
aca9d5bc40 Fix up all natmod examples
* modframebuf: _mp_framebuf_p_t is not "really" a protocol, but the
   QSTR assignment caused problems when building as a dynamic module
 * modure: str_index_to_ptr is not in the natmod API, disable URE match
   spans when dynamic.  mp_obj_len() is a bugfix, we should throw here
   if the object is not string-like
 * moduzlib: Correct paths to uzlib headers & sources.  this relative
   path (from moduzlib.c to the referenced file) works in all cases,
   the other only worked from ports/PORTNAME.
 * dynruntime: Handle 2-arg m_malloc, assert_native_inited, add a
   micropythonish mp_arg_check_num_mp, fix mp_raise_msg to use dumb
   strings, add mp_raise_arg1
 * nativeglue: ad assert_native_inited
 * translate: MP_ERROR_TEXT evaluates to its argument for DYNRUNTIME
 * mpy-tool: A straggling magic number change
 * mpy_ld: Have to renumber manually after dynruntime change
 * import_mpy_native_gc.py: Update copy of features0 baked into this test
2021-05-08 20:17:16 -05:00
Scott Shawcroft
42f4065c8a
Merge remote-tracking branch 'adafruit/main' into merge_1.13 2021-05-06 11:17:53 -07:00
Dan Halbert
ebf9dcb47a
Merge pull request #4689 from dhalbert/dynamic-usb-descriptors
Dynamic USB descriptors
2021-05-06 13:51:38 -04:00
Scott Shawcroft
3fda0c0a1b
Fix board builds and use MP_ERROR_TEXT in py and extmod 2021-05-05 17:51:52 -07:00
Dan Halbert
579cdf30f1 fix more build errors 2021-05-05 16:49:29 -04:00
Dan Halbert
fc8e1c4c2e address review comments 2021-05-05 12:35:12 -04:00
Scott Shawcroft
f0bb26d70f
Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
Lucian Copeland
17ee507f09 Remove overwrite of run_reason in main
When `reload_requested` is detected, the run reason will no longer be
automatically overwritten as an AUTO_RELOAD, making SUPERVISOR_RELOAD a
detectable reload reason. Autoreload now sets the reload reason itself.
2021-05-04 17:04:24 -04:00
Dan Halbert
adc3d7d55e update Python API according to review comments 2021-05-03 22:29:02 -04:00
Dan Halbert
3e2236be8e missed an uncrustify 2021-05-03 20:59:50 -04:00
Dan Halbert
d2b558993e merge from main, including MicroPython 1.12 merge 2021-05-03 20:56:04 -04:00
Scott Shawcroft
b35fa44c8a
Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
Artyom Skrobov
9a5fb44c76 workflow_active was never defined or used
`supervisor_workflow_active` needs to be stubbed for when there's no USB
2021-05-01 13:34:28 -04:00
Jeff Epler
dfa7c3d32d codeformat: Fix handling of **
After discussing with danh, I noticed that `a/**/b` would not match `a/b`.

After correcting this and re-running "pre-commit run --all", additional
files were reindented, including the codeformat script itself.
2021-04-30 15:30:13 -05:00
Jeff Epler
e95e921ca1 codeformat: Fix filename matching
In #4683, tannewt noticed that uncrustify was not running on some
file in common-hal.

I investigated and found that it was not being run on a bunch of paths.

Rather than make incremental changes, I rewrote list_files to work
bsaed on regular expressions; these regular expressions are created from
the same git-style glob patterns.

I spot-checked some specific filenames after this change, and all looks good:

```
$ python3 tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py  ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup extmod/virtpin.c ports/raspberrypi/background.h ports/raspberrypi/common-hal/pulseio/PulseIn.c
black --fast --line-length=99 -v tests/thread/thread_exit1.py
```
recursiveloop and int_small are excluded, while PulseIn, virtpin,
and background are included.

Testing running from a subdirectory (not _specifically_ supported though):
```
(cd ports && python3 ../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c)
../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup ../extmod/virtpin.c raspberrypi/common-hal/pulseio/PulseIn.
```

As a side-effect, a bunch more files are re-formatted now. :-P
2021-04-30 10:48:08 -05:00
Dan Halbert
be7b2b00a8 uncrustify with newer version of uncrustify 2021-04-30 10:40:12 -04:00
Dan Halbert
71a8cadb09 working! 2021-04-29 22:26:38 -04:00
Dan Halbert
abfb020d41 MSC, CDC, HID keyboard definitely working 2021-04-29 17:41:43 -04:00
Dan Halbert
f06d54524d merge from adafruit 2021-04-28 23:48:26 -04:00
Dan Halbert
587aedd14f rework storage allocation 2021-04-28 13:00:44 -04:00