Commit Graph

639 Commits

Author SHA1 Message Date
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
Max Holliday c999e2a329 add missing varriables to devices.h generator 2021-10-24 11:45:15 -07:00
Dan Halbert fa96ea1f72 Merge remote-tracking branch 'adafruit/main' into hid-boot-protocol 2021-10-18 15:30:24 -04:00
Jeff Epler 414c2f9da6 Always use python3
.. similar to https://github.com/micropython/micropython/pull/4448
2021-10-15 15:11:21 -05:00