kopia lustrzana https://github.com/micropython/micropython
extmod/network_wiznet5k: Rearrange the function wiznet5k_poll().
To have just one exit and a more compact flag test. This is just a style change without impact to the functionality.pull/9032/head
rodzic
999b66d531
commit
f000ac9e82
|
@ -325,10 +325,7 @@ STATIC void wiznet5k_lwip_init(wiznet5k_obj_t *self) {
|
|||
|
||||
void wiznet5k_poll(void) {
|
||||
wiznet5k_obj_t *self = &wiznet5k_obj;
|
||||
if (!(self->netif.flags & NETIF_FLAG_UP) ||
|
||||
!(self->netif.flags & NETIF_FLAG_LINK_UP)) {
|
||||
return;
|
||||
}
|
||||
if ((self->netif.flags & (NETIF_FLAG_UP | NETIF_FLAG_LINK_UP)) == (NETIF_FLAG_UP | NETIF_FLAG_LINK_UP)) {
|
||||
uint16_t len;
|
||||
while ((len = wiznet5k_recv_ethernet(self)) > 0) {
|
||||
if (self->trace_flags & TRACE_ETH_RX) {
|
||||
|
@ -342,6 +339,7 @@ void wiznet5k_poll(void) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
wizchip_clrinterrupt(IK_SOCK_0);
|
||||
#if _WIZCHIP_ == W5100S
|
||||
setSn_IR(0, Sn_IR_RECV); // W5100S driver bug: must write to the Sn_IR register to reset the IRQ signal
|
||||
|
|
Ładowanie…
Reference in New Issue