]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
changes for TMS570
authorJan Dolezal <pm.jenik@gmail.com>
Thu, 8 Aug 2013 13:56:09 +0000 (15:56 +0200)
committerJan Dolezal <pm.jenik@gmail.com>
Thu, 8 Aug 2013 13:56:09 +0000 (15:56 +0200)
src/arch/sys_arch.c
src/include/arch/cc.h
src/include/arch/lwipopts.h
src/include/arch/sys_arch.h
src/include/lwip/debug.h

index efa3464f507e25282240cc7877b833c2157254a7..266ade174ffe92d7716f5a1ca9ea6ba229c7517b 100644 (file)
@@ -228,8 +228,19 @@ sys_prot_t sys_arch_protect(void)
     status = (IntMasterStatusGet() & 0xFF);
 
     _disable_IRQ();
+    _disable_FIQ();
     return status;
 }
+/*
+sys_prot_t sys_arch_protect(void)
+{
+    sys_prot_t status;
+    status = (IntMasterStatusGet() & 0xFF);
+
+    _disable_IRQ();
+    return status;
+}
+*/
 
 /**
  * This function is used to unlock access to critical sections when lwipopt.h
@@ -247,7 +258,20 @@ void sys_arch_unprotect(sys_prot_t lev)
     if((lev & 0x80) == 0) {
         _enable_IRQ();
     }
+    if((lev & 0x40) == 0) {
+        _enable_FIQ();
+    }
+}
+/*
+void sys_arch_unprotect(sys_prot_t lev)
+{*/
+    /* Only turn interrupts back on if they were originally on when the matching
+       sys_arch_protect() call was made. */
+/*    if((lev & 0xFF) == 0) {
+        _enable_IRQ();
+    }
 }
+*/
 
 #endif /* SYS_LIGHTWEIGHT_PROT */
 
index b22709caa5f2533df257f12bdb7295a8dcba94d4..819db79ae9a0b2640e46ea084f7312b6e4ba3d6a 100644 (file)
@@ -115,8 +115,6 @@ typedef u32_t               mem_ptr_t;
 #define LWIP_CHKSUM_ALGORITHM 2
 #endif
 
-
-/* TODO: make the debug work */
 //#define DEBUG
 #ifdef DEBUG
 
index 4ffd93fccb72e164951563132ab48cdf23a48e66..44a6b154b40a437035d102b7084f90fc6bcf318d 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               1
+#define STATIC_IP_ADDRESS               0
 
 /*****************************************************************************
 **            lwIP SPECIFIC DEFINITIONS - To be used by lwIP stack
@@ -67,7 +67,7 @@
 **                    TCPIP thread - used when NO_SYS defined to 0
 *****************************************************************************/
 #define TCPIP_THREAD_PRIO               0
-#define TCPIP_THREAD_STACKSIZE          500
+#define TCPIP_THREAD_STACKSIZE          1000
 
 /*****************************************************************************
 **                          Memory Options
@@ -87,7 +87,7 @@
 /*****************************************************************************
 **                           DHCP Options
 *****************************************************************************/
-#define LWIP_DHCP                       0
+#define LWIP_DHCP                       1
 #define DHCP_DOES_ARP_CHECK             0
 
 /*****************************************************************************
index d49f6c2f302ff6bc380c125817129fe00720b40e..0d418d5e6308ff4b0a0d168bc52714a6415e95fb 100644 (file)
@@ -85,41 +85,11 @@ typedef xSemaphoreHandle sys_mutex_t; /* *xQUEUE */
 #define TRYPOST_ISR_SAFE           0
 #define TRYFETCH_ISR_SAFE          0
 
-#endif /* !NO_SYS */
-
-#ifdef SYS_TEST_PROT_SEM
-
-#define SYS_ARCH_DECL_PROTECT(lev) xSemaphoreHandle lev; lev = xSemaphoreCreateCounting(5,0)
-
-#define SYS_ARCH_PROTECT(lev) sys_sem_wait(&lev)
-
-#define SYS_ARCH_UNPROTECT(lev) sys_sem_signal(&lev)
-
-#endif
-
-/* when used SYS_ARCH_PROTECT from sys.h, then it might cause instability of the system */
-#ifdef SYS_ARCH_PROTECT
-
-#if SYS_LIGHTWEIGHT_PROT
-
-#define SYS_ARCH_DECL_PROTECT(lev)
-
-#define SYS_ARCH_PROTECT(lev) portENTER_CRITICAL() /* consider putting here taskENTER_CRITICAL() ... freeRTOS */
-
-#define SYS_ARCH_UNPROTECT(lev) portEXIT_CRITICAL() /* consider putting here taskEXIT_CRITICAL() ... freeRTOS */
-//sys_prot_t sys_arch_protect(void);
-//void sys_arch_unprotect(sys_prot_t pval);
-
-#else /* SYS_LIGHTWEIGHT_PROT */
-
-#define SYS_ARCH_DECL_PROTECT(lev)
-#define SYS_ARCH_PROTECT(lev)
-#define SYS_ARCH_UNPROTECT(lev)
-
-#endif /* SYS_LIGHTWEIGHT_PROT */
-
-#endif /* SYS_ARCH_PROTECT */
+/* 1 - semaphores are used to protect critical sections; 0 - interrupt disable is used to protect critical sections */
+/* because of FIQ using for irq */
+//#define SYS_ARCH_SEMPHR_PROTECT    1
 
+#endif /* !NO_SYS */
 
 #endif /* __ARCH_SYS_ARCH_H__ */
 
index 0fe041396fcea28411e62b48e500c8c1512c857d..cd5bf89a8620af39dfede91321efb2116295e439 100644 (file)
@@ -75,7 +75,7 @@
   LWIP_PLATFORM_ASSERT(message); handler;}} while(0)
 #endif /* LWIP_ERROR */
 
-#ifdef LWIP_DEBUG
+#ifndef LWIP_DEBUG
 /** print debug message only if debug message type is enabled...
  *  AND is of correct type AND is at least LWIP_DBG_LEVEL
  */