Browse Source

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
robert-hh 2 years ago
committed by Damien George
parent
commit
f000ac9e82
  1. 6
      extmod/network_wiznet5k.c

6
extmod/network_wiznet5k.c

@ -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

Loading…
Cancel
Save