nRF51 SDK - S110 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Utility Functions and Definitions (Platform)

Various types and definitions available to all applications when using SoftDevice. More...

Macros

#define NRF_APP_PRIORITY_THREAD   4
 
#define PACKED(TYPE)   __packed TYPE
 
#define CRITICAL_REGION_ENTER()
 Macro for entering a critical region. More...
 
#define CRITICAL_REGION_EXIT()
 Macro for leaving a critical region. More...
 

Enumerations

enum  app_irq_priority_t {
  APP_IRQ_PRIORITY_HIGH = 1,
  APP_IRQ_PRIORITY_LOW = 3
}
 The interrupt priorities available to the application while the SoftDevice is active.
 

Detailed Description

Various types and definitions available to all applications when using SoftDevice.

Macro Definition Documentation

#define CRITICAL_REGION_ENTER ( )
Value:
{ \
uint8_t IS_NESTED_CRITICAL_REGION = 0; \
uint32_t CURRENT_INT_PRI = current_int_priority_get(); \
if (CURRENT_INT_PRI != APP_IRQ_PRIORITY_HIGH) \
{ \
uint32_t ERR_CODE = sd_nvic_critical_region_enter(&IS_NESTED_CRITICAL_REGION); \
{ \
__disable_irq(); \
} \
else \
{ \
APP_ERROR_CHECK(ERR_CODE); \
} \
}

Macro for entering a critical region.

Note
Due to implementation details, there must exist one and only one call to CRITICAL_REGION_EXIT() for each call to CRITICAL_REGION_ENTER(), and they must be located in the same scope.
#define CRITICAL_REGION_EXIT ( )
Value:
if (CURRENT_INT_PRI != APP_IRQ_PRIORITY_HIGH) \
{ \
uint32_t ERR_CODE; \
__enable_irq(); \
ERR_CODE = sd_nvic_critical_region_exit(IS_NESTED_CRITICAL_REGION); \
{ \
APP_ERROR_CHECK(ERR_CODE); \
} \
} \
}

Macro for leaving a critical region.

Note
Due to implementation details, there must exist one and only one call to CRITICAL_REGION_EXIT() for each call to CRITICAL_REGION_ENTER(), and they must be located in the same scope.
#define NRF_APP_PRIORITY_THREAD   4

"Interrupt level" when running in Thread Mode.