git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1197 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
c8d55aeb71
commit
a1892b59a9
|
@ -21,7 +21,6 @@
|
|||
#include <pal.h>
|
||||
#include <test.h>
|
||||
#include <serial.h>
|
||||
#include <sam7x_emac.h>
|
||||
|
||||
#include "board.h"
|
||||
|
||||
|
|
|
@ -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... */
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue