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
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 */
#define LWIP_CHKSUM_ALGORITHM 2
#endif
-
-/* TODO: make the debug work */
//#define DEBUG
#ifdef DEBUG
** 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
** 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
/*****************************************************************************
** DHCP Options
*****************************************************************************/
-#define LWIP_DHCP 0
+#define LWIP_DHCP 1
#define DHCP_DOES_ARP_CHECK 0
/*****************************************************************************
#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__ */
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
*/