How elemprod/lptask works
LPTASK is a small cooperative scheduler library for low-power embedded applications. An application initializes and starts the scheduler, configures tasks with intervals and optional data, then the scheduler checks expiration, dispatches handlers in the main context, and sleeps between work through platform-specific port functions. Tasks may be repeating or one-shot, buffered or unbuffered, and buffered tasks may be allocated from pools. The core implementation and port contract were sampled; the graph reflects README-documented capabilities where individual implementations were not sampled.
Main entry points: scheduler.c Scheduler core · scheduler.h Scheduler API · sched_port.h Platform port contract · sched_types.h Task types
Components 10
Application API
- Scheduler API
src/scheduler/scheduler.h - Task types
src/scheduler/sched_types.h - Timing helpers
src/scheduler/sched_helper.h
Scheduler Engine
- Scheduler core
src/scheduler/scheduler.c - Active task queue
src/scheduler/scheduler.c - Buffered task pools
src/scheduler/scheduler.c
Platform Support
- Platform port contract
src/scheduler/sched_port.h
Other components
- Embedded application
- Task handlers
- Platform timer and sleep
Connections 9
- Embedded application → Scheduler API: configures tasks
- Scheduler API → Task types: uses types
- Scheduler API → Scheduler core: calls
- Embedded application → Timing helpers: queries timing
- Scheduler core → Active task queue: updates queue
- Scheduler core → Buffered task pools: allocates tasks
- Scheduler core → Task handlers: dispatches expired
- Scheduler core → Platform port contract: calls port hooks
- Platform port contract → Platform timer and sleep: requires implementation