X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=main.c;h=b998176d06e98b1a497434ee09c715b72f419b3b;hb=de357789eb6d3abf5f8f975c0f550b9ceb9e7d2a;hp=4f36d146b1133f58aa7e32e07ddd4c05f9fc5831;hpb=2c4f2499bc815bd573dc0ebc4733b64329ac824b;p=rgblamp.git diff --git a/main.c b/main.c index 4f36d14..b998176 100644 --- a/main.c +++ b/main.c @@ -28,11 +28,11 @@ #include #include #include "picinit.h" +#include "unused.h" #include "buttons.h" #include "rgb.h" -#include "unused.h" +#include "timer.h" -#define STEP_SIZE 32 /* ms */ #define reset_steps() do { incolor_steps = 1; fade_steps = 0; } \ while (0) #define rand_u8() (rand() & 0xff) @@ -90,6 +90,7 @@ int main(void) unused_init(); buttons_init(); rgb_init(); + timer_init(); dbgpin_init(); reset_steps(); @@ -153,7 +154,7 @@ int main(void) wht.remainder = neww - (wht.value + wht.increment * fade_steps); } dbgpin_low(); - __delay_ms(STEP_SIZE); /* step should be start to start... */ + timer_owait(); /* wait 32 ms since last return from last call() */ dbgpin_high(); } else { rgb_off();