amos 3fa3dd73ca Add 1 MEDIUM task from batch 28: ESP event loop accounting
Batch 28 commit a7fca39 gave ESP event loop accounting as MEDIUM: 2 of
3 attempts passed and the failure was a wrong fix in a complete session.
The task comes from the commit Qwen measured, its digest matches, and it
is still present at the batch branch head.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 11:54:54 +08:00

1.1 KiB

Software services

The adapter provides finite byte queues, recursive and ordinary mutexes, logical task handles and a virtual tick clock. xTaskGetTickCount observes ticks and esp_timer_get_time observes microseconds without advancing time. One tick is 1000 microseconds; applications may advance time with os_advance to model callback work.

os_schedule(delay, task, action, argument) schedules one generic action. When an OS wait covers its due tick, the service runs that action with the supplied task identity and then restores the waiting task identity. A wait shorter than the scheduled delay reaches its deadline without running the action. Queue operations copy arbitrary bytes and decide only from queue occupancy and the supplied waiting interval. os_cancel cancels an outstanding action.

The application may use these services to coordinate producers and consumers without wall-clock races. No service interprets event bases, IDs, callbacks, profiling information or loop state. Dedicated task creation is unsupported and reports failure; application-thread loops are the supported execution mode.