webradio/firmware/systick.h

20 lines
413 B
C

#ifndef SYSTICK_H
#define SYSTICK_H
#include <avr/io.h>
#define TIMID_SW_DEBOUNCE 0
#define TIMID_SW_LONGPRESS 1
#define NTIM 2
#define MS_TO_TICKS(ms) (((ms/1000 * F_CPU/1024) / 256))
#define SYSTICK_VAL TCNT1H
void timer_proc();
void systick_init();
uint8_t timer_expired(uint8_t tim_id);
void timer_set(uint8_t tim_id, uint8_t ticks);
uint8_t block_for(uint8_t tim_id, uint8_t ticks);
#endif // SYSTICK_H