Skip to content
Open
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 @@ -51,6 +51,8 @@ Bare Metal Buttons library
:inner:
:members:

.. _api_event_scheduler:

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

Expand Down
51 changes: 51 additions & 0 deletions doc/nrf-bm/libraries/event_scheduler.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
.. _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.

The application must ensure that only events capable of being interleaved with other interrupt processes are deferred.

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>`
2 changes: 1 addition & 1 deletion doc/nrf-bm/release_notes/release_notes_changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ No changes since the latest nRF Connect SDK Bare Metal release.
Documentation
=============

No changes since the latest nRF Connect SDK Bare Metal release.
* Added documentation for the :ref:`lib_event_scheduler`.