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.
Fork of mbed-os by
arm_hal_interrupt.c
00001 /* 00002 * Copyright (c) 2016 ARM Limited, All Rights Reserved 00003 */ 00004 00005 #include "arm_hal_interrupt.h" 00006 #include "arm_hal_interrupt_private.h" 00007 #include "cmsis_os.h" 00008 00009 00010 static uint8_t sys_irq_disable_counter; 00011 00012 static osMutexDef(critical); 00013 static osMutexId critical_mutex_id; 00014 00015 void platform_critical_init(void) 00016 { 00017 critical_mutex_id = osMutexCreate(osMutex(critical)); 00018 } 00019 00020 void platform_enter_critical(void) 00021 { 00022 osMutexWait(critical_mutex_id, osWaitForever); 00023 sys_irq_disable_counter++; 00024 } 00025 00026 void platform_exit_critical(void) 00027 { 00028 --sys_irq_disable_counter; 00029 osMutexRelease(critical_mutex_id); 00030 }
Generated on Tue Jul 12 2022 13:15:24 by
