diff options
| author | inmarket <andrewh@inmarket.com.au> | 2014-02-03 18:23:53 +1000 |
|---|---|---|
| committer | inmarket <andrewh@inmarket.com.au> | 2014-02-03 18:23:53 +1000 |
| commit | f26581dc7e85f77393143a44c0c3eb3eef0da8b4 (patch) | |
| tree | 9a83c5eaf1abe2cc61b216012f997e6891840a19 /src/gtimer/gtimer.c | |
| parent | b6daaabf32bf2092689e0732ca4486f25e80317f (diff) | |
| parent | d869d9b3b80cb9ab2314840b2fa274e89e5342db (diff) | |
| download | uGFX-f26581dc7e85f77393143a44c0c3eb3eef0da8b4.tar.gz uGFX-f26581dc7e85f77393143a44c0c3eb3eef0da8b4.tar.bz2 uGFX-f26581dc7e85f77393143a44c0c3eb3eef0da8b4.zip | |
Merge branch 'master' into freertos
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);
|
