usec can only count to one million. Put overflow into sec.

This commit is contained in:
Chris Osborn 2018-03-18 16:01:22 -07:00
parent 4f6aedf2fe
commit d20d5685d4

View File

@ -338,9 +338,13 @@ void *run_bridge(void *arg)
ptimer = NULL; ptimer = NULL;
if (cfg->cmd_mode == FALSE) { if (cfg->cmd_mode == FALSE) {
if (cfg->pre_break_delay == FALSE || cfg->break_len == 3) { if (cfg->pre_break_delay == FALSE || cfg->break_len == 3) {
long long usec;
LOG(LOG_ALL, "Setting timer for break delay"); LOG(LOG_ALL, "Setting timer for break delay");
timer.tv_sec = 0; usec = cfg->s[SRegisterGuardTime] * 20000;
timer.tv_usec = cfg->s[SRegisterGuardTime] * 20000; timer.tv_sec = usec / 1000000;
timer.tv_usec = usec % 1000000;
ptimer = &timer; ptimer = &timer;
} }
else if (cfg->pre_break_delay == TRUE && cfg->break_len > 0) { else if (cfg->pre_break_delay == TRUE && cfg->break_len > 0) {