net:lwip modify Make.defs not to build stats.c if the stats feature is disable
authorkang <pilseob.kang@samsung.com>
Mon, 25 Sep 2017 01:29:29 +0000 (10:29 +0900)
committerkang <pilseob.kang@samsung.com>
Mon, 25 Sep 2017 01:45:26 +0000 (10:45 +0900)
os/include/net/lwip/opt.h
os/net/lwip/src/core/Make.defs
os/net/lwip/src/core/init.c
os/net/lwip/sys/arch/sys_arch.c

index 34ff016..44d30a0 100644 (file)
  * LWIP_STATS==1: Enable statistics collection in lwip_stats.
  */
 #ifndef LWIP_STATS
-#define LWIP_STATS                      1
+#define LWIP_STATS                      0
 #endif
 
 #if LWIP_STATS
index 15da460..591230a 100644 (file)
 
 
 LWIP_CSRCS += def.c dhcp.c init.c mem.c memp.c netif.c
-LWIP_CSRCS += pbuf.c raw.c stats.c sys.c tcp.c tcp_in.c tcp_out.c timers.c udp.c
+LWIP_CSRCS += pbuf.c raw.c sys.c tcp.c tcp_in.c tcp_out.c timers.c udp.c
 LWIP_CSRCS += dhcps.c
+ifeq ($(CONFIG_NET_STATS),y)
+LWIP_CSRCS += stats.c
+endif
 
 # Include core build support
 
index 19c8b12..c2b7776 100644 (file)
 void lwip_init(void)
 {
        /* Modules initialization */
+#if LWIP_STATS
        stats_init();
+#endif
 #if !NO_SYS
        sys_init();
 #endif                                                 /* !NO_SYS */
index 771ecf4..820be98 100644 (file)
@@ -50,7 +50,7 @@
 #define SYS_THREAD_MAX 6
 
 static u16_t s_nextthread = 0;
-
+static u32_t g_mbox_id = 0;
 /*---------------------------------------------------------------------------*
  * Routine:  sys_mbox_new
  *---------------------------------------------------------------------------*
@@ -64,10 +64,9 @@ static u16_t s_nextthread = 0;
  *---------------------------------------------------------------------------*/
 err_t sys_mbox_new(sys_mbox_t *mbox, int queue_sz)
 {
-
        err_t err = ERR_OK;
        mbox->is_valid = 1;
-       mbox->id = lwip_stats.sys.mbox.used + 1;
+       mbox->id = g_mbox_id++;
        mbox->queue_size = queue_sz;
        mbox->wait_send = 0;
        mbox->wait_fetch = 0;