PebbleOS
Loading...
Searching...
No Matches
Functions
Execution state

Exception and interrupt-mask state of the CPU. More...

Functions

static bool mcu_state_is_isr (void)
 Check whether the CPU is executing an exception handler.
 
static uint32_t mcu_state_get_isr_priority (void)
 Get the priority of the exception handler being executed.
 
bool mcu_state_are_interrupts_enabled (void)
 Check whether interrupts are globally enabled.
 

Detailed Description

Exception and interrupt-mask state of the CPU.

On host builds (unit tests) code never runs in an exception handler.

Function Documentation

◆ mcu_state_are_interrupts_enabled()

bool mcu_state_are_interrupts_enabled ( void  )

Check whether interrupts are globally enabled.

Returns
false if PRIMASK masks every configurable-priority interrupt.

◆ mcu_state_get_isr_priority()

static uint32_t mcu_state_get_isr_priority ( void  )
inlinestatic

Get the priority of the exception handler being executed.

Lower numbers mean higher priority. Handlers more urgent than PBL_IRQ_PRIO_MAX_SYSCALL must not call the kernel.

Returns
NVIC priority in controller units, or ~0 outside an exception handler.

◆ mcu_state_is_isr()

static bool mcu_state_is_isr ( void  )
inlinestatic

Check whether the CPU is executing an exception handler.

Returns
true in an ISR or fault handler.