mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #9231 from kjbracey-arm/critical_volatile
critical sections: remove unnecessary volatilepull/9599/head
commit
965f15da82
|
@ -21,8 +21,8 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
|
||||
static volatile bool critical_interrupts_enabled = false;
|
||||
static volatile bool state_saved = false;
|
||||
static bool critical_interrupts_enabled = false;
|
||||
static bool state_saved = false;
|
||||
|
||||
static bool are_interrupts_enabled(void)
|
||||
{
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
static volatile uint32_t critical_section_reentrancy_counter = 0;
|
||||
static uint32_t critical_section_reentrancy_counter = 0;
|
||||
|
||||
bool core_util_are_interrupts_enabled(void)
|
||||
{
|
||||
|
@ -77,11 +77,11 @@ bool core_util_in_critical_section(void)
|
|||
|
||||
void core_util_critical_section_enter(void)
|
||||
{
|
||||
hal_critical_section_enter();
|
||||
|
||||
// If the reentrancy counter overflows something has gone badly wrong.
|
||||
MBED_ASSERT(critical_section_reentrancy_counter < UINT32_MAX);
|
||||
|
||||
hal_critical_section_enter();
|
||||
|
||||
++critical_section_reentrancy_counter;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue