21 #include <app_util_platform.h> 23 #include <lib/assert.h> 25 static uint32_t IrqDisableCounter;
27 STATIC_ASSERT(APP_IRQ_PRIORITY_HIGH != 0);
29 void app_util_disable_irq(
void)
35 void app_util_enable_irq(
void)
37 assert(IrqDisableCounter);
38 if (--IrqDisableCounter == 0)
42 void app_util_critical_region_enter(uint8_t *p_nested)
45 *p_nested = __get_BASEPRI();
46 __set_BASEPRI_MAX(APP_IRQ_PRIORITY_HIGH << (8U - __NVIC_PRIO_BITS));
50 void app_util_critical_region_exit(uint8_t nested)
52 __set_BASEPRI(nested);