equal
deleted
inserted
replaced
23 |
23 |
24 #include <windows.h> |
24 #include <windows.h> |
25 #include <stdlib.h> |
25 #include <stdlib.h> |
26 #include <sys/timeb.h> |
26 #include <sys/timeb.h> |
27 |
27 |
28 extern "C" |
28 #ifdef __cplusplus |
29 { |
29 extern "C" { |
|
30 #endif |
|
31 |
30 #include "applicfg.h" |
32 #include "applicfg.h" |
31 #include "can_driver.h" |
33 #include "can_driver.h" |
32 #include "timer.h" |
34 #include "timer.h" |
33 #include "timers_driver.h" |
35 #include "timers_driver.h" |
|
36 |
|
37 #ifdef __cplusplus |
34 }; |
38 }; |
|
39 #endif |
35 |
40 |
36 struct _timeb timebuffer; |
41 struct _timeb timebuffer; |
37 |
42 |
38 /* Synchronization Object Implementation */ |
43 /* Synchronization Object Implementation */ |
39 CRITICAL_SECTION CanFestival_mutex; |
44 CRITICAL_SECTION CanFestival_mutex; |
140 else |
145 else |
141 { |
146 { |
142 LARGE_INTEGER liDueTime; |
147 LARGE_INTEGER liDueTime; |
143 |
148 |
144 /* arg 2 of SetWaitableTimer take 100 ns interval */ |
149 /* arg 2 of SetWaitableTimer take 100 ns interval */ |
145 liDueTime.QuadPart = -value; |
150 liDueTime.QuadPart = (-1 * value); |
146 //printf("SetTimer(%llu)\n", value); |
151 //printf("SetTimer(%llu)\n", value); |
147 |
152 |
148 if (!SetWaitableTimer(timer, &liDueTime, 0, NULL, NULL, FALSE)) |
153 if (!SetWaitableTimer(timer, &liDueTime, 0, NULL, NULL, FALSE)) |
149 { |
154 { |
150 printf("SetWaitableTimer failed (%d)\n", GetLastError()); |
155 printf("SetWaitableTimer failed (%d)\n", GetLastError()); |