Commit graph

354 commits

Author SHA1 Message Date
953694d56c Fix -Wold-style-definion errors in the raspberrypi port
This mostly means changing `void foo()` to `void foo(void)` at
the function definition site. This was previously only an error
if the declaration site didn't have `(void)`, but the unix
coverage build enables the more strict warning and there's little
difficulty in resolving these diagnostics.

.. other ports can be done too, if desired.
2025-05-25 09:16:00 +02:00
Scott Shawcroft
2bec0562eb
Factor out register saves
This fixes RISC-V ESP32 because it ignored registers on that
architecture.
2025-05-08 16:12:10 -07:00
Scott Shawcroft
8a28033587
Always set current working dir
PR #10263 moved it to only before code.py. This breaks the repl (and
likely boot.py.)

Fixes #10289
2025-04-24 15:54:22 -07:00
Scott Shawcroft
3377765004
Add working_directory for subsequent code file
This allows subfolders to be treated similar to / for multiple
apps within different folders.

Also, fix up the internal current working directory so it doesn't
depend on volumes.

Fixes #9045 and fixes #8409.
2025-04-22 09:58:45 -07:00
26ab62b040 Remove unneeded "post_boot_py"
This was only used in espressif but became a no-op in
5e26862b2c so it should just be removed.
2025-04-16 18:12:51 +02:00
8097e3dde6 Address -Wtype-limits diagnostics
This fixes an unlikely problem with the USB host implementation on
rp2350 that would not have detected failure to allocate a DMA channel.

Together with #10186 this should give a clean build. As it is,
this will error.
2025-03-26 10:57:52 -05:00
Scott Shawcroft
5616fc2a3c
Add support for saves partition
Suggested in #10045
2025-03-06 16:48:59 -08:00
75196914a1 Add supervisor.runtime.display
This partially implements #8675. Releasing non-primary displays is
left for a 10.0 incompatible change. The allocation of I2C and SPI
bus objects is unchanged, rather than allocating them outside the GC
heap as suggested in that PR.
2025-02-13 13:41:08 -06:00
Scott Shawcroft
7f0cc9e7b4
Add Zephyr port
This port is meant to grow to encompass all existing boards. For
now, it is a port while we transition over.

It is named `zephyr-cp` to differentiate it from the MicroPython
`zephyr` port. They are separate implementations.
2025-02-04 11:24:13 -08:00
Scott Shawcroft
63aeb11d7e
Improve ESP BLE and turn on BLE workflow
The BLE workflow will broadcast publicly when the web workflow
isn't activated.
2024-06-11 16:21:40 -07:00
Dan Halbert
3f4d9310ff CircuitPython files: replace STATIC with static 2024-05-20 11:02:17 -04:00
Dan Halbert
747b7619ea update headers of most CircuitPython-only files 2024-05-17 14:56:28 -04:00
Bill Sideris
77a4e429fd
Always chdir back to root when reloading 2024-05-04 16:19:53 +03:00
Scott Shawcroft
6d802fe616
Fix ESP builds 2024-04-29 14:11:38 -07:00
Scott Shawcroft
28b7421124
Merge remote-tracking branch 'adafruit/main' into renode 2024-04-29 11:27:19 -07:00
Scott Shawcroft
0cbd8b2e0c
Add CIRCUITPY_USB_DEVICE config
This replaces CIRCUITPY_USB and makes room for CIRCUITPY_TINYUSB
when it may only be included for host support.
2024-04-26 11:58:49 -07:00
Scott Shawcroft
442def3e68
Add minimal Renode port
This runs in the Renode simulator and enables easier tracing and
debugging of the CircuitPython core. This port can also serve as
a starting point for new ports because it implements the minimal
necessary for the CP core to run.
2024-04-23 13:31:31 -07:00
Bill Sideris
3e8cf0df01
Revert "Switch to another func for the output text"
This reverts commit dcb08dc6fd.
2024-04-18 21:58:30 +03:00
Bill Sideris
e1054ef624
Phrase it a bit better 2024-04-18 21:54:24 +03:00
Bill Sideris
dcb08dc6fd
Switch to another func for the output text 2024-04-18 21:51:22 +03:00
Bill Sideris
0bea0174aa
Add some comments for the line clear 2024-04-18 21:34:49 +03:00
Bill Sideris
511c0e6832
Switch to serial_write for just this one print 2024-04-15 01:33:29 +03:00
Dan Halbert
bb9968215c Runtime.serial_bytes_available: return count isntead of bool 2024-04-04 12:26:06 -04:00
f7c4a220d0 Fix build bugs exposed by posix port 2024-02-13 17:00:52 -06:00
Scott Shawcroft
081686e1b3
Make supervisor.reload() from REPL work
It will then run the next script.

Fixes #8148
2024-01-25 10:54:49 -08:00
Bill Sideris
3b46f049b7
Move line-clear into a variable. 2023-12-16 00:02:48 +02:00
Bill Sideris
722d8ffca5
Add the necessary line clears to tidy up boot serial. 2023-12-15 18:13:25 +02:00
Scott Shawcroft
ae07ac17ac
Fix pystack size
Original code used uint32_t* so `/ sizeof(size_t)` was needed. It
is a uint8_t* now so that division makes it 4x smaller. Whoops!

Fixes #8574
2023-11-13 11:33:37 -08:00
Scott Shawcroft
8137e2d6d2
Switch all ports to auto-growing split heap
This simplifies allocating outside of the VM because the VM doesn't
take up all remaining memory by default.

On ESP we delegate to the IDF for allocations. For all other ports,
we use TLSF to manage an outer "port" heap. The IDF uses TLSF
internally and we use their fork for the other ports.

