Merge pull request #9231 from kjbracey-arm/critical_volatile

critical sections: remove unnecessary volatile
pull/9599/head
Martin Kojtal 2019-01-07 16:26:38 +00:00 committed by GitHub
commit 965f15da82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -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)
{

View File

@ -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;
}