X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=timer.c;fp=timer.c;h=0000000000000000000000000000000000000000;hb=5fa3659d382d2055d1bdb1c06b6b82dcfc68bb95;hp=0975cb8893b96694e8ef38c8005cab10c09cba2a;hpb=2c0e3168697a040a21ee29a8dfe68d266fc98298;p=rgblamp.git diff --git a/timer.c b/timer.c deleted file mode 100644 index 0975cb8..0000000 --- a/timer.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * File: timer.c - * - * Timer 0 + Timer 1 for timekeeping - */ - - -#include -#include "timer.h" - -void timer_uwait(unsigned us) -{ - unsigned t0 = TMR0; - - TMR0IF = 0; - while (us >= 32768) { - timer_owait(); - us -= 32768; - } - while (us >= 16384) { - timer_cwait(128); - us -= 16384; - } - timer_cwait(us / 128); -} - -void timer_mwait(unsigned ms) -{ - unsigned t0 = TMR0; - - TMR0IF = 0; - while (ms >= 32) { - timer_owait(); - ms -= 32; - } - while (ms >= 16) { - timer_cwait(128); - ms -= 16; - } - timer_cwait(ms * 8); -}