]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
lwip debug print functions
authorJan Dolezal <pm.jenik@gmail.com>
Fri, 23 Aug 2013 12:31:14 +0000 (14:31 +0200)
committerJan Dolezal <pm.jenik@gmail.com>
Mon, 2 Sep 2013 10:18:30 +0000 (12:18 +0200)
src/core/pbuf.c
src/include/arch/cc.h
src/include/arch/lwipopts.h
src/include/arch/sys_arch.h
src/include/lwip/pbuf.h

index 32c78e24f75c91a9f0fc441b952f71f687f25a0a..87b0feb093f7f516f6119dc4dc137257d4ccf5a8 100644 (file)
@@ -697,7 +697,7 @@ pbuf_free(struct pbuf *p)
   PERF_STOP("pbuf_free");
   /*** RPP - Notify driver that we got free space for it (FreeRTOS semaphore) ***/
 #if !NO_SYS
-  if (ref == 0 && type == PBUF_POOL)xSemaphoreGive(pbufFreed);
+  if (type == PBUF_POOL)xSemaphoreGive(pbufFreed);
 #endif
   /*** end driver notification ***/
   /* return number of de-allocated pbufs */
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 */
index 9629bad4a43fe2f46310403301f34425330006dc..edd609f55860546f7ad23764773be6c98da5ac1e 100644 (file)
@@ -49,7 +49,7 @@
 ** For Example, for IP Address 192.168.247.1, use the corresponding hex
 ** value 0xC0A8F701.
 */
-#define STATIC_IP_ADDRESS               0
+#define STATIC_IP_ADDRESS               1
 
 /*****************************************************************************
 **            lwIP SPECIFIC DEFINITIONS - To be used by lwIP stack
 /*****************************************************************************
 **                    Platform specific locking
 *****************************************************************************/
-#define SYS_LIGHTWEIGHT_PROT            1 /* critical sections */
-#define NO_SYS                          0
+#define SYS_LIGHTWEIGHT_PROT            0 /* critical sections */
+#define NO_SYS                          1
 
 /*****************************************************************************
 **                    TCPIP thread - used when NO_SYS defined to 0
 *****************************************************************************/
 #define TCPIP_THREAD_PRIO               0
-#define TCPIP_THREAD_STACKSIZE          1000
+#define TCPIP_THREAD_STACKSIZE          600
 
 /*****************************************************************************
 **                          Memory Options
 *****************************************************************************/
+//#define MEM_USE_POOLS                   1
 #define MEM_ALIGNMENT                   4 /* dflt 1 */
 #define MEM_SIZE                        (30 * 1024) /* 30K */ /* dflt 1600 */
 #define MEMP_NUM_PBUF                   48 /* dflt 16 */
@@ -87,7 +88,7 @@
 /*****************************************************************************
 **                           DHCP Options
 *****************************************************************************/
-#define LWIP_DHCP                       1
+#define LWIP_DHCP                       0
 #define DHCP_DOES_ARP_CHECK             0
 
 /*****************************************************************************
 #define DEFAULT_TCP_RECVMBOX_SIZE       10
 #define DEFAULT_ACCEPTMBOX_SIZE         10
 
+/*****************************************************************************
+**                          Statistics options
+*****************************************************************************/
+#define LWIP_STATS_DISPLAY              1
+
 /*****************************************************************************
 **                          Debugging options
 *****************************************************************************/
                                          |LWIP_DBG_STATE | LWIP_DBG_FRESH)
 
 #define ALL_DBG_ON                      0
+#define ALL_DBG_OFF                     0 /* higher priority than ALL_DBG_ON */
 
+#ifdef LWIP_DEBUG
+#if !ALL_DBG_OFF
 
 /**
  * ETHARP_DEBUG: Enable debugging in etharp.c.
  */
 #define IP6_DEBUG                       LWIP_DBG_OFF | ALL_DBG_ON
 
+#endif /* !ALL_DBG_OFF */
+#endif /* LWIP_DEBUG */
 
 #endif /* __LWIPOPTS_H__ */
index 66741cbdfaf6c59807e0fb18847ffe4ad2ce860d..a1da497a6757733842abca49233fa2745875617b 100644 (file)
@@ -53,8 +53,8 @@
 
 #define portQUEUE_OVERHEAD_BYTES 0
 
-/* 1 - semaphore/mutexe is used to protect critical sections; 0 - interrupt disable is used to protect critical sections */
-#define SYS_ARCH_SEMPHR_PROTECT    0 & !NO_SYS
+/* 1 - semaphore/mutex is used to protect critical sections; 0 - interrupt disable is used to protect critical sections */
+#define SYS_ARCH_SEMPHR_PROTECT    1 & !NO_SYS
 
 typedef u8_t sys_prot_t;
 
index 4f8dca8ace6b3eb6dec06b2986a6722a8f0399eb..160fa4b45357764a2cc0603db45a0358815c3448 100644 (file)
@@ -62,10 +62,10 @@ typedef enum {
 } pbuf_layer;
 
 typedef enum {
-  PBUF_RAM, /* pbuf data is stored in RAM */
-  PBUF_ROM, /* pbuf data is stored in ROM */
-  PBUF_REF, /* pbuf comes from the pbuf pool */
-  PBUF_POOL /* pbuf payload refers to RAM */
+  PBUF_RAM = 0, /* pbuf data is stored in RAM */
+  PBUF_ROM = 1, /* pbuf data is stored in ROM */
+  PBUF_REF = 2, /* pbuf comes from the pbuf pool */
+  PBUF_POOL = 3 /* pbuf payload refers to RAM */
 } pbuf_type;