Commit Graph

115 Commits

Author SHA1 Message Date
Dan Halbert 104a089677 deep sleep working; deep sleep delay when connected 2020-11-26 22:06:37 -05:00
Dan Halbert ef0830bfe2 merge from upstream + wip 2020-11-25 17:52:06 -05:00
Dan Halbert 9dbea36eac changed alarm.time API 2020-11-25 15:09:27 -05:00
Dan Halbert f868cc5dd0 some API renaming and bug fixes; fix docs 2020-11-24 23:37:05 -05:00
Dan Halbert 7a45afc549 working, but need to avoid deep sleeping too fast before USB ready 2020-11-23 22:44:53 -05:00
Dan Halbert a0f1ec3c4a wip 2020-11-22 19:10:09 -05:00
Dan Halbert 75559f35cc wip: ResetReason to microcontroller.cpu 2020-11-21 23:29:52 -05:00
Dan Halbert 39e1f52e28 wip; not compiling yet 2020-11-19 17:47:12 -05:00
Dan Halbert 649c930536 wip 2020-11-19 15:43:39 -05:00
Dan Halbert bb77f1d130 wip: initial code changes, starting from @tannewt's sleepio branch 2020-11-16 11:56:20 -05:00
Scott Shawcroft 9a4efed8cb
Start tweaking the workflow to sleep 2020-10-27 17:55:03 -07:00
microDev 0e444f0de8
Implement sleep on code.py exit 2020-10-27 16:17:29 -07:00
microDev e310b871c8
Get io wake working 2020-10-27 16:13:25 -07:00
microDev 3a30887b44
Update soft reboot message 2020-10-27 16:13:24 -07:00
Christian Walther f4f80e07ca Fix lost board.SPI and board.I2C after being used by display.
Fixes #3581.

Pins were marked as never_reset by common_hal_displayio_fourwire_construct() and common_hal_sharpdisplay_framebuffer_construct(), but these marks were never removed, so at the end of a session after displayio.release_displays(), {spi|i2c}_singleton would be set to NULL but the pins would not be reset. In the next session, board.SPI() and board.I2C() were unable to reconstruct the object because the pins were still in use.

For symmetry with creation of the singleton, add deinitialization before setting it to NULL in reset_board_busses(). This makes the pins resettable, so that reset_port(), moved behind it, then resets them.
2020-10-26 22:44:38 +01:00
microDev 8487a51995
Factor out code.py status messages 2020-10-07 23:53:08 +05:30
microDev d01b9ce933
Disable auto-reload in safe mode 2020-10-07 22:15:05 +05:30
Jeff Epler 4869dbdc67 canio: rename from _canio
This reflects our belief that the API is stable enough to avoid incompatible changes during 6.x.
2020-09-21 16:44:26 -05:00
Jeff Epler ca32a81bf1 main.c: Correct CANIO if-guard 2020-09-21 16:44:26 -05:00
Jeff Epler a2e1867f69 _canio: Minimal implementation for SAM E5x MCUs
Tested & working:

 * Send standard packets
 * Receive standard packets (1 FIFO, no filter)

Interoperation between SAM E54 Xplained running this tree and
MicroPython running on STM32F405 Feather with an external
transceiver was also tested.

Many other aspects of a full implementation are not yet present,
such as error detection and recovery.
2020-09-21 16:44:26 -05:00
Dan Halbert 6dbd369272 merge from upstream 2020-08-30 14:39:03 -04:00
Scott Shawcroft f39708abb2
Add PSRAM support to ESP32S2
When configured the CircuitPython heap will be on the external RAM.
When not available, the heap will be 48k inside the IDF heap.
2020-08-21 16:20:58 -07:00
Dan Halbert 0e30dd8bcc merge from upstream; working; includes debug_out code for debugging via Saleae for posterity 2020-08-20 20:29:57 -04:00
Dan Halbert d0ffdda5bb fix reset logic to not do pin ops or heap ops at bad times 2020-08-13 17:47:35 -04:00
Scott Shawcroft bbac68e77c
Merge pull request #3232 from hierophect/esp32-neopixel
ESP32-S2: Add Neopixel support
2020-08-11 11:04:39 -07:00
Lucian Copeland 4613b58a31 Add skip for rgb matrix exception handling 2020-08-10 18:00:50 -04:00
Dan Halbert ac95106b88 service discovery works; need to work on char and descriptor discovery 2020-08-04 18:24:37 -04:00
Jeff Epler d92a77fdd3 main: Allow these arrays to reside in ROM
The missing second "const" made these mutable arrays pointing to
const string data.
2020-08-04 14:45:45 -05:00
Jeff Epler a85b6441fc main: Drop "double extension" detection if not FULL_BUILD
This saves nearly 200 bytes.  Curiously, it also saves RAM.
2020-08-04 14:45:45 -05:00
Jeff Epler d0427cf60c Combine some "safe mode" messages 2020-08-04 14:45:45 -05:00
Scott Shawcroft 2bd6d05663
Add externs. GCC10 complains about duplicate defines 2020-07-22 16:26:46 -07:00
Scott Shawcroft 1ec3580946
Merge branch 'main' into memmonitor 2020-07-22 12:24:19 -07:00
Scott Shawcroft 389c81341d
Tweak declaration for boards with TCM 2020-07-20 18:16:20 -07:00
Scott Shawcroft a1e4814a27
Get AllocationAlarm working 2020-07-17 17:15:03 -07:00
Scott Shawcroft 1160635608
Enable PYSTACK to keep function state out of the heap 2020-07-17 17:03:42 -07:00
Jeff Epler a18a392109 background_callback: Add gc collect callback
A background callback must never outlive its related object.  By
collecting the head of the linked list of background tasks, this will
not happen.

