Skip to content

Commit

Permalink
Reverted commit below as the cc65 bug in question is fixed.
Browse files Browse the repository at this point in the history
Rearranged some expressions to avoid triggering a cc65 bug. (reverse-merged from commit 7134da0)
  • Loading branch information
oliverschmidt committed Oct 8, 2013
1 parent c6474cc commit 2316c6b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions apps/shell/shell-netperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ print_local_stats(struct stats *s)
printf(" Total transfer time: %lu.%02lu seconds, %lu.%02lu packets/second\n",
(s->end - s->start) / CLOCK_SECOND,
((10 * (s->end - s->start)) / CLOCK_SECOND) % 10,
((s->sent * 1UL * CLOCK_SECOND) / (s->end - s->start)),
(((s->sent * 100UL * CLOCK_SECOND) / (s->end - s->start)) % 100));
((1UL * CLOCK_SECOND * s->sent) / (s->end - s->start)),
(((100UL * CLOCK_SECOND * s->sent) / (s->end - s->start)) % 100));

printf(" Average round-trip-time: %lu ms (%lu + %lu)\n",
(1000 * (s->total_rx_latency + s->total_tx_latency) / s->received) /
Expand All @@ -206,8 +206,8 @@ print_local_stats(struct stats *s)
((10000 * (s->power.tx - s->power0.tx))/total_time) % 100);

printf(" Packets received: %d.%lu%%, %d of %d\n",
s->received * 100 / s->sent,
(s->received * 10000L / s->sent) % 10,
100 * s->received / s->sent,
(10000L * s->received / s->sent) % 10,
s->received, s->sent);
}
/*---------------------------------------------------------------------------*/
Expand Down
2 changes: 1 addition & 1 deletion apps/shell/shell-rime-debug-runicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ recv_ruc(struct runicast_conn *c, const rimeaddr_t *from, uint8_t seqno)

printf("runicast message received from %d.%d, latency %lu ms, seqno %d, data '%.*s'\n",
from->u8[0], from->u8[1],
(latency * 1000L) / RTIMER_ARCH_SECOND,
(1000L * latency) / RTIMER_ARCH_SECOND,
seqno,
packetbuf_datalen() - COLLECT_MSG_HDRSIZE,
msg->data);
Expand Down
4 changes: 2 additions & 2 deletions apps/shell/shell-rime-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ recv_broadcast(struct broadcast_conn *c, const rimeaddr_t *from)

printf("broadcast message received from %d.%d, latency %lu ms, data '%.*s'\n",
from->u8[0], from->u8[1],
(latency * 1000L) / RTIMER_ARCH_SECOND,
(1000L * latency) / RTIMER_ARCH_SECOND,
packetbuf_datalen() - COLLECT_MSG_HDRSIZE,
msg->data);
}
Expand Down Expand Up @@ -201,7 +201,7 @@ recv_uc(struct unicast_conn *c, const rimeaddr_t *from)

printf("unicast message received from %d.%d, latency %lu ms, data '%.*s'\n",
from->u8[0], from->u8[1],
(latency * 1000L) / RTIMER_ARCH_SECOND,
(1000L * latency) / RTIMER_ARCH_SECOND,
packetbuf_datalen() - COLLECT_MSG_HDRSIZE,
msg->data);
}
Expand Down
6 changes: 3 additions & 3 deletions apps/shell/shell-rime-ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ recv_mesh(struct mesh_conn *c, const rimeaddr_t *from, uint8_t hops)
pingrecvtime = rtimer_arch_now();
#endif
snprintf(buf, sizeof(buf), "%lu ms (%lu + %lu), %d hops.",
((pingrecvtime - ping.pingtime) * 1000L) / RTIMER_ARCH_SECOND,
((ping.pongtime - ping.pingtime) * 1000L) / RTIMER_ARCH_SECOND,
((pingrecvtime - ping.pongtime) * 1000L) / RTIMER_ARCH_SECOND,
(1000L * (pingrecvtime - ping.pingtime)) / RTIMER_ARCH_SECOND,
(1000L * (ping.pongtime - ping.pingtime)) / RTIMER_ARCH_SECOND,
(1000L * (pingrecvtime - ping.pongtime)) / RTIMER_ARCH_SECOND,
hops);

shell_output_str(&rime_ping_command,
Expand Down

0 comments on commit 2316c6b

Please sign in to comment.