Use proper 64-bit integer arithmetic for Hz calculation
authorTobias Jakobi <tjakobi@math.uni-bielefeld.de>
Wed, 1 Feb 2017 20:48:50 +0000 (21:48 +0100)
committerIan Kelling <ian@iankelling.org>
Wed, 1 Feb 2017 23:31:29 +0000 (15:31 -0800)
commit04261c1142b015c6995a1a635e5e8aa70bf873ca
treef4920dd6b0e7bcc5715fbf71fdda60c3f73eb8bc
parent7a9bfe10151578151ab96d0b7d83c527b2e6646c
Use proper 64-bit integer arithmetic for Hz calculation

The current code uses double floats, which makes no sense since
time differences are always integer and never fractional.

Also fix up the averaging code a bit.

This fixes some spurious wrong Hz values reported for
my Logitech Rumblepad 2.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
evhz.c