nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
mpsl_work.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
16#ifndef MPSL_WORK__
17#define MPSL_WORK__
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <zephyr/kernel.h>
24
25extern struct k_work_q mpsl_work_q;
26
45static inline void mpsl_work_submit(struct k_work *work)
46{
47 if (k_work_submit_to_queue(&mpsl_work_q, work) < 0) {
48 __ASSERT(false, "k_work_submit_to_queue() failed.");
49 }
50}
51
70static inline void mpsl_work_schedule(struct k_work_delayable *dwork, k_timeout_t delay)
71{
72 if (k_work_schedule_for_queue(&mpsl_work_q, dwork, delay) < 0) {
73 __ASSERT(false, "k_work_schedule_for_queue() failed.");
74 }
75}
76
77#ifdef __cplusplus
78}
79#endif
80
81#endif /* MPSL_WORK__ */
82
static void mpsl_work_schedule(struct k_work_delayable *dwork, k_timeout_t delay)
Submit an idle work item to the MPSL workqueue after a delay.
Definition: mpsl_work.h:70
struct k_work_q mpsl_work_q
static void mpsl_work_submit(struct k_work *work)
Submit a work item to the MPSL workqueue.
Definition: mpsl_work.h:45