uwb-core DPL (Decawave Porting Layer) error types More...

Detailed Description

uwb-core DPL (Decawave Porting Layer) error types

Author
Francisco Molina franc.nosp@m.ois-.nosp@m.xavie.nosp@m.r.mo.nosp@m.lina@.nosp@m.inri.nosp@m.a.fr

Definition in file dpl_os.h.

#include <assert.h>
#include <stdint.h>
#include <stdatomic.h>
#include "irq.h"
#include "dpl/dpl_types.h"
+ Include dependency graph for dpl_os.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef uint32_t dpl_sr_t
 CPU status register.
 

Functions

static uint32_t dpl_hw_enter_critical (void)
 Disable ISRs. More...
 
static void dpl_hw_exit_critical (uint32_t ctx)
 Restores ISR context. More...
 
static bool dpl_hw_is_in_critical (void)
 Check if is in critical section. More...
 

Variables

atomic_uint dpl_in_critical
 variable to check if ISR are disabled
 

Entering and exiting critical section defines

#define DPL_ENTER_CRITICAL(_sr)   (_sr = dpl_hw_enter_critical())
 
#define DPL_EXIT_CRITICAL(_sr)   (dpl_hw_exit_critical(_sr))
 
#define DPL_ASSERT_CRITICAL()   assert(dpl_hw_is_in_critical())
 

Function Documentation

◆ dpl_hw_enter_critical()

static uint32_t dpl_hw_enter_critical ( void  )
inlinestatic

Disable ISRs.

Returns
current isr context

Definition at line 58 of file dpl_os.h.

◆ dpl_hw_exit_critical()

static void dpl_hw_exit_critical ( uint32_t  ctx)
inlinestatic

Restores ISR context.

Parameters
[in]ctxISR context to restore.

Definition at line 71 of file dpl_os.h.

◆ dpl_hw_is_in_critical()

static bool dpl_hw_is_in_critical ( void  )
inlinestatic

Check if is in critical section.

Returns
true, if in critical section, false otherwise

Definition at line 83 of file dpl_os.h.