Commit Graph

942 Commits

Author SHA1 Message Date
Dan Halbert dd37c81136
Merge pull request #6847 from dhalbert/status-bar-control
Allow enabling and disabling of status bar
2022-09-08 10:48:36 -04:00
Dan Halbert 4cb69a51d5 Use MP_WEAK for default board.c routines 2022-09-08 07:36:50 -04:00
Dan Halbert 2c42a48962 Clear stale exception in _exec_result; more status_bar fixups 2022-09-01 19:29:32 -04:00
Melissa LeBlanc-Williams 8be2d650c7 Add info and link for Web Workflow /code/ page 2022-09-01 12:26:33 -07:00
Dan Halbert 2fa671c0f8 avoid status bar updates immediately after hard restart 2022-08-30 22:33:29 -04:00
Dan Halbert 52080e24eb status bar control 2022-08-30 15:23:44 -04:00
Melissa LeBlanc-Williams 1ae4d881fd Allow Move/Rename to be called from localhost 2022-08-24 14:50:42 -07:00
Neradoc dfd6fa2114 add serial number to version.json, UID like in boot_out.txt 2022-08-21 04:09:44 +02:00
Scott Shawcroft 802cff2286
Fix scroll area shift with scale > 1
Fixes #6775
2022-08-19 11:20:47 -07:00
Dan Halbert 05d2013b45
Merge pull request #6778 from tannewt/fix_s2_bootloop
Guard against workflow background happening early
2022-08-18 07:18:57 -04:00
Scott Shawcroft 3e60ec3a3e
Merge pull request #6770 from tannewt/upload_folder
Add uploading a directory and its contents
2022-08-17 16:09:56 -07:00
Scott Shawcroft 704ecc34fb
Guard against workflow background happening early
Fixes #6756 because the ringbuf size is zero and the empty check
does % which leads to division by zero error.
2022-08-17 15:44:07 -07:00
Melissa LeBlanc-Williams 79628a7c41 Add offline message to web workflow /code/ page 2022-08-17 13:57:20 -07:00
Scott Shawcroft b7a2a3d724
Fix arm builds 2022-08-17 13:52:13 -07:00
Scott Shawcroft 3aa5f60cb9
Merge remote-tracking branch 'adafruit/main' into upload_folder 2022-08-17 13:15:37 -07:00
Scott Shawcroft 9a5f00a093
Remove upload button and fix mkdir parents 2022-08-17 11:31:11 -07:00
Scott Shawcroft 1287d9c22d
Merge pull request #6769 from tannewt/ww_move
Add file and directory renaming
2022-08-16 22:11:59 -07:00
Scott Shawcroft 3493be7757
Fix recursive delete, add upload labels and progress 2022-08-16 17:03:09 -07:00
Scott Shawcroft e570349034
Edit .env and ignore canceled renames 2022-08-16 16:02:55 -07:00
Scott Shawcroft 525eb711c1
Add /code/ for online editing 2022-08-16 15:44:58 -07:00
Scott Shawcroft b6e24230cf
Add uploading a directory and its contents
This only works for one top level directory at a time.
2022-08-16 14:41:10 -07:00
Scott Shawcroft 85b0be83bf
Add file and directory renaming
Internally this is done with a MOVE HTTP verb. It is modeled after
WebDAV MOVE but not exact to keep the Destination header shorter
and have more consistent response codes.

Fixes #6647
2022-08-16 13:51:40 -07:00
Scott Shawcroft 5823bcc744
Merge branch 'main' into c3_short_send 2022-08-11 12:45:02 -07:00
Scott Shawcroft f1053fb963
Introduce port_yield()
This allows the web workflow send code to yield briefly when
waiting for more room to send in a socket. Waiting for an "interrupt"
could wait forever because the select task only waits for read and
error. Adding wait on write is tricky because much of the time we
don't care if the sockets are ready to write. Using yield avoids
this trickiness.
2022-08-11 11:25:34 -07:00
Scott Shawcroft 471053c315
Merge remote-tracking branch 'adafruit/main' into c3_short_send 2022-08-11 11:12:51 -07:00
Scott Shawcroft f9d724c09e
Fix retries after successful connection.
We may have set retries to 0 to enforce a timeout but the connect
succeeded. When it succeeds, we want to allow retries later in
case we lose signal briefly. (The callback will do this too but
the connect function will override it after.)

Also, remove extra code from websocket that is leftover from
debugging.
2022-08-10 15:24:08 -07:00
Scott Shawcroft 0b098f5013
Retry send if only some bytes sent
Fixes #6654 and fixes #6689
2022-08-10 11:34:49 -07:00
Scott Shawcroft b423520eb3
Merge pull request #6693 from RetiredWizard/sort_filemanager
Add filename sort to web workflow file manager
2022-08-10 11:29:39 -07:00
Dan Halbert a1d48e9978
Merge pull request #6729 from tannewt/websocket_ctrl_c
Read websocket in background to look for ctrl-c
2022-08-10 13:16:09 -04:00
Dan Halbert 08e3133435
Merge pull request #6731 from tannewt/ww_unicode
Decode percent encoded file paths and set charset
2022-08-10 13:13:53 -04:00
RetiredWizard 0b286b7e7e
does pre-commit not like split lines? 2022-08-10 10:44:06 -04:00
Neradoc 9f4e8efd2e new icons for web workflow with actual emojis 2022-08-10 02:12:07 +02:00
Scott Shawcroft e0fb308972
Decode percent encoded file paths and set charset
Also, fix multiple file uploads from directory browser.

Fixes #6646
2022-08-09 16:36:57 -07:00
RetiredWizard c8a5149560
Sort json data rather than index of table data 2022-08-09 17:13:18 -04:00
Scott Shawcroft 51b65cbea5
Read websocket in background to look for ctrl-c
Otherwise busy Python code that isn't reading input characters
won't be interruptible.

Fixes #6707
2022-08-09 13:57:03 -07:00
Scott Shawcroft 401c269758
Request a title bar update on USB cdc connect
This ensures that the USB serial connection gets a copy of the
latest title bar.

Fixes #6703
2022-08-08 14:29:45 -07:00
RetiredWizard a87dcf201b
Don't need a variable to identify 'Path' column 2022-08-05 22:35:57 -04:00
RetiredWizard 328fe4d2ea
minor cleanup 2022-08-05 22:07:22 -04:00
RetiredWizard b7d3ee174a
Move sort from table class to async function 2022-08-05 21:49:18 -04:00
Scott Shawcroft 207311b02a
Merge branch 'main' into title_execution_status 2022-08-05 13:42:58 -07:00
Dan Halbert 8c10e09ba0
Merge pull request #6667 from jepler/esp-reserve-heap-for-idf
Add ability to reserve psram
2022-08-05 15:06:44 -04:00
Dan Halbert 7ab8a66cda
Merge pull request #6695 from tannewt/always_circuitpy
Get CIRCUITPY FATFS directly.
2022-08-05 11:51:35 -04:00
RetiredWizard ed6f9eac04
Unnecessary handler removed 2022-08-05 02:06:45 -04:00
RetiredWizard 85d959b953
A little bit more cleanup.... 2022-08-05 01:42:59 -04:00
RetiredWizard 9eb32f4dd1
Ascending sort without mouse click 2022-08-05 01:23:01 -04:00
RetiredWizard 98fbaa8ff9
Sorts ascending without mouse click 2022-08-05 00:58:57 -04:00
Scott Shawcroft 167108a91f
Fix builds with displayio but not terminalio 2022-08-04 16:34:25 -07:00
Scott Shawcroft eb7ddf52e6
Fix BLE workflow and add boot_out.txt UID
Fixes #6621
2022-08-04 16:33:10 -07:00
Scott Shawcroft 83cbbc9946
Add BLE status to title bar 2022-08-04 16:33:10 -07:00
Scott Shawcroft 3a2bcbc5c7
Enable title bar on all builds
* Tweak scroll area position so last line is complete and top is
  under the title bar.
* Pick Blinka size based on the font to minimize unused space in
  title bar. Related to #2791
* Update the title bar after terminal is started. Fixes #6078

Fixes #6668
2022-08-04 16:33:10 -07:00
Scott Shawcroft 577d53dda4
Add execution status into title bar 2022-08-04 16:33:09 -07:00
Scott Shawcroft 185d3e19ec
Switch to temporary redirect for cp.local
This prevents browsers from caching it. Thanks to MakerMelissa for
the suggestion.
2022-08-04 16:25:50 -07:00
Scott Shawcroft 125b276af0
Get CIRCUITPY FATFS directly.
Otherwise, you may actually get a non-root filesystem.

Fixes #6575
2022-08-04 16:06:27 -07:00
RetiredWizard 9e2f6dfc13
Turn off edit links when not editable 2022-08-03 17:56:43 -04:00
Jeff Epler 82be75adb5 Add ability to reserve psram
.. the primary user of which will be the camera, since the framebuffers
must be allocated via esp-idf allocation function and never from the
gc heap.

