-
Notifications
You must be signed in to change notification settings - Fork 0
/
timer_setup.c
46 lines (37 loc) · 1.09 KB
/
timer_setup.c
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
43
44
45
46
#include "timer_setup.h"
#include "receive_public.h"
#include "send_public.h"
#include "debug.h"
#include "pixy_public.h"
// Initializes timer to specified period in ms
void timer_initialize(int ms)
{
TimerHandle_t myTimer1;
myTimer1 = xTimerCreate("test",
(ms/portTICK_PERIOD_MS),
pdTRUE,
(void *)0,
timerCallback);
if (xTimerStart(myTimer1,10) == pdFAIL)
error('a');
}
// Increments clock
void timerCallback( TimerHandle_t myTimer )
{
traces(TIMER_CALLBACK_ENTER);
updateClock();
//void sendtoServer(void); // testing
traces(TIMER_CALLBACK_EXIT);
}
void timer_initiaize_20(int ms){
TimerHandle_t myTimer2;
myTimer2 = xTimerCreate("test2",
(ms/portTICK_PERIOD_MS),
pdTRUE,
(void *)0,
timerCallback_20);
if (xTimerStart(myTimer2,10) == pdFAIL)
error('a');
}
void timerCallback_20( TimerHandle_t secondTimer){
}