Modify to not missed the received data in EthernetInerface

In EthernetInerface, we added the measures so as not to miss the received data.
pull/1404/head
tomoyuki yamanaka 2015-11-02 10:49:41 +09:00
parent 6bdf53a4e8
commit 3d708b73dd
1 changed files with 5 additions and 0 deletions

View File

@ -24,9 +24,11 @@ static void rza1_recv_task(void *arg) {
struct eth_hdr *ethhdr;
u16_t recv_size;
struct pbuf *p;
int cnt;
while (1) {
sys_arch_sem_wait(&recv_ready_sem, 0);
for (cnt = 0; cnt < 16; cnt++) {
recv_size = ethernet_receive();
if (recv_size != 0) {
p = pbuf_alloc(PBUF_RAW, recv_size, PBUF_RAM);
@ -51,6 +53,9 @@ static void rza1_recv_task(void *arg) {
pbuf_free(p);
break;
}
}
} else {
break;
}
}
}