X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=timer.h;h=20e0c8bc9258b1def182068122b60ac2ad4853ed;hb=250129a53a803f2c5c1359f89f1e9a834e8c37a7;hp=c28ed0b93b34d844f196a0b359645a579ec70e19;hpb=d4a9d87f2396d59c36cfdff81ff651bd0c40dff0;p=rgblamp.git diff --git a/timer.h b/timer.h index c28ed0b..20e0c8b 100644 --- a/timer.h +++ b/timer.h @@ -44,7 +44,7 @@ #define timer_cwait(c) \ { \ unsigned t0 = TMR0; \ - while ((TMR0 - t0) <= c); \ + while ((unsigned)(TMR0 - t0) <= c); /* cast prevents integral promotion */ \ } while (0) void timer_uwait(unsigned us);