Commit Graph

854 Commits

Author SHA1 Message Date
hathach b432cf6201
fix rp2040 with new shared irq usb handler 2023-03-13 22:46:27 +07:00
Dan Halbert 7f10f36dfb usbh_control.c no longer exists 2023-03-09 23:18:58 -05:00
Dan Halbert 21305e3e1c
Merge pull request #7694 from DavePutz/issue_7054
Fix for issue #7054 by avoiding recursive calls to websocket_background.
2023-03-09 11:02:15 -05:00
root 59f56a438a Fix for issue #7054 by avoiding recursive calls to websocket_background. 2023-03-08 13:09:45 -06:00
Scott Shawcroft de5f58a61d
Merge branch 'main' into banglejs2 2023-02-21 12:04:28 -08:00
Dan Halbert bbadc00599
Merge pull request #7577 from dhalbert/safemode-py
Implement safemode.py
2023-02-16 14:15:20 -05:00
Scott Shawcroft 931c7c1c51
Add Bangle.js 2, JDI memory displays and ACeP epd
This 2-in-1 PR started with the goal of support the Bangle.js 2
smartwatch with *no USB*.
* Adds "secure" DFU build support with a committed private key.
* Adds 3-bit color support with one dummy bit for the JDI memory display
* Allows nrf boards to have a board_background_task() run in RUN_BACKGROUND_TASK.
  This is needed because the Bangle.js 2 uses the watchdog to reset.
* Renamed port_background_task() to port_background_tick() to indicate it
  runs on tick, not RUN_BACKGROUND_TASK.
* Marks serial connected when the display terminal is inited. This means
  that safe mode messages show up on the display.

ACep, 7-color epaper displays also pack 3 bits in 4. So, I added that
support as well.
* Adds 3-bit ACeP color support for 7-color e-paper displays. (Not
  watch related but similar due to color depth.)
* Allows a refresh sequence instead of a single int command. The 7" ACeP
  display requires a data byte for refresh.
* Adds optional delay after resetting the display. The ACeP displays
  need this. (Probably to load LUTs from flash.)
* Adds a cleaning phase for ACeP displays before the real refresh.

For both:
* Add dither support to Palette.
* Palette no longer converts colors when set. Instead, it caches
  converted colors at each index.
* ColorConverter now caches the last converted color. It should make
  conversions faster for repeated colors (not dithering.)
2023-02-15 15:03:40 -08:00
Jeff Epler 73840f840d Improve boot_out.txt truncation
* write any partial message
 * instead of "..." show a sensible (translatable) message

This does slightly lower the amount of data that can be printed,
and makes the exact amount dependent on the language. However, if boot.py
intentionally needs to produce larger amounts of output, it can
deliberately mount the filesystem in RW mode and perform any writes needed.
In that case it's up to the boot.py to choose an appropriate way to
limit the number of writes if needed for the application.
2023-02-14 10:47:06 -06:00
Dan Halbert d46d9d5c21 shorten safe mode messages; improve message printing; fix CIRCUITPY_SAFEMODE_PY=0 2023-02-13 21:29:57 -05:00
Dan Halbert d8231f1588 Implement safemode.py 2023-02-13 18:26:38 -05:00
Neradoc f0058774d0 add CIRCUITPY_SKIP_SAFE_MODE_WAIT to circuitpy_mpconfig.mk
use #if (also a CIRCUITPY_ULAB)
2023-01-29 00:56:16 +01:00
Scott Shawcroft dca66eb98c
Watch for ctrl-c over BLE workflow serial
Before this, it was impossible to interrupt a running program over
BLE.
2023-01-18 16:28:35 -08:00
Scott Shawcroft 5c517b7e5a
Handle MDNS deinited better. 2023-01-12 11:24:20 -08:00
Scott Shawcroft ca80f30348
Share the web workflow MDNS object with the user
Fixes #7369
2023-01-11 16:05:19 -08:00
Jeff Epler e817563ca0
Update cyw43-driver, fix no-password wifi
Now, open wifi works on Pico W, so this closes #7438.

For the web workflow it's now OK to either
 * specify an empty password string (as before)
 * not have the CIRCUITPY_WIFI_PASSWORD key at all (new functionality)
2023-01-10 15:07:17 -06:00
Dan Halbert c0c02d0e04
Merge pull request #7371 from PontusO/main
Initializing external flash SPI speed to SPI_FLASH_MAX_BAUDRATE, instead of using driver default speed (32MHz), before probing JEDEC identifier.
2023-01-04 12:29:45 -05:00
Jeff Epler 3d66ed27ce
oofatfs: enable use of random volume IDs
This may help address #7409 if the underlying cause is the deterministic
volume ID. However, not all boards have working urandom (samd21
at least does not) so a couple of fallbacks are attempted when it fails.

