*----------------------------------------------------------*/\r
\r
/**\r
- * Type by which software timers are referenced. For example, a call to \r
+ * Type by which software timers are referenced. For example, a call to\r
* xTimerCreate() returns an xTimerHandle variable that can then be used to\r
* reference the subject timer in calls to other software timer API functions\r
* (for example, xTimerStart(), xTimerReset(), etc.).\r
typedef void (*tmrTIMER_CALLBACK)( xTimerHandle xTimer );\r
\r
/**\r
- * xTimerHandle xTimerCreate( const signed char *pcTimerName, \r
- * portTickType xTimerPeriod, \r
- * unsigned portBASE_TYPE uxAutoReload, \r
- * void * pvTimerID, \r
+ * xTimerHandle xTimerCreate( const signed char *pcTimerName,\r
+ * portTickType xTimerPeriod,\r
+ * unsigned portBASE_TYPE uxAutoReload,\r
+ * void * pvTimerID,\r
* tmrTIMER_CALLBACK pxCallbackFunction );\r
*\r
- * Creates a new software timer instance. This allocates the storage required \r
- * by the new timer, initialises the new timers internal state, and returns a \r
+ * Creates a new software timer instance. This allocates the storage required\r
+ * by the new timer, initialises the new timers internal state, and returns a\r
* handle by which the new timer can be referenced.\r
*\r
* Timers are created in the dormant state. The xTimerStart(), xTimerReset(),\r
* purely to assist debugging. The kernel itself only ever references a timer by\r
* its handle, and never by its name.\r
*\r
- * @param xTimerPeriod The timer period. The time is defined in tick periods so \r
+ * @param xTimerPeriod The timer period. The time is defined in tick periods so\r
* the constant portTICK_RATE_MS can be used to convert a time that has been\r
* specified in milliseconds. For example, if the timer must expire after 100\r
* ticks, then xTimerPeriod should be set to 100. Alternatively, if the timer\r
* uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and\r
* enter the dormant state after it expires.\r
*\r
- * @param pvTimerID An identifier that is assigned to the timer being created. \r
- * Typically this would be used in the timer callback function to identify which \r
- * timer expired when the same callback function is assigned to more than one \r
+ * @param pvTimerID An identifier that is assigned to the timer being created.\r
+ * Typically this would be used in the timer callback function to identify which\r
+ * timer expired when the same callback function is assigned to more than one\r
* timer.\r
*\r
* @param pxCallbackFunction The function to call when the timer expires.\r
- * Callback functions must have the prototype defined by tmrTIMER_CALLBACK, \r
+ * Callback functions must have the prototype defined by tmrTIMER_CALLBACK,\r
* which is "void vCallbackFunction( xTIMER *xTimer );".\r
*\r
* @return If the timer is successfully create then a handle to the newly\r
* created timer is returned. If the timer cannot be created (because either\r
- * there is insufficient FreeRTOS heap remaining to allocate the timer \r
+ * there is insufficient FreeRTOS heap remaining to allocate the timer\r
* structures, or the timer period was set to 0) then 0 is returned.\r
*\r
* Example usage:\r
*\r
- * \r
+ *\r
* #define NUM_TIMERS 5\r
- * \r
+ *\r
* // An array to hold handles to the created timers.\r
* xTimerHandle xTimers[ NUM_TIMERS ];\r
- * \r
+ *\r
* // An array to hold a count of the number of times each timer expires.\r
* long lExpireCounters[ NUM_TIMERS ] = { 0 };\r
- * \r
- * // Define a callback function that will be used by multiple timer instances. \r
- * // The callback function does nothing but count the number of times the \r
+ *\r
+ * // Define a callback function that will be used by multiple timer instances.\r
+ * // The callback function does nothing but count the number of times the\r
* // associated timer expires, and stop the timer once the timer has expired\r
* // 10 times.\r
* void vTimerCallback( xTIMER *pxTimer )\r
* {\r
* long lArrayIndex;\r
* const long xMaxExpiryCountBeforeStopping = 10;\r
- * \r
+ *\r
* // Optionally do something if the pxTimer parameter is NULL.\r
* configASSERT( pxTimer );\r
* \r
* // Which timer expired?\r
* lArrayIndex = ( long ) pvTimerGetTimerID( pxTimer );\r
- * \r
+ *\r
* // Increment the number of times that pxTimer has expired.\r
* lExpireCounters[ lArrayIndex ] += 1;\r
*\r
* xTimerStop( pxTimer, 0 );\r
* }\r
* }\r
- * \r
+ *\r
* void main( void )\r
* {\r
* long x;\r
- * \r
+ *\r
* // Create then start some timers. Starting the timers before the scheduler\r
* // has been started means the timers will start running immediately that\r
* // the scheduler starts.\r
* ( void * ) x, // Assign each timer a unique id equal to its array index.\r
* vTimerCallback // Each timer calls the same callback when it expires.\r
* );\r
- * \r
+ *\r
* if( xTimers[ x ] == NULL )\r
* {\r
* // The timer was not created.\r
* {\r
* // Start the timer. No block time is specified, and even if one was\r
* // it would be ignored because the scheduler has not yet been\r
- * // started. \r
+ * // started.\r
* if( xTimerStart( xTimers[ x ], 0 ) != pdPASS )\r
* {\r
* // The timer could not be set into the Active state.\r
* }\r
* }\r
* }\r
- * \r
+ *\r
* // ...\r
* // Create tasks here.\r
* // ...\r
- * \r
+ *\r
* // Starting the scheduler will start the timers running as they have already\r
* // been set into the active state.\r
* xTaskStartScheduler();\r
- * \r
+ *\r
* // Should not reach here.\r
* for( ;; );\r
* }\r
*/\r
-xTimerHandle xTimerCreate( const signed char *pcTimerName, portTickType xTimerPeriod, unsigned portBASE_TYPE uxAutoReload, void * pvTimerID, tmrTIMER_CALLBACK pxCallbackFunction ) PRIVILEGED_FUNCTION;\r
+xTimerHandle xTimerCreate( const signed char *pcTimerName, portTickType xTimerPeriodInTicks, unsigned portBASE_TYPE uxAutoReload, void * pvTimerID, tmrTIMER_CALLBACK pxCallbackFunction ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* void *pvTimerGetTimerID( xTimerHandle xTimer );\r
*\r
* Returns the ID assigned to the timer.\r
- * \r
+ *\r
* IDs are assigned to timers using the pvTimerID parameter of the call to\r
* xTimerCreated() that was used to create the timer.\r
*\r
* Queries a timer to see if it is active or dormant.\r
*\r
* A timer will be dormant if:\r
- * 1) It has been created but not started, or \r
+ * 1) It has been created but not started, or\r
* 2) It is an expired on-shot timer that has not been restarted.\r
*\r
* Timers are created in the dormant state. The xTimerStart(), xTimerReset(),\r
* else\r
* {\r
* // xTimer is not active, do something else.\r
- * } \r
+ * }\r
* }\r
*/\r
portBASE_TYPE xTimerIsTimerActive( xTimerHandle xTimer ) PRIVILEGED_FUNCTION;\r
* portBASE_TYPE xTimerStart( xTimerHandle xTimer, portTickType xBlockTime );\r
*\r
* Timer functionality is provided by a timer service/daemon task. Many of the\r
- * public FreeRTOS timer API functions send commands to the timer service task \r
- * though a queue called the timer command queue. The timer command queue is \r
- * private to the kernel itself and is not directly accessible to application \r
- * code. The length of the timer command queue is set by the \r
+ * public FreeRTOS timer API functions send commands to the timer service task\r
+ * though a queue called the timer command queue. The timer command queue is\r
+ * private to the kernel itself and is not directly accessible to application\r
+ * code. The length of the timer command queue is set by the\r
* configTIMER_QUEUE_LENGTH configuration constant.\r
*\r
- * xTimerStart() starts a timer that was previously created using the \r
+ * xTimerStart() starts a timer that was previously created using the\r
* xTimerCreate() API function. If the timer had already been started and was\r
* already in the active state, then xTimerStart() has equivalent functionality\r
* to the xTimerReset() API function.\r
*\r
* Starting a timer ensures the timer is in the active state. If the timer\r
* is not stopped, deleted, or reset in the mean time, the callback function\r
- * associated with the timer will get called 'n' ticks after xTimerStart() was \r
+ * associated with the timer will get called 'n' ticks after xTimerStart() was\r
* called, where 'n' is the timers defined period.\r
*\r
* It is valid to call xTimerStart() before the scheduler has been started, but\r
*\r
* @param xBlockTime Specifies the time, in ticks, that the calling task should\r
* be held in the Blocked state to wait for the start command to be successfully\r
- * sent to the timer command queue, should the queue already be full when \r
+ * sent to the timer command queue, should the queue already be full when\r
* xTimerStart() was called. xBlockTime is ignored if xTimerStart() is called\r
- * before the scheduler is started. \r
+ * before the scheduler is started.\r
*\r
- * @return pdFAIL will be returned if the start command could not be sent to \r
+ * @return pdFAIL will be returned if the start command could not be sent to\r
* the timer command queue even after xBlockTime ticks had passed. pdPASS will\r
* be returned if the command was successfully sent to the timer command queue.\r
* When the command is actually processed will depend on the priority of the\r
* timer service/daemon task relative to other tasks in the system, although the\r
- * timers expiry time is relative to when xTimerStart() is actually called. The \r
- * timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY \r
+ * timers expiry time is relative to when xTimerStart() is actually called. The\r
+ * timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY\r
* configuration constant.\r
*\r
* Example usage:\r
- * \r
+ *\r
* See the xTimerCreate() API function example usage scenario.\r
*\r
*/\r
-#define xTimerStart( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, xTaskGetTickCount(), NULL, xBlockTime )\r
+#define xTimerStart( xTimer, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCount() ), NULL, ( xBlockTime ) )\r
\r
/**\r
* portBASE_TYPE xTimerStop( xTimerHandle xTimer, portTickType xBlockTime );\r
*\r
* Timer functionality is provided by a timer service/daemon task. Many of the\r
- * public FreeRTOS timer API functions send commands to the timer service task \r
- * though a queue called the timer command queue. The timer command queue is \r
- * private to the kernel itself and is not directly accessible to application \r
- * code. The length of the timer command queue is set by the \r
+ * public FreeRTOS timer API functions send commands to the timer service task\r
+ * though a queue called the timer command queue. The timer command queue is\r
+ * private to the kernel itself and is not directly accessible to application\r
+ * code. The length of the timer command queue is set by the\r
* configTIMER_QUEUE_LENGTH configuration constant.\r
*\r
- * xTimerStop() stops a timer that was previously started using either of the \r
- * The xTimerStart(), xTimerReset(), xTimerStartFromISR(), xTimerResetFromISR(), \r
+ * xTimerStop() stops a timer that was previously started using either of the\r
+ * The xTimerStart(), xTimerReset(), xTimerStartFromISR(), xTimerResetFromISR(),\r
* xTimerChangePeriod() or xTimerChangePeriodFromISR() API functions.\r
*\r
* Stopping a timer ensures the timer is not in the active state.\r
*\r
* @param xBlockTime Specifies the time, in ticks, that the calling task should\r
* be held in the Blocked state to wait for the stop command to be successfully\r
- * sent to the timer command queue, should the queue already be full when \r
+ * sent to the timer command queue, should the queue already be full when\r
* xTimerStop() was called. xBlockTime is ignored if xTimerStop() is called\r
- * before the scheduler is started. \r
+ * before the scheduler is started.\r
*\r
- * @return pdFAIL will be returned if the stop command could not be sent to \r
+ * @return pdFAIL will be returned if the stop command could not be sent to\r
* the timer command queue even after xBlockTime ticks had passed. pdPASS will\r
* be returned if the command was successfully sent to the timer command queue.\r
* When the command is actually processed will depend on the priority of the\r
- * timer service/daemon task relative to other tasks in the system. The timer \r
- * service/daemon task priority is set by the configTIMER_TASK_PRIORITY \r
+ * timer service/daemon task relative to other tasks in the system. The timer\r
+ * service/daemon task priority is set by the configTIMER_TASK_PRIORITY\r
* configuration constant.\r
*\r
* Example usage:\r
- * \r
+ *\r
* See the xTimerCreate() API function example usage scenario.\r
*\r
*/\r
-#define xTimerStop( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_STOP, 0, NULL, xBlockTime )\r
+#define xTimerStop( xTimer, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP, 0U, NULL, ( xBlockTime ) )\r
\r
/**\r
- * portBASE_TYPE xTimerChangePeriod( xTimerHandle xTimer, \r
+ * portBASE_TYPE xTimerChangePeriod( xTimerHandle xTimer,\r
* portTickType xNewPeriod,\r
* portTickType xBlockTime );\r
*\r
* Timer functionality is provided by a timer service/daemon task. Many of the\r
- * public FreeRTOS timer API functions send commands to the timer service task \r
- * though a queue called the timer command queue. The timer command queue is \r
- * private to the kernel itself and is not directly accessible to application \r
- * code. The length of the timer command queue is set by the \r
+ * public FreeRTOS timer API functions send commands to the timer service task\r
+ * though a queue called the timer command queue. The timer command queue is\r
+ * private to the kernel itself and is not directly accessible to application\r
+ * code. The length of the timer command queue is set by the\r
* configTIMER_QUEUE_LENGTH configuration constant.\r
*\r
- * xTimerChangePeriod() changes the period of a timer that was previously \r
+ * xTimerChangePeriod() changes the period of a timer that was previously\r
* created using the xTimerCreate() API function.\r
*\r
* xTimerChangePeriod() can be called to change the period of an active or\r
* dormant state timer.\r
*\r
- * The configUSE_TIMERS configuration constant must be set to 1 for \r
+ * The configUSE_TIMERS configuration constant must be set to 1 for\r
* xTimerChangePeriod() to be available.\r
*\r
* @param xTimer The handle of the timer that is having its period changed.\r
*\r
- * @param xNewPeriod The new period for xTimer. Timer periods are specified in \r
- * tick periods, so the constant portTICK_RATE_MS can be used to convert a time \r
- * that has been specified in milliseconds. For example, if the timer must \r
- * expire after 100 ticks, then xNewPeriod should be set to 100. Alternatively, \r
- * if the timer must expire after 500ms, then xNewPeriod can be set to \r
+ * @param xNewPeriod The new period for xTimer. Timer periods are specified in\r
+ * tick periods, so the constant portTICK_RATE_MS can be used to convert a time\r
+ * that has been specified in milliseconds. For example, if the timer must\r
+ * expire after 100 ticks, then xNewPeriod should be set to 100. Alternatively,\r
+ * if the timer must expire after 500ms, then xNewPeriod can be set to\r
* ( 500 / portTICK_RATE_MS ) provided configTICK_RATE_HZ is less than\r
* or equal to 1000.\r
*\r
* @param xBlockTime Specifies the time, in ticks, that the calling task should\r
- * be held in the Blocked state to wait for the change period command to be \r
- * successfully sent to the timer command queue, should the queue already be \r
- * full when xTimerChangePeriod() was called. xBlockTime is ignored if \r
- * xTimerChangePeriod() is called before the scheduler is started. \r
- *\r
- * @return pdFAIL will be returned if the change period command could not be \r
- * sent to the timer command queue even after xBlockTime ticks had passed. \r
- * pdPASS will be returned if the command was successfully sent to the timer \r
- * command queue. When the command is actually processed will depend on the \r
- * priority of the timer service/daemon task relative to other tasks in the \r
- * system. The timer service/daemon task priority is set by the \r
+ * be held in the Blocked state to wait for the change period command to be\r
+ * successfully sent to the timer command queue, should the queue already be\r
+ * full when xTimerChangePeriod() was called. xBlockTime is ignored if\r
+ * xTimerChangePeriod() is called before the scheduler is started.\r
+ *\r
+ * @return pdFAIL will be returned if the change period command could not be\r
+ * sent to the timer command queue even after xBlockTime ticks had passed.\r
+ * pdPASS will be returned if the command was successfully sent to the timer\r
+ * command queue. When the command is actually processed will depend on the\r
+ * priority of the timer service/daemon task relative to other tasks in the\r
+ * system. The timer service/daemon task priority is set by the\r
* configTIMER_TASK_PRIORITY configuration constant.\r
*\r
* Example usage:\r
*\r
* // This function assumes xTimer has already been created. If the timer\r
- * // referenced by xTimer is already active when it is called, then the timer \r
+ * // referenced by xTimer is already active when it is called, then the timer\r
* // is deleted. If the timer referenced by xTimer is not active when it is\r
* // called, then the period of the timer is set to 500ms and the timer is\r
* // started.\r
* // The command could not be sent, even after waiting for 100 ticks\r
* // to pass. Take appropriate action here.\r
* }\r
- * } \r
+ * }\r
* }\r
*/\r
- #define xTimerChangePeriod( xTimer, xNewPeriod, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_CHANGE_PERIOD, xNewPeriod, NULL, xBlockTime )\r
+ #define xTimerChangePeriod( xTimer, xNewPeriod, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), NULL, ( xBlockTime ) )\r
\r
/**\r
* portBASE_TYPE xTimerDelete( xTimerHandle xTimer, portTickType xBlockTime );\r
*\r
* Timer functionality is provided by a timer service/daemon task. Many of the\r
- * public FreeRTOS timer API functions send commands to the timer service task \r
- * though a queue called the timer command queue. The timer command queue is \r
- * private to the kernel itself and is not directly accessible to application \r
- * code. The length of the timer command queue is set by the \r
+ * public FreeRTOS timer API functions send commands to the timer service task\r
+ * though a queue called the timer command queue. The timer command queue is\r
+ * private to the kernel itself and is not directly accessible to application\r
+ * code. The length of the timer command queue is set by the\r
* configTIMER_QUEUE_LENGTH configuration constant.\r
*\r
* xTimerDelete() deletes a timer that was previously created using the\r
* xTimerCreate() API function.\r
*\r
- * The configUSE_TIMERS configuration constant must be set to 1 for \r
+ * The configUSE_TIMERS configuration constant must be set to 1 for\r
* xTimerDelete() to be available.\r
*\r
* @param xTimer The handle of the timer being deleted.\r
*\r
* @param xBlockTime Specifies the time, in ticks, that the calling task should\r
- * be held in the Blocked state to wait for the delete command to be \r
- * successfully sent to the timer command queue, should the queue already be \r
- * full when xTimerDelete() was called. xBlockTime is ignored if xTimerDelete() \r
- * is called before the scheduler is started. \r
+ * be held in the Blocked state to wait for the delete command to be\r
+ * successfully sent to the timer command queue, should the queue already be\r
+ * full when xTimerDelete() was called. xBlockTime is ignored if xTimerDelete()\r
+ * is called before the scheduler is started.\r
*\r
- * @return pdFAIL will be returned if the delete command could not be sent to \r
+ * @return pdFAIL will be returned if the delete command could not be sent to\r
* the timer command queue even after xBlockTime ticks had passed. pdPASS will\r
* be returned if the command was successfully sent to the timer command queue.\r
* When the command is actually processed will depend on the priority of the\r
- * timer service/daemon task relative to other tasks in the system. The timer \r
- * service/daemon task priority is set by the configTIMER_TASK_PRIORITY \r
+ * timer service/daemon task relative to other tasks in the system. The timer\r
+ * service/daemon task priority is set by the configTIMER_TASK_PRIORITY\r
* configuration constant.\r
*\r
* Example usage:\r
- * \r
+ *\r
* See the xTimerChangePeriod() API function example usage scenario.\r
*/\r
-#define xTimerDelete( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_DELETE, 0, NULL, xBlockTime )\r
+#define xTimerDelete( xTimer, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_DELETE, 0U, NULL, ( xBlockTime ) )\r
\r
/**\r
* portBASE_TYPE xTimerReset( xTimerHandle xTimer, portTickType xBlockTime );\r
*\r
* Timer functionality is provided by a timer service/daemon task. Many of the\r
- * public FreeRTOS timer API functions send commands to the timer service task \r
- * though a queue called the timer command queue. The timer command queue is \r
- * private to the kernel itself and is not directly accessible to application \r
- * code. The length of the timer command queue is set by the \r
+ * public FreeRTOS timer API functions send commands to the timer service task\r
+ * though a queue called the timer command queue. The timer command queue is\r
+ * private to the kernel itself and is not directly accessible to application\r
+ * code. The length of the timer command queue is set by the\r
* configTIMER_QUEUE_LENGTH configuration constant.\r
*\r
- * xTimerReset() re-starts a timer that was previously created using the \r
+ * xTimerReset() re-starts a timer that was previously created using the\r
* xTimerCreate() API function. If the timer had already been started and was\r
* already in the active state, then xTimerReset() will cause the timer to\r
* re-evaluate its expiry time so that it is relative to when xTimerReset() was\r
- * called. If the timer was in the dormant state then xTimerReset() has \r
+ * called. If the timer was in the dormant state then xTimerReset() has\r
* equivalent functionality to the xTimerStart() API function.\r
*\r
* Resetting a timer ensures the timer is in the active state. If the timer\r
* is not stopped, deleted, or reset in the mean time, the callback function\r
- * associated with the timer will get called 'n' ticks after xTimerReset() was \r
+ * associated with the timer will get called 'n' ticks after xTimerReset() was\r
* called, where 'n' is the timers defined period.\r
*\r
* It is valid to call xTimerReset() before the scheduler has been started, but\r
*\r
* @param xBlockTime Specifies the time, in ticks, that the calling task should\r
* be held in the Blocked state to wait for the reset command to be successfully\r
- * sent to the timer command queue, should the queue already be full when \r
+ * sent to the timer command queue, should the queue already be full when\r
* xTimerReset() was called. xBlockTime is ignored if xTimerReset() is called\r
- * before the scheduler is started. \r
+ * before the scheduler is started.\r
*\r
- * @return pdFAIL will be returned if the reset command could not be sent to \r
+ * @return pdFAIL will be returned if the reset command could not be sent to\r
* the timer command queue even after xBlockTime ticks had passed. pdPASS will\r
* be returned if the command was successfully sent to the timer command queue.\r
* When the command is actually processed will depend on the priority of the\r
* timer service/daemon task relative to other tasks in the system, although the\r
- * timers expiry time is relative to when xTimerStart() is actually called. The \r
- * timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY \r
+ * timers expiry time is relative to when xTimerStart() is actually called. The\r
+ * timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY\r
* configuration constant.\r
*\r
* Example usage:\r
- * \r
- * // When a key is pressed, an LCD back-light is switched on. If 5 seconds pass \r
- * // without a key being pressed, then the LCD back-light is switched off. In \r
+ *\r
+ * // When a key is pressed, an LCD back-light is switched on. If 5 seconds pass\r
+ * // without a key being pressed, then the LCD back-light is switched off. In\r
* // this case, the timer is a one-shot timer.\r
*\r
* xTimerHandle xBacklightTimer = NULL;\r
* void vKeyPressEventHandler( char cKey )\r
* {\r
* // Ensure the LCD back-light is on, then reset the timer that is\r
- * // responsible for turning the back-light off after 5 seconds of \r
+ * // responsible for turning the back-light off after 5 seconds of\r
* // key inactivity. Wait 10 ticks for the command to be successfully sent\r
* // if it cannot be sent immediately.\r
* vSetBacklightState( BACKLIGHT_ON );\r
* void main( void )\r
* {\r
* long x;\r
- * \r
+ *\r
* // Create then start the one-shot timer that is responsible for turning\r
* // the back-light off if no keys are pressed within a 5 second period.\r
* xBacklightTimer = xTimerCreate( "BacklightTimer", // Just a text name, not used by the kernel.\r
* 0, // The id is not used by the callback so can take any value.\r
* vBacklightTimerCallback // The callback function that switches the LCD back-light off.\r
* );\r
- * \r
+ *\r
* if( xBacklightTimer == NULL )\r
* {\r
* // The timer was not created.\r
* {\r
* // Start the timer. No block time is specified, and even if one was\r
* // it would be ignored because the scheduler has not yet been\r
- * // started. \r
+ * // started.\r
* if( xTimerStart( xBacklightTimer, 0 ) != pdPASS )\r
* {\r
* // The timer could not be set into the Active state.\r
* }\r
* }\r
- * \r
+ *\r
* // ...\r
* // Create tasks here.\r
* // ...\r
- * \r
+ *\r
* // Starting the scheduler will start the timer running as it has already\r
* // been set into the active state.\r
* xTaskStartScheduler();\r
- * \r
+ *\r
* // Should not reach here.\r
* for( ;; );\r
* }\r
*/\r
-#define xTimerReset( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, xTaskGetTickCount(), NULL, xBlockTime )\r
+#define xTimerReset( xTimer, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCount() ), NULL, ( xBlockTime ) )\r
\r
/**\r
- * portBASE_TYPE xTimerStartFromISR( xTimerHandle xTimer, \r
+ * portBASE_TYPE xTimerStartFromISR( xTimerHandle xTimer,\r
* portBASE_TYPE *pxHigherPriorityTaskWoken );\r
*\r
* A version of xTimerStart() that can be called from an interrupt service\r
* xTimerStartFromISR() sets this value to pdTRUE then a context switch should\r
* be performed before the interrupt exits.\r
*\r
- * @return pdFAIL will be returned if the start command could not be sent to \r
- * the timer command queue. pdPASS will be returned if the command was \r
- * successfully sent to the timer command queue. When the command is actually \r
- * processed will depend on the priority of the timer service/daemon task \r
- * relative to other tasks in the system, although the timers expiry time is \r
- * relative to when xTimerStartFromISR() is actually called. The timer service/daemon \r
- * task priority is set by the configTIMER_TASK_PRIORITY configuration constant. \r
+ * @return pdFAIL will be returned if the start command could not be sent to\r
+ * the timer command queue. pdPASS will be returned if the command was\r
+ * successfully sent to the timer command queue. When the command is actually\r
+ * processed will depend on the priority of the timer service/daemon task\r
+ * relative to other tasks in the system, although the timers expiry time is\r
+ * relative to when xTimerStartFromISR() is actually called. The timer service/daemon\r
+ * task priority is set by the configTIMER_TASK_PRIORITY configuration constant.\r
*\r
* Example usage:\r
- * \r
- * // This scenario assumes xBacklightTimer has already been created. When a \r
- * // key is pressed, an LCD back-light is switched on. If 5 seconds pass \r
- * // without a key being pressed, then the LCD back-light is switched off. In \r
- * // this case, the timer is a one-shot timer, and unlike the example given for \r
+ *\r
+ * // This scenario assumes xBacklightTimer has already been created. When a\r
+ * // key is pressed, an LCD back-light is switched on. If 5 seconds pass\r
+ * // without a key being pressed, then the LCD back-light is switched off. In\r
+ * // this case, the timer is a one-shot timer, and unlike the example given for\r
* // the xTimerReset() function, the key press event handler is an interrupt\r
* // service routine.\r
*\r
* portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
*\r
* // Ensure the LCD back-light is on, then restart the timer that is\r
- * // responsible for turning the back-light off after 5 seconds of \r
+ * // responsible for turning the back-light off after 5 seconds of\r
* // key inactivity. This is an interrupt service routine so can only\r
* // call FreeRTOS API functions that end in "FromISR".\r
* vSetBacklightState( BACKLIGHT_ON );\r
* }\r
* }\r
*/\r
-#define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, xTaskGetTickCountFromISR(), pxHigherPriorityTaskWoken, 0 )\r
+#define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )\r
\r
/**\r
- * portBASE_TYPE xTimerStopFromISR( xTimerHandle xTimer, \r
+ * portBASE_TYPE xTimerStopFromISR( xTimerHandle xTimer,\r
* portBASE_TYPE *pxHigherPriorityTaskWoken );\r
*\r
* A version of xTimerStop() that can be called from an interrupt service\r
* xTimerStopFromISR() sets this value to pdTRUE then a context switch should\r
* be performed before the interrupt exits.\r
*\r
- * @return pdFAIL will be returned if the stop command could not be sent to \r
- * the timer command queue. pdPASS will be returned if the command was \r
- * successfully sent to the timer command queue. When the command is actually \r
- * processed will depend on the priority of the timer service/daemon task \r
- * relative to other tasks in the system. The timer service/daemon task \r
- * priority is set by the configTIMER_TASK_PRIORITY configuration constant. \r
+ * @return pdFAIL will be returned if the stop command could not be sent to\r
+ * the timer command queue. pdPASS will be returned if the command was\r
+ * successfully sent to the timer command queue. When the command is actually\r
+ * processed will depend on the priority of the timer service/daemon task\r
+ * relative to other tasks in the system. The timer service/daemon task\r
+ * priority is set by the configTIMER_TASK_PRIORITY configuration constant.\r
*\r
* Example usage:\r
*\r
* }\r
* }\r
*/\r
-#define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( xTimer, tmrCOMMAND_STOP, 0, pxHigherPriorityTaskWoken, 0 )\r
+#define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP, 0, ( pxHigherPriorityTaskWoken ), 0U )\r
\r
/**\r
- * portBASE_TYPE xTimerChangePeriodFromISR( xTimerHandle xTimer, \r
+ * portBASE_TYPE xTimerChangePeriodFromISR( xTimerHandle xTimer,\r
* portTickType xNewPeriod,\r
* portBASE_TYPE *pxHigherPriorityTaskWoken );\r
*\r
- * A version of xTimerChangePeriod() that can be called from an interrupt \r
+ * A version of xTimerChangePeriod() that can be called from an interrupt\r
* service routine.\r
*\r
* @param xTimer The handle of the timer that is having its period changed.\r
*\r
- * @param xNewPeriod The new period for xTimer. Timer periods are specified in \r
- * tick periods, so the constant portTICK_RATE_MS can be used to convert a time \r
- * that has been specified in milliseconds. For example, if the timer must \r
- * expire after 100 ticks, then xNewPeriod should be set to 100. Alternatively, \r
- * if the timer must expire after 500ms, then xNewPeriod can be set to \r
+ * @param xNewPeriod The new period for xTimer. Timer periods are specified in\r
+ * tick periods, so the constant portTICK_RATE_MS can be used to convert a time\r
+ * that has been specified in milliseconds. For example, if the timer must\r
+ * expire after 100 ticks, then xNewPeriod should be set to 100. Alternatively,\r
+ * if the timer must expire after 500ms, then xNewPeriod can be set to\r
* ( 500 / portTICK_RATE_MS ) provided configTICK_RATE_HZ is less than\r
* or equal to 1000.\r
*\r
* @param pxHigherPriorityTaskWoken The timer service/daemon task spends most\r
* of its time in the Blocked state, waiting for messages to arrive on the timer\r
- * command queue. Calling xTimerChangePeriodFromISR() writes a message to the \r
+ * command queue. Calling xTimerChangePeriodFromISR() writes a message to the\r
* timer command queue, so has the potential to transition the timer service/\r
- * daemon task out of the Blocked state. If calling xTimerChangePeriodFromISR() \r
- * causes the timer service/daemon task to leave the Blocked state, and the \r
- * timer service/daemon task has a priority equal to or greater than the \r
- * currently executing task (the task that was interrupted), then \r
- * *pxHigherPriorityTaskWoken will get set to pdTRUE internally within the \r
- * xTimerChangePeriodFromISR() function. If xTimerChangePeriodFromISR() sets \r
- * this value to pdTRUE then a context switch should be performed before the \r
+ * daemon task out of the Blocked state. If calling xTimerChangePeriodFromISR()\r
+ * causes the timer service/daemon task to leave the Blocked state, and the\r
+ * timer service/daemon task has a priority equal to or greater than the\r
+ * currently executing task (the task that was interrupted), then\r
+ * *pxHigherPriorityTaskWoken will get set to pdTRUE internally within the\r
+ * xTimerChangePeriodFromISR() function. If xTimerChangePeriodFromISR() sets\r
+ * this value to pdTRUE then a context switch should be performed before the\r
* interrupt exits.\r
*\r
* @return pdFAIL will be returned if the command to change the timers period\r
- * could not be sent to the timer command queue. pdPASS will be returned if the \r
- * command was successfully sent to the timer command queue. When the command \r
- * is actually processed will depend on the priority of the timer service/daemon \r
- * task relative to other tasks in the system. The timer service/daemon task \r
- * priority is set by the configTIMER_TASK_PRIORITY configuration constant. \r
+ * could not be sent to the timer command queue. pdPASS will be returned if the\r
+ * command was successfully sent to the timer command queue. When the command\r
+ * is actually processed will depend on the priority of the timer service/daemon\r
+ * task relative to other tasks in the system. The timer service/daemon task\r
+ * priority is set by the configTIMER_TASK_PRIORITY configuration constant.\r
*\r
* Example usage:\r
*\r
* // FreeRTOS API functions that end in "FromISR" can be used.\r
* if( xTimerChangePeriodFromISR( xTimer, &xHigherPriorityTaskWoken ) != pdPASS )\r
* {\r
- * // The command to change the timers period was not executed \r
+ * // The command to change the timers period was not executed\r
* // successfully. Take appropriate action here.\r
* }\r
*\r
* }\r
* }\r
*/\r
-#define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) xTimerGenericCommand( xTimer, tmrCOMMAND_CHANGE_PERIOD, xNewPeriod, pxHigherPriorityTaskWoken, 0 )\r
+#define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), ( pxHigherPriorityTaskWoken ), 0U )\r
\r
/**\r
- * portBASE_TYPE xTimerResetFromISR( xTimerHandle xTimer, \r
+ * portBASE_TYPE xTimerResetFromISR( xTimerHandle xTimer,\r
* portBASE_TYPE *pxHigherPriorityTaskWoken );\r
*\r
* A version of xTimerReset() that can be called from an interrupt service\r
* xTimerResetFromISR() sets this value to pdTRUE then a context switch should\r
* be performed before the interrupt exits.\r
*\r
- * @return pdFAIL will be returned if the reset command could not be sent to \r
- * the timer command queue. pdPASS will be returned if the command was \r
- * successfully sent to the timer command queue. When the command is actually \r
- * processed will depend on the priority of the timer service/daemon task \r
- * relative to other tasks in the system, although the timers expiry time is \r
- * relative to when xTimerResetFromISR() is actually called. The timer service/daemon \r
- * task priority is set by the configTIMER_TASK_PRIORITY configuration constant. \r
+ * @return pdFAIL will be returned if the reset command could not be sent to\r
+ * the timer command queue. pdPASS will be returned if the command was\r
+ * successfully sent to the timer command queue. When the command is actually\r
+ * processed will depend on the priority of the timer service/daemon task\r
+ * relative to other tasks in the system, although the timers expiry time is\r
+ * relative to when xTimerResetFromISR() is actually called. The timer service/daemon\r
+ * task priority is set by the configTIMER_TASK_PRIORITY configuration constant.\r
*\r
* Example usage:\r
- * \r
- * // This scenario assumes xBacklightTimer has already been created. When a \r
- * // key is pressed, an LCD back-light is switched on. If 5 seconds pass \r
- * // without a key being pressed, then the LCD back-light is switched off. In \r
- * // this case, the timer is a one-shot timer, and unlike the example given for \r
+ *\r
+ * // This scenario assumes xBacklightTimer has already been created. When a\r
+ * // key is pressed, an LCD back-light is switched on. If 5 seconds pass\r
+ * // without a key being pressed, then the LCD back-light is switched off. In\r
+ * // this case, the timer is a one-shot timer, and unlike the example given for\r
* // the xTimerReset() function, the key press event handler is an interrupt\r
* // service routine.\r
*\r
* portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
*\r
* // Ensure the LCD back-light is on, then reset the timer that is\r
- * // responsible for turning the back-light off after 5 seconds of \r
+ * // responsible for turning the back-light off after 5 seconds of\r
* // key inactivity. This is an interrupt service routine so can only\r
* // call FreeRTOS API functions that end in "FromISR".\r
* vSetBacklightState( BACKLIGHT_ON );\r
* }\r
* }\r
*/\r
-#define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, xTaskGetTickCountFromISR(), pxHigherPriorityTaskWoken, 0 )\r
+#define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )\r
\r
/*\r
* Functions beyond this part are not part of the public API and are intended\r