X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=firmware%2Ftimer.h;h=2869caa2ceb24657e4baca029f262fe7bd33542f;hb=49b6b6ad84ec47b4f9eb9ef131975cc5b72372a2;hp=fa2cd863ae93f18220da8fc07785079091cda232;hpb=d8a31ed675778c08ca781beb62863c62d6f0bd94;p=model-railway-devices.git diff --git a/firmware/timer.h b/firmware/timer.h index fa2cd86..2869caa 100644 --- a/firmware/timer.h +++ b/firmware/timer.h @@ -1,9 +1,16 @@ #ifndef TIMER_H_ #define TIMER_H_ -typedef void TimerCallback(void); +#include -void timer_init(uint16_t, uint8_t); -void timer_set_callback(TimerCallback *); +#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