From d20d5685d4024b148ece91d8d2e44044055e22de Mon Sep 17 00:00:00 2001 From: Chris Osborn Date: Sun, 18 Mar 2018 16:01:22 -0700 Subject: [PATCH] usec can only count to one million. Put overflow into sec. --- src/bridge.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bridge.c b/src/bridge.c index 410eeb0..6d38fe2 100644 --- a/src/bridge.c +++ b/src/bridge.c @@ -338,9 +338,13 @@ void *run_bridge(void *arg) ptimer = NULL; if (cfg->cmd_mode == FALSE) { if (cfg->pre_break_delay == FALSE || cfg->break_len == 3) { + long long usec; + + LOG(LOG_ALL, "Setting timer for break delay"); - timer.tv_sec = 0; - timer.tv_usec = cfg->s[SRegisterGuardTime] * 20000; + usec = cfg->s[SRegisterGuardTime] * 20000; + timer.tv_sec = usec / 1000000; + timer.tv_usec = usec % 1000000; ptimer = &timer; } else if (cfg->pre_break_delay == TRUE && cfg->break_len > 0) {