Overview of AceRoutine
developAceRoutine is a low-memory, fast-switching, cooperative multitasking library for Arduino platforms. It implements stackless coroutines based on the ProtoThreads model, allowing execution to suspend via yield() or delay() and resume later. This allows multiple tasks to appear to run concurrently on microcontrollers with limited resources.
Core Components
Coroutine: Provides context variables for individual coroutines.CoroutineScheduler: Handles the scheduling of multiple coroutines (optional).
Key Features
- Low Memory Footprint: Optimized for both 8-bit (AVR) and 32-bit (ESP32, STM32, etc.) processors.
- Fast Context Switching: Uses GCC/Clang 'computed goto' to avoid Duff's Device hacks, enabling
switchstatements within coroutines. - Profiling: Version 1.5+ includes tools to profile
Coroutine::runCoroutine()execution time and render results as tables or JSON. - Experimental Channels: An unbuffered, synchronized
Channelclass allows one reader and one writer to communicate.