Instantiable scheduler functions.
More...
Instantiable scheduler functions.
#define APP_ISCHED_INIT |
( |
|
_isched, |
|
|
|
_queue_size |
|
) |
| APP_ISCHED_INIT_NAMED(/* empty */, _isched, _queue_size) |
Initialize a scheduler instance.
- Note
- This macro reserves memory for the given pool instance. Use it only once per each app_balloc_pool instance.
- Parameters
-
[in] | _isched | Pointer to the app_isched instance that is to be initialized. |
[in] | _queue_size | Maximum number of events in the execution queue. |
#define APP_ISCHED_INIT_NAMED |
( |
|
_name, |
|
|
|
_isched, |
|
|
|
_queue_size |
|
) |
| |
Value:do { \
NRF_QUEUE_DEF(
app_isched_event_t, _name##_queue, _queue_size, NRF_QUEUE_MODE_NO_OVERFLOW); \
(_isched)->p_event_queue = &_name##_queue; \
\
for (unsigned int i = 0; i < APP_ISCHED_HOOKS_COUNT; i++) \
{ \
(_isched)->hooks[i] = NULL; \
} \
} while (0)
Initialize a named scheduler instance.
- Note
- This macro reserves memory for the given pool instance. Use it only once per each app_balloc_pool instance.
- Parameters
-
[in] | _name | Name of the scheduler storage. |
[in] | _isched | Pointer to the app_isched instance that is to be initialized. |
[in] | _queue_size | Maximum number of events in the execution queue. |
Instantiable scheduler hook types.
Enumerator |
---|
APP_ISCHED_HOOK_PRE_PUT |
This hook will be called before putting an event into queue.
|
APP_ISCHED_HOOK_POST_PUT |
This hook will be called after putting an event into queue.
|
APP_ISCHED_HOOK_PRE_EXEC |
This hook will be called before event execution.
|
APP_ISCHED_HOOK_POST_EXEC |
This hook will be called after event execution.
|
Put an event in the scheduler instance.
- Parameters
-
[in] | p_isched | Pointer to the scheduler instance. |
[in] | handler | Event handler that will receive the event. |
[in] | p_context | Pointer to the event context which will be passed to the event handler. |
- Returns
- NRF_SUCCESS on success, otherwise error code.
ret_code_t app_isched_events_execute |
( |
app_isched_t * |
p_isched | ) |
|
Execute events queued in the given scheduler.
- Parameters
-
[in] | p_isched | Pointer to the scheduler instance. |
- Returns
- NRF_SUCCESS on success, otherwise error code.
size_t app_isched_get_max_utilization |
( |
const app_isched_t * |
p_isched | ) |
|
Get maximum scheduler utilization.
- Parameters
-
[in] | p_isched | Pointer to the scheduler instance. |
- Returns
- Maximum number of events stored in the scheduler.
Install app_isched hook.
- Parameters
-
[in] | p_isched | Pointer to the scheduler instance. |
[in] | hook_type | Hook type. |
[in] | hook | Hook or NULL if previously set hook should be removed. |
[in] | p_hook_context | Context, which will be passed to hook. |
- Returns
- NRF_SUCCESS on success, otherwise error code.
void* app_isched_event_t::p_context |
Pointer to the event context.
const nrf_queue_t* __app_isched_struct::p_event_queue |
void* __app_isched_struct::p_hook_contexts[APP_ISCHED_HOOKS_COUNT] |