summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
inline | side by side (from parent 1:
c179e47)
The give_device_time_to_process() routine unconditionally calculated
with a "time since last command transmission" value which may not have
been assigned to in the first invocation of a getter or setter.
Just don't sleep at all when nothing was sent before. Avoids a
dependency on implementation details of signed integer math.
+ if (!devc->req_sent_at)
+ return;
+
sleeping_time = devc->req_sent_at + (DEVICE_PROCESSING_TIME_MS * 1000);
sleeping_time -= g_get_monotonic_time();
sleeping_time = devc->req_sent_at + (DEVICE_PROCESSING_TIME_MS * 1000);
sleeping_time -= g_get_monotonic_time();