X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=common%2Ftimer.h;fp=common%2Ftimer.h;h=2869caa2ceb24657e4baca029f262fe7bd33542f;hb=9c37d18b9c70fdb70dfec453398c4649e9e57586;hp=0000000000000000000000000000000000000000;hpb=49b6b6ad84ec47b4f9eb9ef131975cc5b72372a2;p=model-railway-devices.git diff --git a/common/timer.h b/common/timer.h new file mode 100644 index 0000000..2869caa --- /dev/null +++ b/common/timer.h @@ -0,0 +1,16 @@ +#ifndef TIMER_H_ +#define TIMER_H_ + +#include + +#define TIMER_SET_CALLBACK(n, f) \ + ISR(TIMER ## n ## _COMPA_vect) \ + { \ + f(); \ + } + +void timer_start_hz(uint8_t, uint32_t, uint8_t); +void timer_start_us(uint8_t, uint32_t); +void timer_stop(uint8_t); + +#endif