Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/nrf-bm/api/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Bare Metal Buttons library
:inner:
:members:

.. _api_event_scheduler:

Bare Metal Event Scheduler library
==================================

Expand Down
49 changes: 49 additions & 0 deletions doc/nrf-bm/libraries/event_scheduler.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.. _lib_event_scheduler:

Event Scheduler
###############

.. contents::
:local:
:depth: 2

The event scheduler is used for transferring execution from the interrupt context to the main context.

Overview
********

In some applications, it is beneficial to defer the execution of certain interrupts, for example some SoftDevice interrupts, to the main application function.
This shortens the time spent in the interrupt service routine (ISR).
It also allows for lower priority events to be raised before the previous event is fully processed.

Configuration
*************

The library is enabled using the Kconfig system.
Set the :kconfig:option:`CONFIG_EVENT_SCHEDULER` Kconfig option to enable the library.

Use the :kconfig:option:`CONFIG_EVENT_SCHEDULER_BUF_SIZE` Kconfig option to set the size of the event scheduler buffer that the events are copied into.

Initialization
==============

The library is initialized automatically on application startup.

Usage
*****

The SoftDevice event handler can call the :c:func:`event_scheduler_defer` function to schedule an event for later execution in the main thread.
To process these deferred events, call the :c:func:`event_scheduler_process` function regularly in the main application function.

Dependencies
************

This library does not have any dependencies.

API documentation
*****************

| Header file: :file:`include/bm/event_scheduler.h`
| Source files: :file:`lib/event_scheduler/`

:ref:`Event Scheduler library API reference <api_event_scheduler>`
1 change: 1 addition & 0 deletions doc/nrf-bm/release_notes/release_notes_changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@ Documentation

* Added documentation for the :ref:`lib_bm_timer` library.
* Added documentation for the :ref:`lib_ble_adv`.
* Added documentation for the :ref:`lib_event_scheduler` library.
* Added documentation for the :ref:`lib_sensorsim` library.