diff options
Diffstat (limited to 'client/main.c')
-rw-r--r-- | client/main.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/client/main.c b/client/main.c index 00f686a..b5af0e8 100644 --- a/client/main.c +++ b/client/main.c @@ -1,15 +1,13 @@ #include "main.h" -#include "../shared/errcatch.h" #include "../shared/consts.h" +#include "../shared/errcatch.h" +#include "commands.h" #include "serial.h" #include "setup.h" -#include "ui.h" #include "time.h" -#include "commands.h" +#include "ui.h" -w2_s_client_state g_w2_state = { - .ping_received = true -}; +w2_s_client_state g_w2_state = {.ping_received = true}; int main(int argc, char **argv) { w2_client_setup(argc, argv); @@ -21,12 +19,13 @@ int main(int argc, char **argv) { if (!g_w2_state.ping_received && w2_timer_end(W2_TIMER_PING) > W2_PING_TIMEOUT) { g_w2_state.ping_timeout = true; - g_w2_state.connected = false; + g_w2_state.connected = false; w2_errcatch_throw(W2_E_WARN_PING_TIMEOUT); } - - if ((g_w2_state.ping_received && w2_timer_end(W2_TIMER_PING) > W2_PING_FREQUENCY) || g_w2_state.ping_timeout) { - g_w2_state.ping_timeout = false; + + if ((g_w2_state.ping_received && w2_timer_end(W2_TIMER_PING) > W2_PING_FREQUENCY) || + g_w2_state.ping_timeout) { + g_w2_state.ping_timeout = false; g_w2_state.ping_received = false; w2_send_ping(); } |