Skip to content

Commit 29678b2

Browse files
committed
core: move a bunch of timer specific defines from timer.h to timer.c
1 parent 2f4c9d5 commit 29678b2

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

timer.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@
5959

6060
#include <stdlib.h>
6161

62+
/* define internal timer to 10 milliseconds */
63+
#define ITIMER_TICK 10000
64+
65+
/* try to synchronize with system time every 5 seconds */
66+
#define TIMER_SYNC_TICKS 1000000
67+
68+
/* synchronize if drift is greater than internal timer tick */
69+
#define TIMER_MAX_DRIFT_TICKS ITIMER_TICK
70+
6271
/* list with all the registered timers */
6372
static struct os_timer *timer_list = NULL;
6473

timer.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,10 @@ typedef long long stime_t;
4444
typedef void (timer_function)(unsigned int ticks, void* param);
4545
typedef void (utimer_function)(utime_t uticks, void* param);
4646

47-
/* define internal timer to 10 milliseconds */
48-
#define ITIMER_TICK 10000
49-
5047
#define TIMER_FLAG_IS_UTIMER (1<<0)
5148
#define TIMER_FLAG_SKIP_ON_DELAY (1<<1)
5249
#define TIMER_FLAG_DELAY_ON_DELAY (1<<2)
5350

54-
/* try to synchronize with system time every 5 seconds */
55-
#define TIMER_SYNC_TICKS 5000000
56-
/* synchronize if drift is greater than internal timer tick */
57-
#define TIMER_MAX_DRIFT_TICKS ITIMER_TICK
58-
5951
struct os_timer{
6052
/* unique ID in the list of timer handlers - not really used */
6153
unsigned short id;

0 commit comments

Comments
 (0)