]> git.sur5r.net Git - freertos/commitdiff
Continue work on the timers module.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 9 Feb 2011 10:47:23 +0000 (10:47 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 9 Feb 2011 10:47:23 +0000 (10:47 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1280 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/include/timers.h

index 64b1a1aad2234fa25bdbe20ab7c011c08f4a7f96..21d9053684b4a260c27d79319f3d5815d0de7208 100644 (file)
 extern "C" {\r
 #endif\r
 \r
+/* IDs for commands that can be sent/received on the timer queue. */\r
+#define tmrCOMMAND_START                       0\r
+#define tmrCOMMAND_STOP                                1\r
+#define tmrCOMMAND_CHANGE_PERIOD       2\r
+#define tmrCOMMAND_DELETE                      3\r
+\r
 /*-----------------------------------------------------------\r
  * MACROS AND DEFINITIONS\r
  *----------------------------------------------------------*/\r
@@ -77,9 +83,14 @@ typedef void (*tmrTIMER_CALLBACK)( xTimerHandle xTimer );
 \r
 portBASE_TYPE xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;\r
 xTimerHandle xTimerCreate( const signed char *pcTimerName, portTickType xTimerPeriod, unsigned portBASE_TYPE uxAutoReload, void * pvTimerID, tmrTIMER_CALLBACK pxCallbackFunction ) PRIVILEGED_FUNCTION;\r
-portBASE_TYPE xTimerStart( xTimerHandle xTimer, portTickType xBlockTime ); /* Must not attempt to block if scheduler not started. */\r
 void *pvTimerGetTimerID( xTimerHandle xTimer );\r
+portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, portTickType xBlockTime );\r
+portBASE_TYPE xTimerIsTimerActive( xTimerHandle xTimer );\r
 \r
+#define xTimerStart( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, 0, xBlockTime )\r
+#define xTimerStop( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_STOP, 0, xBlockTime )\r
+#define xTimerChangePeriod( xTimer, xNewPeriod, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_CHANGE_PERIOD, xNewPeriod, xBlockTime )\r
+#define xTimerDelete( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_DELETE, 0, xBlockTime )\r
 \r
 #ifdef __cplusplus\r
 }\r