A board can have a default value, and the value can also be set in the
/.env file using the key CIRCUITPY_RESERVED_PSRAM with the value being
the reserved size in bytes.

Co-authored-by: Dan Halbert <halbert@adafruit.com>
2022-08-03 16:19:40 -05:00
RetiredWizard f3db5709c3
Add filename sort to web workflow file manager 2022-08-03 16:33:13 -04:00
Dan Halbert 291994b7d6
Merge pull request #6686 from andywarburton/main
WebWorkFlow CSS Tweaks for edit.html
2022-08-02 21:36:37 -04:00
Dan Halbert 524cc5e274
Merge pull request #6685 from tannewt/esp32_ww
Enable Web Workflow on Feather ESP32 V2
2022-08-02 21:30:23 -04:00
Andy Warburton 019fbb1cb9 Merge branch 'main' of https://github.com/andywarburton/circuitpython 2022-08-02 21:10:46 +01:00
Andy Warburton b67f3585e8 css tweaks for edit.html
added remote css support to webworkflow edit.html and moved in page css out to the external stylesheet.
2022-08-02 21:10:39 +01:00
Scott Shawcroft b38109c488
Merge pull request #6682 from andywarburton/main
added remote CSS links to web work flow
2022-08-02 11:03:42 -07:00
Scott Shawcroft f8c183bf3a
Merge pull request #6683 from Neradoc/nera-web-workflow-2
Add Authorization to Allow-Headers in web workflow
2022-08-02 11:02:30 -07:00
Neradoc 063e168810 Add Authorization to Allow-Headers in web workflow
Makes Safari happy
2022-08-02 18:40:10 +02:00
Andy Warburton 5d653772cd added version number to file name
added version number to file name
2022-08-02 16:43:40 +01:00
Andy Warburton 1448bcab6b added remote CSS links to web work flow
added remote css URL to pull additional CSS from the circuitpython.org site (apologies for the  black background - this is temporary, I'll send an update to the CP.org css *very* shortly that will undo this)
2022-08-02 16:36:20 +01:00
foamyguy da8451b7cc fix edit URL for files inside of directories 2022-08-01 21:56:11 -05:00
Scott Shawcroft 9661d3256c
Add more ESP32 boards and enable web workflow 2022-08-01 15:52:08 -07:00
Scott Shawcroft 462eb71570
Merge pull request #6611 from FoamyGuy/webflow_edit_page
Webflow edit page
2022-07-29 16:30:53 -07:00
Dan Halbert 8b2f061563
Merge pull request #6666 from tannewt/fix_web_paste
Lots of web workflow, C3 and title bar fixes
2022-07-29 17:10:46 -04:00
Scott Shawcroft 312e298890
Fix other ESP builds and arduino_nano_33_iot 2022-07-29 11:02:35 -07:00
Scott Shawcroft 51006f5eeb
Merge branch 'main' into webflow_edit_page 2022-07-29 10:03:07 -07:00
Scott Shawcroft 96e870dc77
Merge pull request #6662 from andywarburton/main
Added css support to web workflow
2022-07-29 09:42:13 -07:00
Scott Shawcroft d6344812e8
Lots of web workflow, C3 and title bar fixes
* Fixes #6221 - C3 hang on `import wifi`. Enabling the WiFi PHY was
  disabling USB. Now boards that use it set CONFIG_ESP_PHY_ENABLE_USB
  explicitly.
* Fixes #6655 - Allows pasting into the web serial page. Fixes reading
  more than 0xf bytes at a time.
* Fixes #6653 - Fixes web socket encoding of payloads >125 bytes. Can
  happen when printing a long string.
* Fixes C3 responsiveness when waiting for key to enter REPL. (It
  now correctly stops sleeping.)
* Disables title bar updates when in raw REPL. Related to #6548.
* Adds version to title bar.
2022-07-28 16:06:56 -07:00
Scott Shawcroft c4c15206e7
Merge pull request #6608 from tannewt/web_workflow_port
Allow for dynamic reconfigure including port
2022-07-28 12:59:31 -07:00
Scott Shawcroft 35797ff3f0
Remove trailing spaces 2022-07-28 12:52:41 -07:00
Scott Shawcroft b11eb12da5
Fix modified time. Use snprintf for uint64_t printing. 2022-07-28 11:00:26 -07:00
Andy Warburton ac53e7e439 further refinements 2022-07-28 16:57:02 +01:00
Scott Shawcroft babd4ee618
Tweaks based on review comments 2022-07-28 08:43:36 -07:00
Scott Shawcroft 8b6e4cc4e8
Delete trailing spaces 2022-07-28 08:18:52 -07:00
Scott Shawcroft df14f95398
Delete trailing spaces 2022-07-28 08:16:51 -07:00
Scott Shawcroft 1332bb6534
Add newline 2022-07-28 08:16:16 -07:00
Andy Warburton ccd6063284 Update welcome.html
Made html more semantic.
2022-07-28 16:08:05 +01:00
Andy Warburton 2a0e4f7ee2 added css support to web workflow
Added a bare minimum css implementation to web workflow to improve readability
2022-07-28 12:03:22 +01:00
Scott Shawcroft 931757f4a9
Improve web workflow responsiveness
1. Run the socket select task at the same priority as CP. This is
  needed because it queues up the background work. Without it, CP
  needed to sleep to let the lower priority task go.
2. Close the active socket on disconnect. This prevents looping
  over a disconnected but not closed socket.

Fixes #6610. Fixes #6613
2022-07-26 15:29:49 -07:00
Scott Shawcroft f9cc4ec61b
Fix print chunk 2022-07-26 11:51:10 -07:00
Scott Shawcroft 1a7082ff1d
Add newline for pre-commit 2022-07-26 08:37:33 -07:00
foamyguy 0ef6871a93 save with ctrl-s 2022-07-25 19:30:44 -05:00
foamyguy d0782b60cb Merge branch 'main' into webflow_edit_page
# Conflicts:
#	supervisor/shared/web_workflow/web_workflow.c
2022-07-25 19:20:05 -05:00
foamyguy a33985a73f change to basic <textarea> version 2022-07-25 19:15:43 -05:00
Scott Shawcroft f4927dd2d6
Use mp_printf instead of snprintf 2022-07-25 16:58:54 -07:00
Scott Shawcroft 6d6234443d
Merge remote-tracking branch 'adafruit/main' into web_workflow_port 2022-07-25 15:57:58 -07:00
Neradoc 09915ab0b9 compare all static ok hosts with port, add 127.0.0.1 and localhost to it
use strncmp rather than memcmp, one of the strings coul be smaller than the other
2022-07-24 15:15:10 +02:00
Neradoc 6575598ae6 HTTP headers and methods are not case sensitive
had the issue where Firefox would send "authorization" in lower case
2022-07-24 14:28:01 +02:00
Neradoc 9a6c3884a7 do options unauthenticated first, fix testing localhost 2022-07-24 14:28:01 +02:00
Neradoc 40cb0aac7c CORS preflight: allow OPTIONS without authentication
check for 127.0.0.1 without a port specified
2022-07-24 14:28:01 +02:00
foamyguy 541e448100 set the href for edit links in the directory list 2022-07-15 19:56:29 -05:00
foamyguy 584e27139e add back /edit/ handler and specify ES6 quote chars for jsmin 2022-07-15 19:49:03 -05:00
Scott Shawcroft 78b4159448
Allow for dynamic reconfigure including port 2022-07-15 16:33:12 -07:00
foamyguy a46a44db26 adding edit page 2022-07-15 16:25:57 -05:00
Scott Shawcroft e9dd254127
Add socket select task to wake CP
This fixes the web workflow on boards without a display.

Fixes #6552
2022-07-13 17:35:35 -07:00
Scott Shawcroft ac460dd1e1
Merge branch 'main' into esp32 2022-07-13 15:30:53 -07:00
Scott Shawcroft 031c124a81
Tweak serial page to work better in Chrome 2022-07-12 14:12:39 -07:00
Scott Shawcroft 15fe386457
Fix build and minify html and js 2022-07-12 11:13:17 -07:00
Scott Shawcroft 425a0efeca
A bit more cleanup 2022-07-11 14:53:20 -07:00
Scott Shawcroft 8cfdfb95f7
Remove extra logging, auth /cp/serial and add doc 2022-07-11 14:32:28 -07:00
Scott Shawcroft 557e35469f
Make serial page work ok including on mobile 2022-07-08 16:57:19 -07:00
Dan Halbert 2c7ad7a39f make translate and pre-commit formatting fixes 2022-07-08 16:53:53 -04:00
Dan Halbert c316b950c7 merge from adafruit/main 2022-07-08 15:42:19 -04:00
Dan Halbert d869b441f4 further ESP32 sdkconfig fixes; add CIRCUITPY_STATUS_BAR 2022-07-08 15:27:00 -04:00
Scott Shawcroft 8d9c995298
Support ping & close. Refine html and js for serial 2022-07-07 16:55:04 -07:00
Dan Halbert 4e88d795e1 Thonny causing crash emitglue.c:199: 2022-07-06 23:01:19 -04:00
Scott Shawcroft a4035aa1f7
websocket serial kinda works 2022-07-06 17:05:14 -07:00
Scott Shawcroft 07b2697ae3
WIP websocket to serial 2022-07-01 16:57:10 -07:00
Scott Shawcroft 7589e53fea
WIP websocket accept and hashlib 2022-07-01 10:18:33 -07:00
Dan Halbert 8bb369cac5 refactor debug UART to console UART; get working on ESP32 2022-06-30 23:16:46 -04:00
Dan Halbert 187f156ac7
Merge pull request #6534 from tannewt/esp_wdt_safe_mode
Safe mode when ESP interrupt watchdog fires
2022-06-30 22:56:35 -04:00
Scott Shawcroft a59b52bd43
Add USB warning 2022-06-30 16:54:06 -07:00
Scott Shawcroft 95d3289df6
Doc tweak and add vararg send helpers 2022-06-30 16:37:51 -07:00
Dan Halbert b0efd130c9 ESP32 REPL working through debug UART 2022-06-29 23:19:36 -04:00
Scott Shawcroft d42c811fb9
Safe mode when ESP interrupt watchdog fires
This makes us enter safe mode when sleep on the S3 fails. The
task watchdog is used for the user watchdog.
2022-06-29 12:31:18 -07:00
Scott Shawcroft 08c93ad0ce
Fix creator ID and build order 2022-06-27 14:40:38 -07:00
Scott Shawcroft d19270e318
Add docs and 404 in file PUT into non-existent dir 2022-06-27 13:39:09 -07:00
Scott Shawcroft 41039445c9
Clean up and add docs 2022-06-27 13:39:09 -07:00
Scott Shawcroft 7acc5ebeb9
Add logo for going to home. Fix origin check 2022-06-27 13:39:09 -07:00
Scott Shawcroft 3cd05291d0
Static files + welcome page 2022-06-27 13:39:09 -07:00
Scott Shawcroft 7543dd9af0
CORS works and autoreload too 2022-06-27 13:39:08 -07:00
Scott Shawcroft eeb9b7881e
Disable/enable buttons 2022-06-27 13:39:08 -07:00
Scott Shawcroft d6eaaafee8
Basic JS 2022-06-27 13:39:08 -07:00
Scott Shawcroft 964828398e
JSON directory API 2022-06-27 13:39:08 -07:00
Scott Shawcroft 847ac60dce
Fix wifi but not ble builds. Add DELETE and PUT support 2022-06-27 13:39:06 -07:00
Scott Shawcroft 92593aa7a1
Fix bind, remove hard coded ip 2022-06-27 13:34:13 -07:00
Scott Shawcroft 35045f0eab
Auth works 2022-06-27 13:34:13 -07:00
Scott Shawcroft 4f0a7aedfd
WIP adding devices.json and auth 2022-06-27 13:34:13 -07:00
Scott Shawcroft 77cecdbe2a
Turn on mdns service 2022-06-27 13:34:13 -07:00
Scott Shawcroft 32478345f8
more tweaks 2022-06-27 13:34:13 -07:00
Scott Shawcroft 0882cbf823
web server kinda works 2022-06-27 13:34:13 -07:00
Scott Shawcroft 61d0f7947b
WIP doesn't flush response before closing 2022-06-27 13:34:13 -07:00
Scott Shawcroft 301f3e0456
Start of web server 2022-06-27 13:34:13 -07:00
EmergReanimator 3c58870816 Fixes from PR feedback: Test DISABLE_FILESYSTEM after it set.
53f4eeaf8b (r899419987)
2022-06-16 21:43:07 +02:00
EmergReanimator 53f4eeaf8b Fixed build issue when DISABLE_FILESYSTEM is set. 2022-06-16 19:27:08 +02:00
Scott Shawcroft dc794f91c0
Speed up auto-wifi with wrong password
This adds basic timeout support to connect by preventing subsequent
retries if over time. The first connect may still take more than
the timeout.
2022-06-13 15:38:19 -07:00
Scott Shawcroft 6446010753
Wi-Fi autoconnect and title bar status
This adds support for CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD
in `/.env`. When both are defined, CircuitPython will attempt to
connect to the network even when user code isn't running. If the
user code attempts to a network with the same SSID, it will return
immediately. Connecting to another SSID will disconnect from the
auto-connected network. If the user code initiates the connection,
then it will be shutdown after user code exits. (Should match <8
behavior.)

This PR also reworks the default displayio terminal. It now supports
a title bar TileGrid in addition to the (newly renamed) scroll area.
The default title bar is the top row of the display and is positioned
to the right of the Blinka logo when it is enabled. The scroll area
is now below the Blinka logo.

The Wi-Fi auto-connect code now uses the title bar to show its
state including the IP address when connected. It does this through
the "standard" OSC control sequence `ESC ] 0 ; <s> ESC \` where <s>
is the title bar string. This is commonly supported by terminals
so it should work over USB and UART as well.

Related to #6174
2022-06-09 14:55:54 -07:00
Scott Shawcroft 36b4d49a78
Fix display resources build
qstrdefs.generated.h no longer includes the translated strings.
So, use the .po file directly.
2022-06-02 12:26:42 -07:00
Scott Shawcroft fd5ef009a4
Move compressed strings into own object file
This breaks the translation dependency to all of the other objects
and therefore speeds up subsequent builds. Now, even when the big
translate() function is inlined in the header, it only needs to be
optimized once.
2022-06-02 11:48:56 -07:00
Scott Shawcroft 4d776339ad
Separate translate object control from LTO 2022-05-31 12:42:59 -07:00
Scott Shawcroft 9d10a3da66
Conditionalize LTO 2022-05-27 12:59:54 -07:00
Scott Shawcroft c676253834
Switch translate() to the header file
This allows the compile stage to optimize most of the translate()
function away and saves a ton of space (~40k on ESP). *However*, it
requires us to wait for the qstr output before we compile the rest
of our .o files. (Only qstr.o used to wait.)

This isn't as good as the current setup with LTO though. Trinket M0
loses <1k with this setup.

So, we should probably conditionalize this along with LTO.
2022-05-27 10:33:53 -07:00
Dan Halbert 1fb210bd40
Merge pull request #5491 from pypewpew/remove-gamepadshift
Remove gamepadshift module
2022-05-25 13:58:06 -04:00
Radomir Dopieralski 06dd1ffbce
Update supervisor/shared/tick.c
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2022-05-25 11:18:08 +02:00
Radomir Dopieralski c0152e7dab Remove gamepadshift module
Everything should be using the keypad module instead.

Note: there are several boards that still had gamepadshift enabled. I
did not contact their authors to make sure they already switched to
keypad in their code and documentation. We should probably wait with
merging this for their go ahead.
2022-05-25 00:48:55 +02:00
Dan Halbert 309e15fc54
Merge pull request #6380 from tannewt/72_merge
Merge in BLE reload fix from 7.2.x
2022-05-11 11:53:46 -04:00
Scott Shawcroft 8d7390992a
Fix BLE autoreload
The trigger was happening when reload was suspended and therefore
ignored. Now, manage reload in one place in the file. This may
trigger reloads on BLE command error but that should be rare.

Fixes #6258
2022-05-10 12:31:40 -07:00
s-ol 0b525a285a supervisor: Add supervisor.set_usb_identification() function 2022-05-04 11:38:38 +02:00
George White 3b5171c4ff Move hook implementation to supervisor 2022-04-18 14:09:36 +00:00
George White f502703e52 Add hook to do some flash setup before filesystem init 2022-04-18 13:10:12 +00:00
EmergReanimator f7fd168396 Incorporated feedback from PR. 2022-04-04 21:47:05 +02:00
EmergReanimator 8162a5de4b Fixed code style formatting according to pre-commit rules. 2022-04-02 12:47:43 +02:00
EmergReanimator d9bf79d826 Fixed internal flash filesystem stub build issue
Internal filesystem stubs is used when both INTERNAL_FLASH_FILESYSTEM,
DISABLE_FILESYSTEM are set.
2022-04-02 12:39:16 +02:00
Dan Halbert ec5c9507b9
Merge pull request #6187 from prplz/espressif-uart-workflow-fixes
Espressif: Fix interrupts in UART workflow
2022-03-30 21:18:02 -04:00
Michael Himing 686012426d Espressif: Fix interrupts in UART workflow 2022-03-25 16:20:04 +11:00
Scott Shawcroft ee4c501936
Merge remote-tracking branch 'adafruit/main' into c3_serial_jtag 2022-03-23 12:17:02 -07:00
Scott Shawcroft f5d90fc84f
Switch to port_serial_* hooks
This makes it easier to integrate port specific serial alongside
the common approaches.
2022-03-22 19:40:33 -07:00
Scott Shawcroft 4363361c87
Board definition clean up
Removes:
* AUTORESET_DELAY_MS which never did anything but was introduced
  somehow.
* CIRCUITPY_BOOT_BUTTON in all but one ESP board because they all have
  them. There is a default based on the strapping pins.
* BOARD_USER_SAFE_MODE_ACTION because it was all the same for boards
  with boot buttons. Now the safe mode code manages the message.
2022-03-21 17:58:43 -07:00
Scott Shawcroft 6dd9db31b3
Add USB to Serial/JTAG support for REPL
Adds Adafruit QT Py C3 board that uses it. Also revamps size
check script to work for S3 and C3 as well.

Fixes #6030
2022-03-21 14:03:57 -07:00
Scott Shawcroft 51701e6abe
Merge remote-tracking branch 'adafruit/7.2.x' into merge_7.2.2 2022-03-17 14:15:55 -07:00
Dan Halbert bf1329bb1f fix ReloadException when in REPL 2022-03-16 12:36:52 -04:00
Scott Shawcroft dcc3ec171e
Merge remote-tracking branch 'adafruit/7.2.x' into merge_7.2.2 2022-03-15 13:56:11 -07:00
Scott Shawcroft 32ac396a41
Further refine autoreload
This unifies the delay into the post-run delay that also waits
for user input and fake sleep. This ensures we always delay.
Previous code would only delay if the code.py was running when
autoreload was triggered. Now it will always delay.

We also now suspend autoreload when a USB write starts and then
resume on completion. This should prevent reloading in between
sectors of a single write.
2022-03-14 16:49:30 -07:00
Dan Halbert e4cd9690f1 rework auto-reload delay logic 2022-03-11 14:03:04 -05:00
Dan Halbert 9b2e22a6df Make autoreload checking more robust
- Add reset for autoreload. De-request ticks.
- Separate state a little more in autoreload.c
- Rename some routines.
- Remove redundant settings of CIRCUITPY_AUTORELOAD_DELAY_MS.
2022-03-09 11:07:55 -05:00
Scott Shawcroft 91468ed36b
Don't crash on early debug print 2022-03-08 17:55:21 -08:00
Scott Shawcroft 96f5eec2ee
Add Teensy 4.1 power pin and fix SWD for DEBUG=1 2022-03-08 17:17:07 -08:00
Scott Shawcroft 83593a1558
Start of USB host API
This allows you to list and explore connected USB devices. It
only stubs out the methods to communicate to endpoints. That will
come in a follow up once TinyUSB has it. (It's in progress.)

Related to #5986
2022-03-07 18:07:25 -08:00
Radomir Dopieralski 93ea1bd9bd Add a flag for removing the Blinka logo from the REPL
There may be several reasons why we might want to remove the logo form
the REPL: a fork of CircuitPython that doesn't have the right to use the
logo, an especially small display that needs all the room it has to be
useful, displays that are especially vulnerable to burn-in, maybe even
the smaller chips where we want to save as much flash memory as
possible.
2022-03-05 15:38:59 +01:00
Kevin Matocha 790af2d9a6 fix REPL terminal garbled characters upon code.py finished 2022-02-21 14:58:16 -06:00
Kevin Matocha 03f42406d3 updated code so the REPL will retain its text if not resized when code stops 2022-02-21 10:33:08 -06:00
Scott Shawcroft bdee6cf3b6
Don't update status LED color on brightness change
Brightness changes now happen when the LED isn't active or
initialized. When not init, CP may crash.

Fixes #5872
2022-02-17 14:21:03 -08:00
Jeff Epler 1309ef083b
translate: Can't use compress_max_length_bits during qstr generation 2022-02-17 08:38:02 -06:00
Jeff Epler 860f7931d5
Fix case of compress_max_bits >8 2022-02-15 16:02:33 -06:00
Scott Gauche 3b418dbddc change half_duplex to be on spi construct 2022-02-08 21:37:38 -05:00
EmergReanimator cfa7e8a168 fix #5948 Adding back the SPI configuration to spi_flash_read/write_data
Removing this configures will break cases where the flash is on a shared SPI bus with a device that has different settings.
This is rare but possible.
2022-02-01 19:39:56 +01:00
EmergReanimator 2a1f586634 Avoid excessive SPI re-configuration in run-time of SPI flash. 2022-01-30 09:49:07 +01:00
EmergReanimator f610b6b190 Changed the order of SPI configuration and activation.
SPI should be configured while chip select pin is disabled.
Tested with external flash on STM32 F4VE board.
2022-01-29 18:29:50 +01:00
Scott Shawcroft 13db65566d
ESP NeoPixel fixes
This tweaks the RMT timing to better match the 1/3 and 2/3 of 800khz
guideline for timing. It also ensures a delay of 300 microseconds
with the line low before reset.

Pin reset is now changed to the IDF default which pulls the pin up
rather than CircuitPython's old behavior of floating the pin.

Fixes #5679
2022-01-19 16:29:07 -08:00
EmergReanimator 46a61e6788 Provide filesystem stubs to fit in with changes from 41d494df0b
filesystem stub implementation is used when DISABLE_FILESYSTEM is set.
2022-01-12 12:30:24 +01:00
Scott Shawcroft 513a954d92
Merge pull request #5812 from EmergReanimator/tinyusb_port_config
Allow to tailor tinyusb configuration for port specific needs
2022-01-06 10:06:46 -08:00
EmergReanimator 6dbb662787 Allow to tailor tinyusb configuration for port specific needs 2022-01-05 19:28:07 +01:00
EmergReanimator 9d38446369 Fixed build issue when INTERNAL_FLASH_FILESYSTEM, DISABLE_FILESYSTEM set 2022-01-04 21:07:56 +01:00
Dan Halbert 3c9f7f6ae9 address review comments 2021-12-27 19:36:11 -05:00
Dan Halbert 41d494df0b go into safe mode if not CIRCUITPY available 2021-12-27 18:58:24 -05:00
Dan Halbert 474986ff40 restore BLEIO HCI background task 2021-12-07 22:39:17 -05:00
Dan Halbert e8ea9c75a1 check for missing pins; deinit txrx leds 2021-11-30 19:16:21 -05:00
Dan Halbert 57c33059f3 board_deinit() everywhere 2021-11-30 11:00:10 -05:00
Timon a1052d5f73
Initial broadcom port for Raspberry Pi
This targets the 64-bit CPU Raspberry Pis. The BCM2711 on the Pi 4
and the BCM2837 on the Pi 3 and Zero 2W. There are 64-bit fixes
outside of the ports directory for it.

There are a couple other cleanups that were incidental:
* Use const mcu_pin_obj_t instead of omitting the const. The structs
  themselves are const because they are in ROM.
* Use PTR <-> OBJ conversions in more places. They were found when
  mp_obj_t was set to an integer type rather than pointer.
* Optimize submodule checkout because the Pi submodules are heavy
  and unnecessary for the vast majority of builds.

Fixes #4314
2021-11-22 14:54:44 -08:00
Jeff Epler 5cba23e04d
More missing-prototypes fixes 2021-11-10 12:22:07 -06:00
Jeff Epler 9e799a7c74
-Werror=missing-prototypes for nRF 2021-11-10 11:26:54 -06:00
Jeff Epler 63fbf98186
Enable -Wmissing-prototypes for atmel-samd 2021-11-09 20:05:00 -06:00
Jeff Epler efffb62b36 truncate boot_out.txt if it's long
Now this boot.py:
```py
for i in range(1000):
    print(i)
```
creates a 512-byte boot_out.txt that ends
```
88
89
...
```
2021-11-02 18:23:42 -05:00
Jeff Epler 694af3dd23 main: redesign boot_out.txt writing
New design:
 * capture output to a vstr
 * compare the complete vstr to boot_out.txt
 * rewrite if not a complete match

This is resilient against future changes to the automatic
text written to boot_out.txt.

This also fixes rewriting boot_out.txt in the case where
boot.py prints something.

Perhaps it also saves a bit of code space. Some tricks:
 * no need to close a file in read mode
 * no need to switch on/off USB write access, going down to the
   oofatfs layer doesn't check it anyway
2021-11-01 23:05:34 -05:00
Scott Shawcroft bf0bef9684
Split listdir entries across two packets
when the MTU of the BLE connection is smaller than the 28 bytes of
the header. (The smallest possible MTU is 20.)

Fixes #5511
2021-10-28 10:57:16 -07:00