1 parent 600ccb7 commit 8a579dfCopy full SHA for 8a579df
2 files changed
lib/onchip/Util/Assert.cpp
@@ -0,0 +1,24 @@
1
+
2
+#include "Assert.h"
3
4
+//#define DEBUG_USE_USART
5
6
+#ifdef DEBUG_USE_USART
7
+#include "USART.h"
8
+extern USART log;
9
+#define LOG(str) log<<str
10
11
+#else
12
+#define LOG(str)
13
+#endif
14
15
+void assert_failed(uint8_t* file, uint32_t line)
16
+{
17
+ LOG("!!!!!assert fail!!!!!");
18
+ LOG("\n==================\nfile:");
19
+ LOG((const char*)file);
20
+ LOG("\nline:");
21
+ LOG((const char*)line);
22
+ LOG("\n==================\n");
23
+ while(1);
24
+}
lib/onchip/Util/Assert.h
@@ -0,0 +1,19 @@
+#ifndef __ASSERT_H
+#define __ASSERT_H
+#ifdef __cplusplus
+extern "C"
+#include "stm32f10x_conf.h"
+#define assert(pass) assert_param(pass)
0 commit comments