circuitpython/examples
Angus Gratton 86f2c285eb py: Add new cstack API for stack checking, with limit margin macro.
Currently the stack limit margin is hard-coded in each port's call to
`mp_stack_set_limit()`, but on threaded ports it's fiddlier and can lead to
bugs (such as incorrect thread stack margin on esp32).

This commit provides a new API to initialise the C Stack in one function
call, with a config macro to set the margin.  Where possible the new call
is inlined to reduce code size in thread-free ports.

Intended replacement for `MP_TASK_STACK_LIMIT_MARGIN` on esp32.

The previous `stackctrl.h` API is still present and unmodified apart from a
deprecation comment.  However it's not available when the
`MICROPY_PREVIEW_VERSION_2` macro is set.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-14 12:55:45 +10:00
..
bluetooth examples/bluetooth: Link to aioble in BLE examples. 2023-09-01 14:05:32 +10:00
embedding embed: Improve stack top estimation. 2024-02-15 10:07:32 +11:00
hwapi all: Fix various spelling mistakes found by codespell 2.2.6. 2023-10-03 11:24:50 +11:00
natmod py: Add new cstack API for stack checking, with limit margin macro. 2024-08-14 12:55:45 +10:00
network examples/network: Add example of HTTPS client using non-blocking socket. 2024-05-13 11:37:00 +10:00
rp2 examples: Mark asm, pio, etc. as noqa: F821 (undefined-name). 2023-08-16 16:12:33 +10:00
SDdatalogger top: Update Python formatting to black "2023 stable style". 2023-02-02 12:51:03 +11:00
unix examples/unix/machine_bios.py: Fix typo. 2023-09-29 17:02:15 +10:00
usb examples/usb: Add README that points out the alternative usb modules. 2024-05-15 15:20:40 +10:00
usercmodule examples/usercmodule/cexample: Add more advanced native class. 2024-07-25 11:57:13 +10:00
accel_i2c.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
accellog.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
asmled.py examples: Mark asm, pio, etc. as noqa: F821 (undefined-name). 2023-08-16 16:12:33 +10:00
asmsum.py examples: Mark asm, pio, etc. as noqa: F821 (undefined-name). 2023-08-16 16:12:33 +10:00
conwaylife.py top: Update Python formatting to black "2023 stable style". 2023-02-02 12:51:03 +11:00
ledangle.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
mandel.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
micropython.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
pyb.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
switch.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00