bsp_worker.h
Generated from bsp_worker.h in platform-idf. Edit the header’s doxygen comments to change this page.
One task for the periodic housekeeping loops.
Functions
Section titled “Functions”bsp_worker_add
Section titled “bsp_worker_add”bsp_worker_job_t * bsp_worker_add(const char *name, uint32_t period_ms, bsp_worker_fn fn, void *ctx)Register a job. May be called before or after bsp_worker_start(); a job added while the worker sleeps runs without waiting for that sleep to end. NULL when the table is full.
Declared in bsp_worker.h:46.
bsp_worker_set_period
Section titled “bsp_worker_set_period”void bsp_worker_set_period(bsp_worker_job_t *job, uint32_t period_ms)Change a job’s period; the next run is rescheduled from now.
Declared in bsp_worker.h:49.
bsp_worker_remove
Section titled “bsp_worker_remove”void bsp_worker_remove(bsp_worker_job_t *job)Unregister a job. Returns once the job is no longer executing, so its state may be torn down afterwards. Safe to call from the job itself.
Declared in bsp_worker.h:53.
bsp_worker_start
Section titled “bsp_worker_start”esp_err_t bsp_worker_start(void)Create the worker task. Idempotent.
Declared in bsp_worker.h:56.
bsp_worker_stats
Section titled “bsp_worker_stats”size_t bsp_worker_stats(bsp_worker_stat_t *out, size_t max)Copy up to max job statistics into out; returns the number written.
Declared in bsp_worker.h:59.
bsp_worker_fn
Section titled “bsp_worker_fn”typedef uint32_t(* bsp_worker_fn)(void *ctx)Runs once per period. Returns 0 to keep the period, or a new period in ms (how a job backs off when its device is gone).
Declared in bsp_worker.h:28.
bsp_worker_job_t
Section titled “bsp_worker_job_t”typedef struct bsp_worker_job bsp_worker_job_tDeclared in bsp_worker.h:30.
bsp_worker_stat_t
Section titled “bsp_worker_stat_t”| Field | Type | Description |
|---|---|---|
name | const char * | |
period_ms | uint32_t | |
runs | uint32_t | |
last_us | uint32_t | |
max_us | uint32_t | |
overruns | uint32_t | due dates missed by more than one period |
Declared in bsp_worker.h:32.
Macros
Section titled “Macros”| Macro | Value | Description |
|---|---|---|
BSP_WORKER_MAX_JOBS | 12 |