]> 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 819db79ae9a0b2640e46ea084f7312b6e4ba3d6a..35500194dd0b02ec3fb5e13ec6109582d91c6fc2 100644 (file)
@@ -115,14 +115,25 @@ 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)
+/* 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_printf(const char* format, ...);
-#define LWIP_PLATFORM_ASSERT(expr)      rpp_sci_printf((const char *) expr)
+extern int32_t rpp_sci_printkb(const char* format, ...);
+#define LWIP_PLATFORM_ASSERT(expr)      rpp_sci_printkb((const char *) expr)
 /*
 {                                       \
     if(!(expr))                         \
@@ -133,6 +144,7 @@ extern int32_t rpp_sci_printf(const char* format, ...);
 */
 #else
 #define LWIP_PLATFORM_ASSERT(expr)
+#define CC_ASSERT(message, assertion)
 #endif /* DEBUG */
 
 /* "lightweight" synchronization mechanisms */