| 197 | * @param function 函数名 |
| 198 | */ |
| 199 | extern "C" [[noreturn]] void __assert_fail(const char* assertion, |
| 200 | const char* file, unsigned int line, |
| 201 | const char* function) { |
| 202 | klog::RawPut("\n[ASSERT FAILED] "); |
| 203 | klog::RawPut(file); |
| 204 | etl_putchar(':'); |
| 205 | char buf_line[12]; |
| 206 | auto* end = etl::format_to_n(buf_line, sizeof(buf_line) - 1, "{}", line); |
| 207 | *end = '\0'; |
| 208 | klog::RawPut(" in "); |
| 209 | klog::RawPut(function); |
| 210 | klog::RawPut("\n Expression: "); |
| 211 | klog::RawPut(assertion); |
| 212 | etl_putchar('\n'); |
| 213 | while (1) { |
| 214 | cpu_io::Pause(); |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * c++ 全局对象构造 |
nothing calls this directly
no test coverage detected