Skip to content

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.

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.

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.

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.

esp_err_t bsp_worker_start(void)

Create the worker task. Idempotent.

Declared in bsp_worker.h:56.

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.

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.

typedef struct bsp_worker_job bsp_worker_job_t

Declared in bsp_worker.h:30.

FieldTypeDescription
nameconst char *
period_msuint32_t
runsuint32_t
last_usuint32_t
max_usuint32_t
overrunsuint32_tdue dates missed by more than one period

Declared in bsp_worker.h:32.

MacroValueDescription
BSP_WORKER_MAX_JOBS12