Commit graph

17 commits

Author SHA1 Message Date
Earle F. Philhower, III
322a1af6da
Avoid memory (de)allocation in GPIO ISR handler (#2623)
Replace std::map, which can `new` and `delete` elements of the tree,
with a statically allocated array and housekeeping.

Fixes #2622
2024-11-19 12:26:47 -08:00
Ikechukwu Ofili
3aa8df5ab7
GPIO interrupt dispatcher, minimize blocking (#2558)
Only need to lock around the std::map check, not the whole IRQ callback

This is important if you have a time sensitive interrupt on one of the cores
2024-10-26 13:37:24 -07:00
Earle F. Philhower, III
a0b3876de4
Add FreeRTOS support for RP2350 (#2406)
Pull in Raspberry Pi's custom RP2350 ARM and RISC-V ports for FreeRTOS.

Basic tests run, but stress mutex test is failing in unique and interesting
ways.

* Add simplified switching test catching task swap problem

* Freertosrp2350: use FreeRTOS macros in noInterrupts/interrupts when applicable. (#2456)
* Use FreeRTOS macros in noInterrupts/interrupts when applicable.
* Fixed calling taskEXIT_CRITICAL and taskENTER_CRITICAL
---------

Co-authored-by: fietser28 <fietser28@users.noreply.github.com>
2024-09-16 16:56:22 -07:00
Yveaux
bc7adf42c2
Allow configuring maxIRQs (#2401) 2024-09-01 08:44:51 -07:00
Earle F. Philhower, III
652f9f9eda
Fix FreeRTOS CoreMutex shim to handle ISRs (#1442)
* Fix FreeRTOS CoreMutex shim to handle ISRs

Automatically check, when in FreeRTOS, if we're in an ISR and
if so call the correct mutex grab.

Thanks to @caveman99 for finding and proposing a solution!

Fixes #1441

* Fix the CoreMutex destructor, too
2023-05-23 10:12:52 -07:00
imwoo90
a7cf5cd1ca
Fix GPIO interrupt on freeRTOS (#959) 2022-11-22 18:26:19 -08:00
Earle F. Philhower, III
6570c4856b
Fix deadlock in attachInterruptParam (#953)
Thanks to @imwoo90 comment in https://github.com/earlephilhower/arduino-pico/issues/878#issuecomment-1302276196
2022-11-03 08:40:57 -07:00
Earle F. Philhower, III
a6bdb27178
Use static allocation for IRQ stack (#915)
noInterrupts/interrupts use a stack to allow multiple calls to work
properly.  The original code was using a std::stack which will use
malloc() to allocate entry space.  This seems like a bad idea, and
makes it so it's impossible to disable interrupts for malloc/free,
etc.

Define a fixed stack size and use straight C code to manage the IRQ
stacks.  Slightly more fixed memory requirements, but significantly
lower total RAM requirements and no malloc() dependency.
2022-10-14 13:46:00 -07:00
Earle F. Philhower, III
939c83127e
Fix deadlock during attachInterrupt (#879)
Fixes #878
2022-09-25 10:02:48 -07:00
Earle F. Philhower, III
4ede3ff8a4
Add attachInterruptParam (#602)
Fixed #601

Allows apps to provide a callback parameter in the `attachInterrupt` call
to be passed back to the function when the interrupt happens.
2022-05-31 18:14:34 -07:00
Earle F. Philhower, III
8016a932f3
Add astyle format, boards.txt, and package check (#166)
Miscellaneous CI checks for code style, boards.txt update, and that all
referenced packages are available.
2021-05-24 15:01:03 -07:00
Earle F. Philhower, III
83a32f1ba3
Add compilation to CI (#155)
Stolen from ESP8266, modified to run basic sanity compiles on the core.

Fix warnings identified by the new checks.
2021-05-22 02:58:57 -07:00
Earle F. Philhower, III
70a30dc219
Add multicore safety, FIFO, update pico-sdk (#122)
Update pico-sdk to 1.1.2

Add methods to block the opposite core while doing flash updates.
Ensure opposite core is stopped in LittleFS and EEPROM while doing
flash updates.

Update documentation with new calls.
2021-05-06 19:57:21 -07:00
Earle F. Philhower, III
011ecdb5a6
More multicore safety plumbing, IRQs, analogXXX (#107)
Keep a per-core IRQ stack for noInterrupts since each core has its own
enable/disable.

Make analogRead/analogWrite multicore safe
2021-04-15 17:16:13 -07:00
Earle F. Philhower, III
b96c37164e Fix attachInterrupt to handle single GPIO callback
The Pico SDK only supports a single callback pointer for all GPIO
interrupt pins.  So we need to track the individual pin-to-CB map
ourselves and dispatch from our own internal callback routine.

Fixes #25
2021-03-26 07:56:44 -07:00
Earle F. Philhower, III
09b5693f32 Add attach/detachInterrupt support
Fixes #21
2021-03-25 20:01:48 -07:00
Earle F. Philhower, III
22d242d34a Add interrupts/noInterrupts as a stack 2021-03-16 22:20:36 -07:00