From: Jan Dolezal Date: Thu, 8 Aug 2013 13:56:09 +0000 (+0200) Subject: changes for TMS570 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/pes-rpp/rpp-lwip.git/commitdiff_plain/f2169543aca39c38bb610cab1f554e9b888c1338 changes for TMS570 --- diff --git a/src/arch/sys_arch.c b/src/arch/sys_arch.c index efa3464f..266ade17 100644 --- a/src/arch/sys_arch.c +++ b/src/arch/sys_arch.c @@ -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 */ diff --git a/src/include/arch/cc.h b/src/include/arch/cc.h index b22709ca..819db79a 100644 --- a/src/include/arch/cc.h +++ b/src/include/arch/cc.h @@ -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 diff --git a/src/include/arch/lwipopts.h b/src/include/arch/lwipopts.h index 4ffd93fc..44a6b154 100644 --- a/src/include/arch/lwipopts.h +++ b/src/include/arch/lwipopts.h @@ -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 /***************************************************************************** diff --git a/src/include/arch/sys_arch.h b/src/include/arch/sys_arch.h index d49f6c2f..0d418d5e 100644 --- a/src/include/arch/sys_arch.h +++ b/src/include/arch/sys_arch.h @@ -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__ */ diff --git a/src/include/lwip/debug.h b/src/include/lwip/debug.h index 0fe04139..cd5bf89a 100644 --- a/src/include/lwip/debug.h +++ b/src/include/lwip/debug.h @@ -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 */