Commit Graph

565 Commits

Author SHA1 Message Date
Jeff Epler
bfea6947e5 Improve mp_printf with support for compressed strings
* The new nonstandard '%S' format takes a pointer to compressed_string_t
   and prints it

 * The new mp_cprintf and mp_vcprintf take a format string that is a
   compressed_string_t
2021-08-09 08:27:28 -05:00
Jeff Epler
d59a28db97 Compress word offset table
By storing "count of words by length", the long `wends` table can be
replaced with a short `wlencount` table.  This saves flash storage space.

Extend the range of string lengths that can be in the dictionary.
Originally it was to 2 to 9; at one point it was changed to 3 to 9.
Putting the lower bound back at 2 has a positive impact on the French
translation (a bunch of them, such as "ch", "\r\n", "%q", are used).
Increasing the maximum length gets 'mpossible', ' doit être ',
and 'CircuitPyth' at the long end.  This adds a bit of processing time
to makeqstrdata. The specific 2/11 values are again empirical based on
the French translation on the adafruit_proxlight_trinkey_m0.
2021-08-07 09:23:35 -05:00
Scott Shawcroft
e3fa6e2c35
Merge pull request #5089 from tannewt/disable_ble_workflow
Add ability to disable BLE workflow
2021-08-05 11:21:17 -07:00
Dan Halbert
81833035fc raytac_mdbt50q-rx 2021-08-04 15:47:19 -04:00
Scott Shawcroft
713c8e7b3f
Fix builds without the ble workflow 2021-08-03 14:36:41 -07:00
Scott Shawcroft
1e225610cc
Add ability to disable BLE workflow
Call `supervisor.disable_ble_workflow()` and the BLE workflow will
be disabled until the chip is reset.

This also includes a couple fixes:
1. Terminals can now be deinit by setting the tilegrid to NULL. This
  prevents using the tilegrid before display is init.
2. Fix BLE serial send amount when sending more than a single packet.

Fixes #5049
2021-08-02 18:37:19 -07:00
Dan Halbert
901a6c27c0 remove gamepad; deprecate gamepadshift 2021-07-26 22:15:09 -04:00
Scott Shawcroft
e7fe0d9a71
Fix single neopixel status boards 2021-07-23 15:42:06 -07:00
Scott Shawcroft
70cbb4eddb
Support multiple status neopixels
Use the 10 neopixels on the playgrounds for status.

Fixes #5039
2021-07-23 15:17:09 -07:00
microDev
e790ff7327
Merge pull request #5036 from tannewt/esp_oserror0
Remove OSError(0) and old network modules
2021-07-23 11:00:56 +05:30
Scott Shawcroft
beda1f7998
Merge pull request #5037 from hierophect/getprevtraceback
Add supervisor.get_previous_traceback() function.
2021-07-22 17:00:14 -07:00
Lucian Copeland
ace04ef600 Formatting fixes 2021-07-22 12:57:10 -04:00
Christian Walther
cf97793af8 Add supervisor.get_previous_traceback() function.
Useful for #1084.
2021-07-22 12:23:55 -04:00
Scott Shawcroft
f84cb94819
Remove OSError(0) and old network modules
The newer modules are `socketpool` and `ssl`.

Fixes #3924, related to #2021, closes #1880, closes #2273, closes #2274
2021-07-21 17:33:40 -07:00
Dan Halbert
ce7301527a
Merge pull request #5024 from tannewt/rp2_ble_wait
Don't blink blue on non-BLE workflow boards
2021-07-19 23:51:27 -04:00
Scott Shawcroft
f8290e746b
Don't blink blue on non-BLE workflow boards
This includes any boards that have _bleio implemented via HCI.

Fixes #4969
2021-07-19 18:40:37 -07:00
Scott Shawcroft
ca2cb9af2b
Remove MICROPY_PORT_* macros used for never reset
Now we use never_reset which is generally more correct and easier
to get right.

Fixes #5001 and fixes #4997
2021-07-15 16:20:04 -07:00
Scott Shawcroft
4d3a355f0a
Tweak blink and treat SWD reset like reset button 2021-07-14 16:45:47 -07:00
Scott Shawcroft
0fadf028ef
Create first BLE-only board, Micro:Bit v2
This fixes build issues with USB off, tweaks the README to allow
for BLE-only boards and adds the Micro:Bit v2 definition.

Fixes #4546
2021-07-14 09:55:51 -07:00
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