earlephilhower / arduino-pico

Raspberry Pi Pico Arduino core, for all RP2040 and RP2350 boards
GNU Lesser General Public License v2.1
1.96k stars 406 forks source link

Support for or alternative to Scheduler.h API? #2330

Closed pomplesiegel closed 1 month ago

pomplesiegel commented 1 month ago

Hello! I am transitioning from using a RP2040 on PlatformIO using "pico" and the standard core to arduino-pico instead.

Question: I was previously using Scheduler.h, which has built-in support on the standard PlatformIO architecture, but I can't seem to get it working with arduino-pico. Is there a way to get it working, or a drop-in alternative with similar behavior and/or API?

Thank you!

earlephilhower commented 1 month ago

Scheduler uses MBEDos threading. It's not something that can run on bare metal like this core is.

What you can do instead is look at FreeRTOS which is supported (in SMP mode, so both cores used automatically) and has support for tasks like this.

pomplesiegel commented 1 month ago

Great, thank you!