I verified that on a pico_w, each `storage.erase_filesystem()` gives
a distinct 32-bit volume ID (pico_w's urandom can never fail)
2023-01-03 17:18:29 -06:00
Pontus Oldberg 14417a21d1
Merge branch 'adafruit:main' into main 2023-01-03 09:31:49 +01:00
Dan Halbert cc92ce4820 Use memory fence when disabling cache to avoid -O2 problems 2022-12-29 19:49:40 -05:00
Pontus Oldberg 9f266c361b Initializing external flash SPI speed to SPI_FLASH_MAX_BAUDRATE, instead of using driver default speed (32MHz), before probing JEDEC identifier. 2022-12-21 16:33:06 +01:00
Scott Shawcroft f8ac1d9261
Rework the coproc API
It is now a generic `memorymap` API and an ESP specific `espulp` module.

Fixes #7218. Fixes #3234. Fixes #7300.
2022-12-19 14:08:38 -05:00
Jeff Epler 808161eaab
fix missing sentinel in call 2022-12-12 19:09:57 -06:00
Jeff Epler 3620d14542
Pass string length when enabling radio 2022-12-12 17:04:03 -06:00
Jeff Epler 1b15985783
Fix web workflow builds 2022-12-12 09:20:56 -06:00
Jeff Epler 44f15d563d
Rename "environ" errors to "getenv" errors 2022-12-09 14:14:53 -06:00
Jeff Epler 3a92c079fc
Finish renaming os_environ_get_key to os_getenv
.. for consistency.
2022-12-09 14:07:23 -06:00
Jeff Epler 3459fe322b
Withdraw the _environ module
This existed solely for testing, so expose it a different way during
the unix coverage build

Also turn off os.getenv support on samd21.
2022-12-08 15:33:10 -06:00
Jeff Epler 47339d4248
make a settings.toml file on boards that support the feature 2022-12-08 12:56:24 -06:00
Jeff Epler ef2bfdb5db
dotenv becomes settings.toml 2022-12-08 12:44:20 -06:00
Scott Shawcroft b354cec8cb
Three small ESP web workflow fixes
* Set nonblock on all accepted sockets. Not just ones for user code.
* Close an open websocket if another is accepted.
* Set debug level to INFO rather than DEBUG because DEBUG crashes
  on ESP32-S3 USB OTG.
2022-12-06 11:49:04 -08:00
Jeff Epler 9c6c25ae57
Merge pull request #7286 from tannewt/fix_web_workflow_write
Fix writing files from web workflow
2022-12-01 08:30:47 -06:00
Scott Shawcroft 65e913ecd6
Fix writing files from web workflow
Pico W changes assumed that f_write could handle a NULL fourth
argument. It can't.
2022-11-30 14:22:46 -08:00
Jeff Epler fb66a6bfe5
Don't use "offset" as an identifier 2022-11-30 14:39:54 -06:00
Jeff Epler d16c9515b7
Compact the characters of certain translations, so they fit in uint8_t
This saves a few hundred bytes on the affected translations, such
as `el` which shrunk from 186152 to 185588 bytes (564 bytes saved).
2022-11-30 14:39:53 -06:00
Scott Shawcroft c13ca95da1
Add MDNS support to Pico W
This adds both cpy-MAC.local and circuitpython.local support.

Fixes #7214
2022-11-28 16:15:28 -08:00
Scott Shawcroft ad2d190507
Merge pull request #7247 from tannewt/picow_web_workflow
Enable* web workflow for Pico W
2022-11-28 14:19:42 -08:00
Scott Shawcroft c3a96a63c0
Enable* web workflow for Pico W
* Except for circuitpython.local which depends on MDNS and will be
done in a follow up PR.

Progress on #7214
2022-11-21 16:24:05 -08:00
Dan Halbert 0f6c708cb1
Merge pull request #7227 from jepler/serial-break-is-interrupt
Allow serial "break" to trigger KeyboardInterrupt
2022-11-18 19:26:17 -05:00
Jeff Epler afca4cef6d
This code can only be active if USB CDC is enabled. 2022-11-18 16:05:46 -06:00
Jeff Epler 406e46f46b
Allow serial "break" to trigger KeyboardInterrupt
When the USB serial buffer is full, the Ctrl-C code to send
KeyboardInterrupt can't be sent, which creates a problem if you've
pasted code or otherwise filled the buffer and need to recover.
A similar problem affects advanced UIs that interact with CircuitPython
and may send characters when they're unexpected, such as mu when it
tries to move the cursor based on the user clicking on the screen.

The main way forward seems to be to use some kind of message that can
still reach CircuitPython when its internal serial recieve buffer is full.
RS232 defines a "break" signal, in which the transmitting device holds its
data line in the "space" state for many entire character times. This still
exists in the world of USB serial.

This does work, sort of, except that your host computer software will need
to properly handle blocking serial writes; tio can send a break with
the **ctrl-c b** sequence, but this only works if it hasn't yet written
too much data, so it doesn't actually help in most situations :-/
2022-11-18 14:35:06 -06:00
MicroDev dd01fc97e5
Merge pull request #7223 from jepler/issue7222
supervisor_start_terminal: don't crash if display is tiny
2022-11-18 09:34:26 +05:30
Jeff Epler b0d0fcbabc
supervisor_start_terminal: don't crash if display is tiny
Closes: #7222
2022-11-17 12:03:33 -06:00
Scott Shawcroft 93ee54a2fb
Fix PWM status LED never_reset
It doesn't need never reset because the status LED is only active
when user code isn't.

This also fixes PWM never reset on espressif so that deinit will
undo it.

Fixes #6223
2022-11-15 16:14:31 -08:00
Matthew McGowan ad9db01f5f Implements PDMIn for STM32L4 using the SAI peripheral and decimation/filtering in software. 2022-11-04 17:27:08 -07:00
Neradoc 8f82db5b22 define out the safe mode message if none 2022-10-30 03:55:59 +01:00
Neradoc 0aa41fa92e change BOARD_USER_SAFE_MODE_ACTION into a separate sentence 2022-10-30 01:55:42 +02:00
Dan Halbert 7e4b2a09eb
Merge pull request #7000 from MicroDev1/storage-extend
Add Storage Extension Support
2022-10-13 10:05:55 -04:00
Dan Halbert 844cd17f03 delay first serial write by 50ms 2022-10-11 23:02:14 -04:00
microDev b0ef35d50b
update storage extension implementation 2022-10-06 09:19:56 +05:30
Dan Halbert 1c2d2c9be4
Merge pull request #6980 from MicroDev1/supervisor
Implement certain supervisor functions as properties
2022-10-04 08:54:11 -04:00