summaryrefslogtreecommitdiff
path: root/firmware/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/timer.c')
-rw-r--r--firmware/timer.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/firmware/timer.c b/firmware/timer.c
index 077176b96f..a923290a94 100644
--- a/firmware/timer.c
+++ b/firmware/timer.c
@@ -30,11 +30,6 @@ static int timer_prio = -1;
30void SHAREDBSS_ATTR (*pfn_timer)(void) = NULL; /* timer callback */ 30void SHAREDBSS_ATTR (*pfn_timer)(void) = NULL; /* timer callback */
31void SHAREDBSS_ATTR (*pfn_unregister)(void) = NULL; /* unregister callback */ 31void SHAREDBSS_ATTR (*pfn_unregister)(void) = NULL; /* unregister callback */
32 32
33static bool timer_set(long cycles, bool start)
34{
35 return __TIMER_SET(cycles, start);
36}
37
38/* Register a user timer, called every <cycles> TIMER_FREQ cycles */ 33/* Register a user timer, called every <cycles> TIMER_FREQ cycles */
39bool timer_register(int reg_prio, void (*unregister_callback)(void), 34bool timer_register(int reg_prio, void (*unregister_callback)(void),
40 long cycles, void (*timer_callback)(void) 35 long cycles, void (*timer_callback)(void)
@@ -50,11 +45,7 @@ bool timer_register(int reg_prio, void (*unregister_callback)(void),
50 pfn_unregister = unregister_callback; 45 pfn_unregister = unregister_callback;
51 timer_prio = reg_prio; 46 timer_prio = reg_prio;
52 47
53#if NUM_CORES > 1 48 return timer_start(IF_COP(core));
54 return __TIMER_START(core);
55#else
56 return __TIMER_START();
57#endif
58} 49}
59 50
60bool timer_set_period(long cycles) 51bool timer_set_period(long cycles)
@@ -64,7 +55,7 @@ bool timer_set_period(long cycles)
64 55
65void timer_unregister(void) 56void timer_unregister(void)
66{ 57{
67 __TIMER_STOP(); 58 timer_stop();
68 59
69 pfn_timer = NULL; 60 pfn_timer = NULL;
70 pfn_unregister = NULL; 61 pfn_unregister = NULL;