This also removes the dynamic C stack sizing. It wasn't often used
and is not possible with a fixed outer heap.

Fixes #8512. Fixes #7334.
2023-11-01 15:24:16 -07:00
60755cc690
straggling translate()s that my glob missed 2023-10-30 10:15:14 +01:00
Scott Shawcroft
e1df598199
Split displayio hardware support from core
These are moved:
* Display -> busdisplay.BusDisplay
* FourWire -> fourwire.FourWire
* EPaperDisplay -> epaperdisplay.EPaperDisplay
* I2CDisplay -> i2cdisplaybus.I2CDisplayBus

`paralleldisplay` is now `paralleldisplaybus` (and registered as
`paralleldisplay` too).

Bus related helpers are split out of display_core into bus_core.
It is in still displayio since it is a dependency of both
busdisplay and epaperdisplay.

Fixes #7667
2023-10-24 15:43:34 -07:00
Scott Shawcroft
9633c4e78f
Merge remote-tracking branch 'adafruit/main' into v1.20-merge 2023-10-11 11:21:57 -07:00
Scott Shawcroft
bf3d84195f
Fix decompressing using qstrs after running the VM
The qstr state still pointed to qstr pools in the released MP heap.
2023-10-05 14:56:11 -07:00
Scott Shawcroft
a15c111d5c
Merge pull request #7718 from microdev1/watchdog-rp
Update WatchDog implementation
2023-10-02 14:17:29 -07:00
Scott Shawcroft
3fdfb9bd32
Update ADC and I2S APIs for 5.1
This fixes ESP32 because the BufferedIn used the old ADC API and
I2S did too indirectly.

Fixes #8429
2023-09-26 16:06:54 -07:00
MicroDev
05812e0618
Merge branch 'main' into watchdog-rp 2023-09-24 05:13:22 +00:00
Dan Halbert
2c0fa0f7dc initial merge from v1.20.0; just satisifying conflicts 2023-09-19 11:10:12 -04:00
c3c2b84584
fix typo, copyright notice 2023-09-07 12:57:45 -05:00
5e26862b2c
Allow use of CONFIG_SPIRAM_USE_CAPS_ALLOC
.. and switch makerfabs tft7 over to it as a test.

We have our existing way of "reserving" PSRAM for esp-idf (we actually
control it all but add back the "reserved" part). However, this does
not work with off the shelf esp_lcd, which only will allocate a
framebuffer in PSRAM if CONFIG_SPIRAM_USE_CAPS_ALLOC (or CONFIG_SPIRAM_USE_ALLOC)
is defined, not if CONFIG_SPIRAM_USE_MEMMAP is.

This new way is possibly compatible with more esp-idf code, but it complicates
CircuitPython's initial startup since nothing until port_heap_init is
permitted to use the CP heap or supervisor allocator. In practice this
seems to be OK today.

Right now this doesn't change the setting across all boards with PSRAM and so
it does not revert esp-idf to its prior state. Instead, what I'm thinking is
that we can do it during or just after the IDF5 update when sdkconfig files
will be getting an overhaul anyway.
2023-09-05 12:43:22 -05:00
Scott Shawcroft
b81c0e2924
Merge pull request #8344 from jepler/repl-py
add support for "repl.py"
2023-08-29 11:20:13 -07:00
d7cf11d3ef
Add repl.py support 2023-08-28 13:59:50 -05:00
Dan Halbert
282e93d3e3
Merge pull request #8281 from dhalbert/merge-micropython-v1.19.1
Merge micropython v1.19.1
2023-08-21 19:24:26 -04:00
Dan Halbert
babd2dec45
Merge pull request #8296 from pypewpew/reset-cwd
Reset cwd before looking for files to run
2023-08-18 17:36:24 -04:00
Radomir Dopieralski
1a47c5f326 Reset cwd before looking for files to run
Make sure we only look for the files in the root directory.
2023-08-18 22:05:29 +02:00
Dan Halbert
d582407b06 pre-commit fixes 2023-08-14 00:59:22 -04:00
Scott Shawcroft
cbfb2d0f55
Add Pimoroni Inky Frame 5.7
Tweak DTCM and ITCM loading and prevent epd refresh while waiting
for autoreload.
2023-05-11 12:12:34 -07:00
Scott Shawcroft
b59f0e17be
Fix RP2040 idle
Don't idle from main if we scheduled an interrupt for 0 ticks in
the future.

Have RP2040 detect wakes that happen between setting the timer and
the idle call.

Fixes #7361
2023-04-21 16:04:23 -07:00
Scott Shawcroft
66edcf5d03
Add PicoDVI support
PicoDVI in CP support 640x480 and 800x480 on Feather DVI, Pico and
Pico W. 1 and 2 bit grayscale are full resolution. 8 and 16 bit
color are half resolution.

Memory layout is modified to give the top most 4k of ram to the
second core. Its MPU is used to prevent flash access after startup.

The port saved word is moved to a watchdog scratch register so that
it doesn't get overwritten by other things in RAM.

Right align status bar and scroll area. This normally gives a few
pixels of padding on the left hand side and improves the odds it is
readable in a case. Fixes #7562

Fixes c stack checking. The length was correct but the top was being
set to the current stack pointer instead of the correct top.
Fixes #7643

This makes Bitmap subscr raise IndexError instead of ValueError
when the index arguments are wrong.
2023-04-19 15:14:02 -07:00
d247e5c6c9
Add the ability for a port to gc things, collect pin change objects that way 2023-03-23 09:16:00 -05:00
MicroDev
7ee3f30c17
rewrite allocate_pystack logic 2023-03-21 07:06:46 +05:30