From a1892b59a906042a42ef580b11736cc186994baa Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 30 Sep 2009 19:41:57 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1197 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7X-WEB-GCC/main.c | 1 - demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c | 24 ++++++++------------ 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/main.c b/demos/ARM7-AT91SAM7X-WEB-GCC/main.c index e2d3e8cd8..639af1f46 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/main.c @@ -21,7 +21,6 @@ #include #include #include -#include #include "board.h" diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c b/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c index 986d7fb03..ceb9ebcd1 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c @@ -33,8 +33,7 @@ #define IPADDR2 1 #define IPADDR3 20 -#define SEND_RETRY_MAX 10 -#define SEND_RETRY_INTERVAL 2 +#define SEND_TIMEOUT 50 static const struct uip_eth_addr macaddr = { {0xC2, 0xAF, 0x51, 0x03, 0xCF, 0x46} @@ -46,22 +45,17 @@ static const struct uip_eth_addr macaddr = { * uIP send function wrapping the EMAC functions. */ static void network_device_send(void) { - int i; MACTransmitDescriptor td; - for (i = 0; i < SEND_RETRY_MAX; i++) { - if (macWaitTransmitDescriptor(Ð1, &td, TIME_IMMEDIATE) == RDY_OK) { - if(uip_len <= UIP_LLH_LEN + UIP_TCPIP_HLEN) - macWriteTransmitDescriptor(&td, uip_buf, uip_len); - else { - macWriteTransmitDescriptor(&td, uip_buf, UIP_LLH_LEN + UIP_TCPIP_HLEN); - macWriteTransmitDescriptor(&td, uip_appdata, - uip_len - (UIP_LLH_LEN + UIP_TCPIP_HLEN)); - } - macReleaseTransmitDescriptor(&td); - return; + if (macWaitTransmitDescriptor(Ð1, &td, MS2ST(SEND_TIMEOUT)) == RDY_OK) { + if(uip_len <= UIP_LLH_LEN + UIP_TCPIP_HLEN) + macWriteTransmitDescriptor(&td, uip_buf, uip_len); + else { + macWriteTransmitDescriptor(&td, uip_buf, UIP_LLH_LEN + UIP_TCPIP_HLEN); + macWriteTransmitDescriptor(&td, uip_appdata, + uip_len - (UIP_LLH_LEN + UIP_TCPIP_HLEN)); } - chThdSleep(SEND_RETRY_INTERVAL); + macReleaseTransmitDescriptor(&td); } /* Dropped... */ }