Skip to content

Commit 4118542

Browse files
committed
critical: fix non valid configuration
If any architecture is added, needs to update critical exclusive access. Also fixing if exclusive access is defined, we use the value.
1 parent b37f24a commit 4118542

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

platform/mbed_critical.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,21 @@
2525
#include "platform/mbed_toolchain.h"
2626

2727
// if __EXCLUSIVE_ACCESS rtx macro not defined, we need to get this via own-set architecture macros
28-
#ifndef __EXCLUSIVE_ACCESS
2928
#ifndef MBED_EXCLUSIVE_ACCESS
29+
#ifndef __EXCLUSIVE_ACCESS
3030
#if ((__ARM_ARCH_7M__ == 1U) || \
3131
(__ARM_ARCH_7EM__ == 1U) || \
3232
(__ARM_ARCH_8M_BASE__ == 1U) || \
3333
(__ARM_ARCH_8M_MAIN__ == 1U)) || \
3434
(__ARM_ARCH_7A__ == 1U)
3535
#define MBED_EXCLUSIVE_ACCESS 1U
36-
#else
36+
#elif (__ARM_ARCH_6M__ == 1U)
3737
#define MBED_EXCLUSIVE_ACCESS 0U
38+
#else
39+
#error "Unknown architecture for exclusive access"
3840
#endif
41+
#else
42+
#define MBED_EXCLUSIVE_ACCESS __EXCLUSIVE_ACCESS
3943
#endif
4044
#endif
4145

0 commit comments

Comments
 (0)