RAFW Flexible Software Package Documentation  Release v2.0.1

 
Interrupts

Functions

void set_interrupt_priorities (const int8_t prios[])
 Setup interrupt priorities. More...
 
__STATIC_INLINE bool in_interrupt (void)
 Check whether running in interrupt context. More...
 

Detailed Description

Interrupt priority configuration.

Files

file  interrupts.h
 Interrupt priority configuration.
 

Variables

const int8_t __dialog_interrupt_priorities []
 Default interrupt priorities table.
 

Function Documentation

◆ set_interrupt_priorities()

void set_interrupt_priorities ( const int8_t  prios[])

Setup interrupt priorities.

When CPU is reset all interrupts have some priority setup. Reset -3 NMI -2 HardFault -1 All other interrupts have configurable priority that is set to 0. If some interrupts should have priority other then default, this function should be called. Argument prios can specify only those interrupts that need to have value other than default. For memory efficiency table with priorities for each interrupt consist of interrupt priority tag PRIORITY_x followed by interrupts that should have this priority, interrupts names are from enum IRQn_Type.

Note
If interrupt priorities do not need to be changed dynamically at runtime, best way to specify static configuration is to create table named __dialog_interrupt_priorities that will be used automatically at startup.

Most convenient way to prepare such table is to use macros like in example below:

INTERRUPT_PRIORITY_CONFIG_START(__dialog_interrupt_priorities)
PRIORITY_0, // Start interrupts with priority 0 (highest)
SVCall_IRQn,
PendSV_IRQn,
SysTick_IRQn,
PRIORITY_1, // Start interrupts with priority 1
BLE_WAKEUP_LP_IRQn,
BLE_GEN_IRQn,
FTDF_WAKEUP_IRQn,
FTDF_GEN_IRQn,
PRIORITY_2,
SRC_IN_IRQn,
SRC_OUT_IRQn,
PRIORITY_3,
UART_IRQn,
UART2_IRQn,
INTERRUPT_PRIORITY_CONFIG_END

Table __dialog_interrupt_priorities can now be used to call this function. Table can specify all interrupts or only those that need to be changed.

Parameters
[in]priostable with interrupts and priorities to setup

◆ in_interrupt()

__STATIC_INLINE bool in_interrupt ( void  )

Check whether running in interrupt context.

Returns
true if the CPU is serving an interrupt.