Commit Graph

545 Commits

Author SHA1 Message Date
Dan Halbert b0efd130c9 ESP32 REPL working through debug UART 2022-06-29 23:19:36 -04: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 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
George White 3b5171c4ff Move hook implementation to supervisor 2022-04-18 14:09:36 +00: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 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 6dbb662787 Allow to tailor tinyusb configuration for port specific needs 2022-01-05 19:28:07 +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
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 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
Max Holliday c999e2a329 add missing varriables to devices.h generator 2021-10-24 11:45:15 -07:00