aboutsummaryrefslogtreecommitdiff
path: root/Source/Timer.h
diff options
context:
space:
mode:
authorXaviDCR92 <xavi.dcr@gmail.com>2017-08-10 22:39:31 +0200
committerXaviDCR92 <xavi.dcr@gmail.com>2017-08-10 22:39:31 +0200
commitf17b15bdffe45810eebc7695c10f1d7fc34af014 (patch)
tree273e3459303a063c03a84ffbc7c95415eb216364 /Source/Timer.h
parentb807ee7ca59c13bbc698595da5e56eb6dd6daa2f (diff)
downloadairport-f17b15bdffe45810eebc7695c10f1d7fc34af014.tar.gz
+ System timer functions now moved to a separate source file, Timer.c/Timer.h.
* Added some more comments on Game.c. * On GamePathToTile(), duplicate checks for existing tile have been replaced by calls to GameWaypointCheckExisting().
Diffstat (limited to 'Source/Timer.h')
-rw-r--r--Source/Timer.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/Timer.h b/Source/Timer.h
new file mode 100644
index 0000000..6f4a3a4
--- /dev/null
+++ b/Source/Timer.h
@@ -0,0 +1,36 @@
+#ifndef __TIMER_HEADER__
+#define __TIMER_HEADER__
+
+/* **************************************
+ * Includes *
+ * **************************************/
+
+#include "Global_Inc.h"
+#include "GameStructures.h"
+
+/* **************************************
+ * Defines *
+ * **************************************/
+
+/* **************************************
+ * Global Prototypes *
+ * **************************************/
+
+// Creates a timer instance wiht a determined value and associates it to a callback
+// Once time expires, callback is automatically called right after GfxDrawScene().
+// Time is expressed so that t = 100 ms e.g.: 2 seconds = 20.
+TYPE_TIMER* TimerCreate(uint32_t t, bool rf, void (*timer_callback)(void) );
+
+// Reportedly, sets all timer data to zero.
+void TimerReset(void);
+
+// To be called every cycle (i.e.: inside GfxDrawScene() ).
+void TimerHandler(void);
+
+// Sets timer remaining time to initial value.
+void TimerRestart(TYPE_TIMER* timer);
+
+// Flushes a timer pointed to by timer.
+void TimerRemove(TYPE_TIMER* timer);
+
+#endif // __TIMER_HEADER__