-
Notifications
You must be signed in to change notification settings - Fork 5
/
timers.h
42 lines (30 loc) · 788 Bytes
/
timers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// Created by Vladimir Schneider on 2018-01-28.
//
#include "stdint.h"
#ifndef MULTI_TASKER_TIMERS_H
#define MULTI_TASKER_TIMERS_H
typedef struct Timer {
Task *prev;
Task *next;
uint16_t ticks;
} Timer;
// for asm code, offsets to structure's fields
#define TIMER_TICK 4
#pragma callee_saves TickTime, WaitTicks
extern uint16_t TickTime();
extern void WaitTicks(uint16_t ticks);
#ifdef OPT_ADJUSTABLE_TICKS
#pragma callee_saves WaitTicksAdj
extern void WaitTicksAdj(uint16_t ticks);
#endif
#ifdef OPT_MILLI_TIMER
#pragma callee_saves WaitMillis
extern void WaitMillis(uint16_t millis);
#ifdef OPT_MILLI_TIMER
#pragma callee_saves WaitSecs
extern void WaitSecs(uint16_t secs);
#endif
#endif
extern void _TickTimerIsr()__interrupt;
#endif //MULTI_TASKER_TIMERS_H