]> oss.titaniummirror.com Git - rgblamp.git/commit
Better cross-platform handling of time calcs
authorR. Steve McKown <rsmckown@gmail.com>
Sun, 1 Jan 2012 02:11:32 +0000 (19:11 -0700)
committerR. Steve McKown <rsmckown@gmail.com>
Sun, 1 Jan 2012 03:03:49 +0000 (20:03 -0700)
commit63426eb2c3d465e0099bf425e7552457abfb867b
treef07de2813a301ec66d299136be963b14eee3d4a1
parenta3982b963fd174f5d267e88ad97388f1697f6f83
Better cross-platform handling of time calcs

Thanks to integral promotion, a C compiler might treat the intermediate
value (t1 - t0) as a larger signed value when t1 and t0 are unsigned
values.  Cast the intermediate result to unsigned in these cases, as
this is necessary to get the correct result in the case of timer value
roll-over.
tmr.c
tmr.h