Provides support for assertions and logging failure data.
◆ MMOSAL_ASSERT
| #define MMOSAL_ASSERT |
( |
|
expr | ) |
|
Value: do { \
if (!(expr)) { \
MMOSAL_LOG_FAILURE_INFO(0); \
mmosal_impl_assert(); \
while (1) \
{} \
} \
} while (0)
Assert that the given expression evaluates to true and abort execution if not.
- Parameters
-
| expr | Expression to evaluation. If it evaluates to false then the assertion handler will be triggered. |
Definition at line 967 of file mmosal.h.
◆ MMOSAL_ASSERT_LOG_DATA
| #define MMOSAL_ASSERT_LOG_DATA |
( |
|
expr, |
|
|
|
... |
|
) |
| |
Value: do { \
if (!(expr)) { \
MMOSAL_LOG_FAILURE_INFO(__VA_ARGS__); \
mmosal_impl_assert(); \
while (1) \
{} \
} \
} while (0)
Assert that the given expression evaluates to true and abort execution if not.
- Parameters
-
| expr | Expression to evaluation. If it evaluates to false then the assertion handler will be triggered. |
| ... | Up to 4 32-bit unsigned integers to log. |
Definition at line 986 of file mmosal.h.
◆ MMOSAL_FILEID
File identifier: if not provided by compiler then define to zero.
Definition at line 904 of file mmosal.h.
◆ MMOSAL_LOG_FAILURE_INFO
| #define MMOSAL_LOG_FAILURE_INFO |
( |
|
... | ) |
|
Value: do { \
void *pc; \
.
lr = (uint32_t)MMPORT_GET_LR(), \
.line = __LINE__, \
.platform_info = { __VA_ARGS__ }, \
}; \
MMPORT_GET_PC(pc); \
info.pc = (uint32_t)pc; \
mmosal_log_failure_info(&info); \
} while (0)
#define MMOSAL_FILEID
File identifier: if not provided by compiler then define to zero.
Data structure used to store information about a failure that can be preserved across reset.
uint32_t lr
Content of the LR register at assertion.
Initialize a mmosal_failure_info struct based on current state and invoke mmosal_log_failure_info().
Definition at line 937 of file mmosal.h.
◆ mmosal_impl_assert()
| void mmosal_impl_assert |
( |
void |
| ) |
|
Assertion handler implementation.
- Note
- This function does not return.
◆ mmosal_log_failure_info()
Log failure information in a way that it is preserved across reboots so that it can be available for postmortem analysis.
- Parameters
-
| info | Failure information to log. |