SmartSnippets DA1459x SDK
Files | Functions | Variables

Interrupt priority configuration. More...

Files

file  interrupts.h
 Interrupt priority configuration.
 

Functions

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

Variables

const int8_t __dialog_interrupt_priorities []
 Default interrupt priorities table. More...
 

Detailed Description

Interrupt priority configuration.

Function Documentation

◆ in_interrupt()

__STATIC_FORCEINLINE bool in_interrupt ( void  )

Check whether running in interrupt context.

Returns
true if the CPU is serving an interrupt.

◆ 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)
PRIORITY_1, // Start interrupts with priority 1
BLE_WAKEUP_LP_IRQn,
BLE_GEN_IRQn,
FTDF_WAKEUP_IRQn,
FTDF_GEN_IRQn,
PRIORITY_2,
PRIORITY_3,
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

Variable Documentation

◆ __dialog_interrupt_priorities

const int8_t __dialog_interrupt_priorities[]

Default interrupt priorities table.

__dialog_interrupt_priorities
const int8_t __dialog_interrupt_priorities[]
Default interrupt priorities table.
UART_IRQn
Definition: DA1459x-00.h:86
SVCall_IRQn
Definition: DA1459x-00.h:78
SRC_OUT_IRQn
Definition: DA1459x-00.h:93
PendSV_IRQn
Definition: DA1459x-00.h:80
UART2_IRQn
Definition: DA1459x-00.h:87
SRC_IN_IRQn
Definition: DA1459x-00.h:92
SysTick_IRQn
Definition: DA1459x-00.h:81