#include <assert.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <cmsis-plus/diag/trace.h>
#include <cmsis-plus/rtos/os-c-api.h>
Go to the source code of this file.
|
| void | __assert_func (const char *file, int line, const char *func, const char *failedexpr) |
| |
◆ __assert_func()
| void __assert_func |
( |
const char * |
file, |
|
|
int |
line, |
|
|
const char * |
func, |
|
|
const char * |
failedexpr |
|
) |
| |
Definition at line 51 of file assert.c.
53{
55
56
57
58#if defined(TRACE)
59
63 if (func != NULL)
64 {
66 }
68 {
70 {
74 }
75 }
76
77#elif defined(OS_USE_SEMIHOSTING_SYSCALLS)
78
79 printf (
"assertion \"%s\" failed\n", failedexpr);
80 printf (
"file: \"%s\"\n", file);
81 printf (
"line: %d\n", line);
82 if (func != NULL)
83 {
84 printf (
"function: %s\n", func);
85 }
87 {
89 {
90 printf (
"this_thread: %s @%p\n",
92 }
93 }
94
95#endif
97
98}
int printf(const char *format,...)
Write a formatted string to the trace device.
bool os_irq_in_handler_mode(void)
Check if the CPU is in handler mode.
os_irq_state_t os_irq_critical_enter(void)
Enter an interrupts critical section.
const char * os_thread_get_name(os_thread_t *thread)
Get the thread name.
os_thread_t * os_this_thread(void)
Get the current running thread.
int trace_printf(const char *format,...)
References abort(), os_irq_critical_enter(), os_irq_in_handler_mode(), os_this_thread(), os_thread_get_name(), and trace_printf().