#include "timer.h" #include "global.h" #include static volatile unsigned long ticks = 0; SIGNAL(SIG_OVERFLOW0) { ticks++; } void sleep(unsigned long ms) { unsigned long t = ticks + ms * (F_CPU/TIMER_PRESCALER/256000); while(ticks < t); }