]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/blobdiff - src/include/arch/cc.h
lwip debug print functions
[pes-rpp/rpp-lwip.git] / src / include / arch / cc.h
index 68e69de0ed55857a1bd036ba4c924c02a7d7b9b8..35500194dd0b02ec3fb5e13ec6109582d91c6fc2 100644 (file)
@@ -115,10 +115,21 @@ typedef u32_t               mem_ptr_t;
 #define LWIP_CHKSUM_ALGORITHM 2
 #endif
 
+#ifdef LWIP_DEBUG
+
+extern int32_t rpp_sci_printf(const char* format, ...);
+#define LWIP_PLATFORM_DIAG(expr)        rpp_sci_printf expr
+
+#else
+#define LWIP_PLATFORM_DIAG(expr)
+#endif
+
 //#define DEBUG
 #ifdef DEBUG
 
-#define LWIP_PLATFORM_DIAG(expr)        LWIP_PLATFORM_ASSERT(expr)
+/* for passing arguments to print function */
+#define CC_ASSERT(message, assertion) do { if(!(assertion)) \
+  LWIP_PLATFORM_DIAG(message); } while(0)
 
 //extern void __error__(char *pcFilename, unsigned long ulLine);
 extern int32_t rpp_sci_printkb(const char* format, ...);
@@ -133,6 +144,7 @@ extern int32_t rpp_sci_printkb(const char* format, ...);
 */
 #else
 #define LWIP_PLATFORM_ASSERT(expr)
+#define CC_ASSERT(message, assertion)
 #endif /* DEBUG */
 
 /* "lightweight" synchronization mechanisms */