X-Git-Url: http://git.scottworley.com/tattlekey/blobdiff_plain/a4a617fd9b53e294a057d1b01a6a8896658f2be3..7a3bc82f02480088052d4d583c89b7cd9c90f8cf:/client/tattlekey.c?ds=inline diff --git a/client/tattlekey.c b/client/tattlekey.c index 9d25585..5e829d1 100644 --- a/client/tattlekey.c +++ b/client/tattlekey.c @@ -94,7 +94,7 @@ void service_sleeps(int alarm, press_pile_t *pp) { press_t press; if (!get_press_due_for_resend(pp, now, &press)) signal_error_by_blinking(); - uint32_t ago = now - press.timestamp; + u32_t ago = now - press.timestamp; send_report_packet(press.seq, ago); press.send_count++; if (press.send_count < config_resend_count) { @@ -119,6 +119,8 @@ void service_queue() { switch (e.type) { case NEW_BUTTON_PRESS: { add_press(pp, &(press_t){e.buttonpress.timestamp, seq++, 0}); + if (seq == 0) + new_epoch(); } break; case RESEND_TIME: { /* OK, we're awake. Cool. Thanks! (We actually do the sends in the