Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
features/FEATURE_COMMON_PAL/nanostack-hal-mbed-cmsis-rtos/arm_hal_interrupt.c
- Committer:
- calmantara186
- Date:
- 2018-02-22
- Revision:
- 1:2b6e8130a0ac
- Parent:
- 0:f269e3021894
File content as of revision 1:2b6e8130a0ac:
/*
* Copyright (c) 2016 ARM Limited, All Rights Reserved
*/
#include "arm_hal_interrupt.h"
#include "arm_hal_interrupt_private.h"
#include "cmsis_os.h"
static uint8_t sys_irq_disable_counter;
static osMutexDef(critical);
static osMutexId critical_mutex_id;
void platform_critical_init(void)
{
critical_mutex_id = osMutexCreate(osMutex(critical));
}
void platform_enter_critical(void)
{
osMutexWait(critical_mutex_id, osWaitForever);
sys_irq_disable_counter++;
}
void platform_exit_critical(void)
{
--sys_irq_disable_counter;
osMutexRelease(critical_mutex_id);
}