One hypothetical case where this could happen is if an MP3Decoder is
deleted while its callback to fill its buffer is scheduled.
2020-07-17 08:36:26 -05:00
Jeff Epler 1df48176ce supervisor: factor supervisor_background_tasks from sundry ports 2020-07-15 11:49:44 -05:00
Jeff Epler 1474fccd2f supervisor: Add a linked list of background callbacks
In time, we should transition interrupt driven background tasks out of the
overall run_background_tasks into distinct background callbacks,
so that the number of checks that occur with each tick is reduced.
2020-07-15 09:26:47 -05:00
Jeff Epler fe3e8d1589 string compression: save a few bits per string
Length was stored as a 16-bit number always.  Most translations have
a max length far less.  For example, US English translation lengths
always fit in just 8 bits.  probably all languages fit in 9 bits.

This also has the side effect of reducing the alignment of
compressed_string_t from 2 bytes to 1.

testing performed: ran in german and english on pyruler, printed messages
looked right.

Firmware size, en_US
Before: 3044 bytes free in flash
After: 3408 bytes free in flash

Firmware size, de_DE (with #2967 merged to restore translations)
Before: 1236 bytes free in flash
After: 1600 bytes free in flash
2020-05-28 08:36:08 -05:00
Scott Shawcroft 916ca9f8a6
Merge pull request #2910 from tannewt/esp32s2
Add initial ESP32S2 support
2020-05-19 12:53:23 -07:00
Mark Olsson 007c92ee6a Enable showing the console on a debug uart 2020-05-19 02:02:52 +02:00
Scott Shawcroft 6aaab005c5
Initial ESP32S2 port.
Basic blinky works but doesn't check pins.
2020-05-15 15:36:16 -07:00
Scott Shawcroft 418333979a
Fix autoreload, neopixel, monotonic_ns and sleep w/o SD 2020-03-13 11:12:31 -07:00
Lucian Copeland 100409961a Move board_init to main.c 2020-01-29 16:29:43 -05:00
Dan Halbert ef2ef7a6b8 merge from master 2019-12-12 15:51:13 -05:00
Dan Halbert 7889b999cc Fix flash write error handling; clean up safe mode message printing 2019-12-12 14:41:49 -05:00
Dan Halbert 40434d6919 wip 2019-12-05 22:45:53 -05:00
Scott Shawcroft ae30a1e5aa
Refine _bleio
This PR refines the _bleio API. It was originally motivated by
the addition of a new CircuitPython service that enables reading
and modifying files on the device. Moving the BLE lifecycle outside
of the VM motivated a number of changes to remove heap allocations
in some APIs.

It also motivated unifying connection initiation to the Adapter class
rather than the Central and Peripheral classes which have been removed.
Adapter now handles the GAP portion of BLE including advertising, which
has moved but is largely unchanged, and scanning, which has been enhanced
to return an iterator of filtered results.

Once a connection is created (either by us (aka Central) or a remote
device (aka Peripheral)) it is represented by a new Connection class.
This class knows the current connection state and can discover and
instantiate remote Services along with their Characteristics and
Descriptors.

Relates to #586
2019-10-21 18:57:03 -07:00
Dan Halbert 7b79ac3739 Parameterize linker script 2019-10-20 23:50:12 -04:00
Kamil Tomaszewski f3151bb6c4 Use get top and limit stack functions 2019-10-18 11:05:08 +02:00