diff options
Diffstat (limited to 'src/gtimer/gtimer.c')
| -rw-r--r-- | src/gtimer/gtimer.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gtimer/gtimer.c b/src/gtimer/gtimer.c index de40e16c..3e0b6966 100644 --- a/src/gtimer/gtimer.c +++ b/src/gtimer/gtimer.c @@ -118,15 +118,29 @@ static DECLARE_THREAD_FUNCTION(GTimerThreadHandler, arg) { return 0;
}
-void _gtimerInit(void) {
+void _gtimerInit(void)
+{
gfxSemInit(&waitsem, 0, 1);
gfxMutexInit(&mutex);
}
-void gtimerInit(GTimer *pt) {
+void _gtimerDeinit(void)
+{
+ gfxSemDestroy(&waitsem);
+ gfxMutexDestroy(&mutex);
+ // Need to destroy GTimer thread here
+}
+
+void gtimerInit(GTimer* pt)
+{
pt->flags = 0;
}
+void gtimerDeinit(GTimer* pt)
+{
+ gtimerStop(pt);
+}
+
void gtimerStart(GTimer *pt, GTimerFunction fn, void *param, bool_t periodic, delaytime_t millisec) {
gfxMutexEnter(&mutex);
|
