Loading...
Searching...
No Matches
riot::irq_lock Class Reference

RAII based IRQ lock. More...

Detailed Description

RAII based IRQ lock.

While this object is on the stack IRQ is disabled. During destruction it will be restored to the previous state.

Definition at line 26 of file irq.hpp.

#include <irq.hpp>

Public Member Functions

 irq_lock ()
 This sets the IRQ disable bit in the status register.
 
 ~irq_lock ()
 This restores the IRQ disable bit in the status register to the value saved during construction of the object.
 
 irq_lock (irq_lock const &irq)=delete
 
 irq_lock (irq_lock const &&irq)=delete
 

Static Public Member Functions

static bool is_locked () noexcept
 Test whether IRQs are currently enabled.
 
static bool is_isr () noexcept
 Check whether called from interrupt service routine.
 

Constructor & Destructor Documentation

◆ irq_lock()

riot::irq_lock::irq_lock ( )
inline

This sets the IRQ disable bit in the status register.

Definition at line 47 of file irq.hpp.

◆ ~irq_lock()

riot::irq_lock::~irq_lock ( )
inline

This restores the IRQ disable bit in the status register to the value saved during construction of the object.

See also
irq_disable

Definition at line 55 of file irq.hpp.

Member Function Documentation

◆ is_isr()

static bool riot::irq_lock::is_isr ( )
inlinestaticnoexcept

Check whether called from interrupt service routine.

Returns
in ISR context

Definition at line 40 of file irq.hpp.

◆ is_locked()

static bool riot::irq_lock::is_locked ( )
inlinestaticnoexcept

Test whether IRQs are currently enabled.

Returns
IRQ enabled

Definition at line 32 of file irq.hpp.


The documentation for this class was generated from the following file: