Commit 10cc9ca7 authored by Alessandro Rubini's avatar Alessandro Rubini

arch-wrpc: use frame within ppi, save .5kB

Additionally, this reverses an if to remove an indentation level for
the good code.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent cf4556d2
...@@ -193,24 +193,21 @@ int wrc_ptp_update() ...@@ -193,24 +193,21 @@ int wrc_ptp_update()
} }
} }
if (ptp_enabled) { if (!ptp_enabled)
static unsigned char packet[500]; return 0;
/* i = ppi->n_ops->recv(ppi, ppi->rx_frame, PP_MAX_FRAME_LENGTH - 4,
* We got a packet. If it's not ours, continue consuming &ppi->last_rcv_time);
* the pending timeout
*/ if ((!i) && (timer_get_tics() - start_tics < delay_ms))
i = ppi->n_ops->recv(ppi, packet, sizeof(packet), return 0;
&ppi->last_rcv_time);
if ((!i) && (timer_get_tics() - start_tics < delay_ms)) if (!i) {
return 0; /* Nothing received, but timeout elapsed */
if (!i) { start_tics = timer_get_tics();
/* Nothing received, but timeout elapsed */ delay_ms = pp_state_machine(ppi, NULL, 0);
start_tics = timer_get_tics(); return 0;
delay_ms = pp_state_machine(ppi, NULL, 0);
return 0;
}
delay_ms = pp_state_machine(ppi, packet, i);
} }
delay_ms = pp_state_machine(ppi, ppi->rx_ptp, i);
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment