webradio/firmware/systick.h

21 lines
438 B
C
Raw Normal View History

2020-07-27 21:39:29 +02:00
#ifndef SYSTICK_H
#define SYSTICK_H
#include <avr/io.h>
#define TIMID_SW_DEBOUNCE 0
#define TIMID_SW_LONGPRESS 1
2020-07-31 19:07:11 +02:00
#define TIMID_POWEROFF 2
#define NTIM 3
2020-07-27 21:39:29 +02:00
#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