Patched version of nrf51822 FOTA compatible driver, with GPTIO disabled, as it clashed with the mbed definitions...

Fork of nRF51822 by Nordic Semiconductor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers app_util_platform.c Source File

app_util_platform.c

00001 /* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is property of Nordic Semiconductor ASA.
00004  * Terms and conditions of usage are described in detail in NORDIC
00005  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *
00011  */
00012 
00013 #include "app_util_platform.h "
00014 
00015 static uint32_t m_in_critical_region = 0;
00016 
00017 void critical_region_enter(void)
00018 {
00019     __disable_irq();    
00020     m_in_critical_region++;    
00021 }
00022 
00023 void critical_region_exit(void)
00024 {
00025     m_in_critical_region--;    
00026     if (m_in_critical_region == 0)
00027     {
00028         __enable_irq();
00029     }
00030 }