1 /* 2 * Copyright (c) 2022 Raspberry Pi (Trading) Ltd. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef _PICO_ASYNC_CONTEXT_BASE_H 8 #define _PICO_ASYNC_CONTEXT_BASE_H 9 10 #include "pico/async_context.h" 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 // common functions for async_context implementations to use 17 bool async_context_base_add_at_time_worker(async_context_t *self, async_at_time_worker_t *worker); 18 bool async_context_base_remove_at_time_worker(async_context_t *self, async_at_time_worker_t *worker); 19 20 bool async_context_base_add_when_pending_worker(async_context_t *self, async_when_pending_worker_t *worker); 21 bool async_context_base_remove_when_pending_worker(async_context_t *self, async_when_pending_worker_t *worker); 22 23 async_at_time_worker_t *async_context_base_remove_ready_at_time_worker(async_context_t *self); 24 void async_context_base_refresh_next_timeout(async_context_t *self); 25 26 absolute_time_t async_context_base_execute_once(async_context_t *self); 27 bool async_context_base_needs_servicing(async_context_t *self); 28 29 #ifdef __cplusplus 30 } 31 #endif 32 33 #endif