diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-09-30 19:41:57 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-09-30 19:41:57 +0000 |
commit | a1892b59a906042a42ef580b11736cc186994baa (patch) | |
tree | 4072fa689d0751a327cd745d5df14eb65036a6f7 /demos | |
parent | c8d55aeb71e4a72423512f5f92528d24ffa0f2ad (diff) | |
download | ChibiOS-a1892b59a906042a42ef580b11736cc186994baa.tar.gz ChibiOS-a1892b59a906042a42ef580b11736cc186994baa.tar.bz2 ChibiOS-a1892b59a906042a42ef580b11736cc186994baa.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1197 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r-- | demos/ARM7-AT91SAM7X-WEB-GCC/main.c | 1 | ||||
-rw-r--r-- | 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 <pal.h>
#include <test.h>
#include <serial.h>
-#include <sam7x_emac.h>
#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... */
}
|