Skip to content

Commit 5e62c37

Browse files
committed
Critical - use mbed assert
uARM complained about assert: ``` Error: L6218E: Undefined symbol __aeabi_assert (referred from critical.o). Finished: 0 information, 0 warning and 1 error messages. [ERROR] Error: L6218E: Undefined symbol __aeabi_assert (referred from critical.o). Finished: 0 information, 0 warning and 1 error messages. ```
1 parent c40581c commit 5e62c37

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hal/common/critical.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <stdint.h>
2020
#include <stddef.h>
2121
#include "cmsis.h"
22-
#include <assert.h>
22+
#include "mbed_assert.h"
2323

2424
// Module include
2525
#include "critical.h"
@@ -40,9 +40,9 @@ void core_util_critical_section_enter()
4040
/* If the interrupt_enable_counter overflows or we are in a nested critical section and interrupts
4141
are enabled, then something has gone badly wrong thus assert an error.
4242
*/
43-
assert(interrupt_enable_counter < UINT32_MAX);
43+
MBED_ASSERT(interrupt_enable_counter < UINT32_MAX);
4444
if (interrupt_enable_counter > 0) {
45-
assert(primask & 0x1);
45+
MBED_ASSERT(primask & 0x1);
4646
}
4747
interrupt_enable_counter++;
4848
}
@@ -54,7 +54,7 @@ void core_util_critical_section_exit()
5454

5555
uint32_t primask = __get_PRIMASK(); /* get the current interrupt enabled state */
5656

57-
assert(primask & 0x1); /* Interrupts must be disabled on invoking an exit from a critical section */
57+
MBED_ASSERT(primask & 0x1); /* Interrupts must be disabled on invoking an exit from a critical section */
5858

5959
interrupt_enable_counter--;
6060

0 commit comments

Comments
 (0)