Lines Matching full:the

8  * this software and associated documentation files (the "Software"), to deal in
9 * the Software without restriction, including without limitation the rights to
11 * the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
50 /* IDs for commands that can be sent/received on the timer queue. These are to
51 * be used solely through the macros that make up the public software timer API,
52 * as defined below. The commands that are sent from interrupts must use the
53 * highest numbers as tmrFIRST_FROM_ISR_COMMAND is used to determine if the task
54 * or interrupt version of the queue send function should be used. */
74 * reference the subject timer in calls to other software timer API functions
77 struct tmrTimerControl; /* The old naming convention is used to prevent breaking kernel aware debug…
81 * Defines the prototype to which timer callback functions must conform.
86 * Defines the prototype to which functions used with the
99 * Creates a new software timer instance, and returns a handle by which the
102 * Internally, within the FreeRTOS implementation, software timers use a block
103 * of memory, in which the timer data structure is stored. If a software timer
104 * is created using xTimerCreate() then the required memory is automatically
105 * dynamically allocated inside the xTimerCreate() function. (see
107 * xTimerCreateStatic() then the application writer must provide the memory that
108 * will get used by the software timer. xTimerCreateStatic() therefore allows a
111 * Timers are created in the dormant state. The xTimerStart(), xTimerReset(),
114 * timer into the active state.
116 * @param pcTimerName A text name that is assigned to the timer. This is done
117 * purely to assist debugging. The kernel itself only ever references a timer
120 * @param xTimerPeriodInTicks The timer period. The time is defined in tick
121 * periods so the constant portTICK_PERIOD_MS can be used to convert a time that
122 * has been specified in milliseconds. For example, if the timer must expire
124 * Alternatively, if the timer must expire after 500ms, then xPeriod can be set
128 * @param xAutoReload If xAutoReload is set to pdTRUE then the timer will
129 * expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter.
130 * If xAutoReload is set to pdFALSE then the timer will be a one-shot timer and
131 * enter the dormant state after it expires.
133 * @param pvTimerID An identifier that is assigned to the timer being created.
134 * Typically this would be used in the timer callback function to identify which
135 * timer expired when the same callback function is assigned to more than one
138 * @param pxCallbackFunction The function to call when the timer expires.
139 * Callback functions must have the prototype defined by TimerCallbackFunction_t,
142 * @return If the timer is successfully created then a handle to the newly
143 * created timer is returned. If the timer cannot be created because there is
144 * insufficient FreeRTOS heap remaining to allocate the timer
151 * // An array to hold handles to the created timers.
154 * // An array to hold a count of the number of times each timer expires.
158 * // The callback function does nothing but count the number of times the
159 * // associated timer expires, and stop the timer once the timer has expired
166 * // Optionally do something if the pxTimer parameter is NULL.
172 * // Increment the number of times that pxTimer has expired.
175 * // If the timer has expired 10 times then stop it from running.
188 * // Create then start some timers. Starting the timers before the scheduler
189 * // has been started means the timers will start running immediately that
190 * // the scheduler starts.
193 … xTimers[ x ] = xTimerCreate( "Timer", // Just a text name, not used by the kernel.
194 * ( 100 * ( x + 1 ) ), // The timer period in ticks.
195 …* pdTRUE, // The timers will auto-reload them…
197 …* vTimerCallback // Each timer calls the same callba…
202 * // The timer was not created.
206 * // Start the timer. No block time is specified, and even if one was
207 * // it would be ignored because the scheduler has not yet been
211 * // The timer could not be set into the Active state.
220 * // Starting the scheduler will start the timers running as they have already
221 * // been set into the active state.
245 * Creates a new software timer instance, and returns a handle by which the
248 * Internally, within the FreeRTOS implementation, software timers use a block
249 * of memory, in which the timer data structure is stored. If a software timer
250 * is created using xTimerCreate() then the required memory is automatically
251 * dynamically allocated inside the xTimerCreate() function. (see
253 * xTimerCreateStatic() then the application writer must provide the memory that
254 * will get used by the software timer. xTimerCreateStatic() therefore allows a
257 * Timers are created in the dormant state. The xTimerStart(), xTimerReset(),
260 * timer into the active state.
262 * @param pcTimerName A text name that is assigned to the timer. This is done
263 * purely to assist debugging. The kernel itself only ever references a timer
266 * @param xTimerPeriodInTicks The timer period. The time is defined in tick
267 * periods so the constant portTICK_PERIOD_MS can be used to convert a time that
268 * has been specified in milliseconds. For example, if the timer must expire
270 * Alternatively, if the timer must expire after 500ms, then xPeriod can be set
272 * equal to 1000. The timer period must be greater than 0.
274 * @param xAutoReload If xAutoReload is set to pdTRUE then the timer will
275 * expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter.
276 * If xAutoReload is set to pdFALSE then the timer will be a one-shot timer and
277 * enter the dormant state after it expires.
279 * @param pvTimerID An identifier that is assigned to the timer being created.
280 * Typically this would be used in the timer callback function to identify which
281 * timer expired when the same callback function is assigned to more than one
284 * @param pxCallbackFunction The function to call when the timer expires.
285 * Callback functions must have the prototype defined by TimerCallbackFunction_t,
289 * will be then be used to hold the software timer's data structures, removing
290 * the need for the memory to be allocated dynamically.
292 * @return If the timer is created then a handle to the created timer is
298 * // The buffer used to hold the software timer's data structure.
301 * // A variable that will be incremented by the software timer's callback
306 * // it when the software timer was created. After the 5th increment the
307 * // callback function stops the software timer.
313 * // Obtain the address of the variable to increment from the timer ID.
316 * // Increment the variable to show the timer callback has executed.
319 * // If this callback has executed the required number of times, stop the
331 * // Create the software time. xTimerCreateStatic() has an extra parameter
332 * // than the normal xTimerCreate() API function. The parameter is a pointer
333 * // to the StaticTimer_t structure that will hold the software timer
334 * // structure. If the parameter is passed as NULL then the structure will be
336 …* xTimer = xTimerCreateStatic( "T1", // Text name for the task. Helps debugging o…
337 * xTimerPeriod, // The period of the timer in ticks.
339 … ( void * ) &uxVariableToIncrement, // A variable incremented by the software timer's ca…
340 …* prvTimerCallback, // The function to execute when the timer exp…
341 …* &xTimerBuffer ); // The buffer that will hold the software tim…
343 * // The scheduler has not started yet so a block time is not used.
350 * // Starting the scheduler will start the timers running as they have already
351 * // been set into the active state.
371 * Returns the ID assigned to the timer.
373 * IDs are assigned to timers using the pvTimerID parameter of the call to
374 * xTimerCreated() that was used to create the timer, and by calling the
377 * If the same callback function is assigned to multiple timers then the timer
380 * @param xTimer The timer being queried.
382 * @return The ID assigned to the timer being queried.
386 * See the xTimerCreate() API function example usage scenario.
393 * Sets the ID assigned to the timer.
395 * IDs are assigned to timers using the pvTimerID parameter of the call to
396 * xTimerCreated() that was used to create the timer.
398 * If the same callback function is assigned to multiple timers then the timer
401 * @param xTimer The timer being updated.
403 * @param pvNewID The ID to assign to the timer.
407 * See the xTimerCreate() API function example usage scenario.
421 * Timers are created in the dormant state. The xTimerStart(), xTimerReset(),
423 * xTimerChangePeriodFromISR() API functions can all be used to transition a timer into the
426 * @param xTimer The timer being queried.
428 * @return pdFALSE will be returned if the timer is dormant. A value other than
429 * pdFALSE will be returned if the timer is active.
452 * Simply returns the handle of the timer service/daemon task. It it not valid
453 * to call xTimerGetTimerDaemonTaskHandle() before the scheduler has been started.
460 * Timer functionality is provided by a timer service/daemon task. Many of the
461 * public FreeRTOS timer API functions send commands to the timer service task
462 * through a queue called the timer command queue. The timer command queue is
463 * private to the kernel itself and is not directly accessible to application
464 * code. The length of the timer command queue is set by the
467 * xTimerStart() starts a timer that was previously created using the
468 * xTimerCreate() API function. If the timer had already been started and was
469 * already in the active state, then xTimerStart() has equivalent functionality
470 * to the xTimerReset() API function.
472 * Starting a timer ensures the timer is in the active state. If the timer
473 * is not stopped, deleted, or reset in the mean time, the callback function
474 * associated with the timer will get called 'n' ticks after xTimerStart() was
475 * called, where 'n' is the timers defined period.
477 * It is valid to call xTimerStart() before the scheduler has been started, but
478 * when this is done the timer will not actually start until the scheduler is
479 * started, and the timers expiry time will be relative to when the scheduler is
482 * The configUSE_TIMERS configuration constant must be set to 1 for xTimerStart()
485 * @param xTimer The handle of the timer being started/restarted.
487 * @param xTicksToWait Specifies the time, in ticks, that the calling task should
488 * be held in the Blocked state to wait for the start command to be successfully
489 * sent to the timer command queue, should the queue already be full when
491 * before the scheduler is started.
493 * @return pdFAIL will be returned if the start command could not be sent to
494 * the timer command queue even after xTicksToWait ticks had passed. pdPASS will
495 * be returned if the command was successfully sent to the timer command queue.
496 * When the command is actually processed will depend on the priority of the
497 * timer service/daemon task relative to other tasks in the system, although the
498 * timers expiry time is relative to when xTimerStart() is actually called. The
499 * timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY
504 * See the xTimerCreate() API function example usage scenario.
513 * Timer functionality is provided by a timer service/daemon task. Many of the
514 * public FreeRTOS timer API functions send commands to the timer service task
515 * through a queue called the timer command queue. The timer command queue is
516 * private to the kernel itself and is not directly accessible to application
517 * code. The length of the timer command queue is set by the
520 * xTimerStop() stops a timer that was previously started using either of the
521 * The xTimerStart(), xTimerReset(), xTimerStartFromISR(), xTimerResetFromISR(),
524 * Stopping a timer ensures the timer is not in the active state.
526 * The configUSE_TIMERS configuration constant must be set to 1 for xTimerStop()
529 * @param xTimer The handle of the timer being stopped.
531 * @param xTicksToWait Specifies the time, in ticks, that the calling task should
532 * be held in the Blocked state to wait for the stop command to be successfully
533 * sent to the timer command queue, should the queue already be full when
535 * before the scheduler is started.
537 * @return pdFAIL will be returned if the stop command could not be sent to
538 * the timer command queue even after xTicksToWait ticks had passed. pdPASS will
539 * be returned if the command was successfully sent to the timer command queue.
540 * When the command is actually processed will depend on the priority of the
541 * timer service/daemon task relative to other tasks in the system. The timer
542 * service/daemon task priority is set by the configTIMER_TASK_PRIORITY
547 * See the xTimerCreate() API function example usage scenario.
558 * Timer functionality is provided by a timer service/daemon task. Many of the
559 * public FreeRTOS timer API functions send commands to the timer service task
560 * through a queue called the timer command queue. The timer command queue is
561 * private to the kernel itself and is not directly accessible to application
562 * code. The length of the timer command queue is set by the
565 * xTimerChangePeriod() changes the period of a timer that was previously
566 * created using the xTimerCreate() API function.
568 * xTimerChangePeriod() can be called to change the period of an active or
571 * The configUSE_TIMERS configuration constant must be set to 1 for
574 * @param xTimer The handle of the timer that is having its period changed.
576 * @param xNewPeriod The new period for xTimer. Timer periods are specified in
577 * tick periods, so the constant portTICK_PERIOD_MS can be used to convert a time
578 * that has been specified in milliseconds. For example, if the timer must
580 * if the timer must expire after 500ms, then xNewPeriod can be set to
584 * @param xTicksToWait Specifies the time, in ticks, that the calling task should
585 * be held in the Blocked state to wait for the change period command to be
586 * successfully sent to the timer command queue, should the queue already be
588 * xTimerChangePeriod() is called before the scheduler is started.
590 * @return pdFAIL will be returned if the change period command could not be
591 * sent to the timer command queue even after xTicksToWait ticks had passed.
592 * pdPASS will be returned if the command was successfully sent to the timer
593 * command queue. When the command is actually processed will depend on the
594 * priority of the timer service/daemon task relative to other tasks in the
595 * system. The timer service/daemon task priority is set by the
600 * // This function assumes xTimer has already been created. If the timer
601 * // referenced by xTimer is already active when it is called, then the timer
602 * // is deleted. If the timer referenced by xTimer is not active when it is
603 * // called, then the period of the timer is set to 500ms and the timer is
615 * // cause the timer to start. Block for a maximum of 100 ticks if the
616 * // change period command cannot immediately be sent to the timer
620 * // The command was successfully sent.
624 * // The command could not be sent, even after waiting for 100 ticks
637 * Timer functionality is provided by a timer service/daemon task. Many of the
638 * public FreeRTOS timer API functions send commands to the timer service task
639 * through a queue called the timer command queue. The timer command queue is
640 * private to the kernel itself and is not directly accessible to application
641 * code. The length of the timer command queue is set by the
644 * xTimerDelete() deletes a timer that was previously created using the
647 * The configUSE_TIMERS configuration constant must be set to 1 for
650 * @param xTimer The handle of the timer being deleted.
652 * @param xTicksToWait Specifies the time, in ticks, that the calling task should
653 * be held in the Blocked state to wait for the delete command to be
654 * successfully sent to the timer command queue, should the queue already be
656 * is called before the scheduler is started.
658 * @return pdFAIL will be returned if the delete command could not be sent to
659 * the timer command queue even after xTicksToWait ticks had passed. pdPASS will
660 * be returned if the command was successfully sent to the timer command queue.
661 * When the command is actually processed will depend on the priority of the
662 * timer service/daemon task relative to other tasks in the system. The timer
663 * service/daemon task priority is set by the configTIMER_TASK_PRIORITY
668 * See the xTimerChangePeriod() API function example usage scenario.
676 * Timer functionality is provided by a timer service/daemon task. Many of the
677 * public FreeRTOS timer API functions send commands to the timer service task
678 * through a queue called the timer command queue. The timer command queue is
679 * private to the kernel itself and is not directly accessible to application
680 * code. The length of the timer command queue is set by the
683 * xTimerReset() re-starts a timer that was previously created using the
684 * xTimerCreate() API function. If the timer had already been started and was
685 * already in the active state, then xTimerReset() will cause the timer to
687 * called. If the timer was in the dormant state then xTimerReset() has
688 * equivalent functionality to the xTimerStart() API function.
690 * Resetting a timer ensures the timer is in the active state. If the timer
691 * is not stopped, deleted, or reset in the mean time, the callback function
692 * associated with the timer will get called 'n' ticks after xTimerReset() was
693 * called, where 'n' is the timers defined period.
695 * It is valid to call xTimerReset() before the scheduler has been started, but
696 * when this is done the timer will not actually start until the scheduler is
697 * started, and the timers expiry time will be relative to when the scheduler is
700 * The configUSE_TIMERS configuration constant must be set to 1 for xTimerReset()
703 * @param xTimer The handle of the timer being reset/started/restarted.
705 * @param xTicksToWait Specifies the time, in ticks, that the calling task should
706 * be held in the Blocked state to wait for the reset command to be successfully
707 * sent to the timer command queue, should the queue already be full when
709 * before the scheduler is started.
711 * @return pdFAIL will be returned if the reset command could not be sent to
712 * the timer command queue even after xTicksToWait ticks had passed. pdPASS will
713 * be returned if the command was successfully sent to the timer command queue.
714 * When the command is actually processed will depend on the priority of the
715 * timer service/daemon task relative to other tasks in the system, although the
716 * timers expiry time is relative to when xTimerStart() is actually called. The
717 * timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY
723 * // without a key being pressed, then the LCD back-light is switched off. In
724 * // this case, the timer is a one-shot timer.
728 * // The callback function assigned to the one-shot timer. In this case the
732 * // The timer expired, therefore 5 seconds must have passed since a key
733 * // was pressed. Switch off the LCD back-light.
737 * // The key press event handler.
740 * // Ensure the LCD back-light is on, then reset the timer that is
741 * // responsible for turning the back-light off after 5 seconds of
742 * // key inactivity. Wait 10 ticks for the command to be successfully sent
747 * // The reset command was not executed successfully. Take appropriate
751 * // Perform the rest of the key processing here.
758 * // Create then start the one-shot timer that is responsible for turning
759 * // the back-light off if no keys are pressed within a 5 second period.
760 …lightTimer = xTimerCreate( "BacklightTimer", // Just a text name, not used by the kernel.
761 * ( 5000 / portTICK_PERIOD_MS), // The timer period in ticks.
762 * pdFALSE, // The timer is a one-shot timer.
763 …* 0, // The id is not used by the cal…
764 … vBacklightTimerCallback // The callback function that switches the L…
769 * // The timer was not created.
773 * // Start the timer. No block time is specified, and even if one was
774 * // it would be ignored because the scheduler has not yet been
778 * // The timer could not be set into the Active state.
786 * // Starting the scheduler will start the timer running as it has already
787 * // been set into the active state.
805 * @param xTimer The handle of the timer being started/restarted.
807 * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most
808 * of its time in the Blocked state, waiting for messages to arrive on the timer
809 * command queue. Calling xTimerStartFromISR() writes a message to the timer
810 * command queue, so has the potential to transition the timer service/daemon
811 * task out of the Blocked state. If calling xTimerStartFromISR() causes the
812 * timer service/daemon task to leave the Blocked state, and the timer service/
813 * daemon task has a priority equal to or greater than the currently executing
814 * task (the task that was interrupted), then *pxHigherPriorityTaskWoken will
815 * get set to pdTRUE internally within the xTimerStartFromISR() function. If
817 * be performed before the interrupt exits.
819 * @return pdFAIL will be returned if the start command could not be sent to
820 * the timer command queue. pdPASS will be returned if the command was
821 * successfully sent to the timer command queue. When the command is actually
822 * processed will depend on the priority of the timer service/daemon task
823 * relative to other tasks in the system, although the timers expiry time is
824 * relative to when xTimerStartFromISR() is actually called. The timer
825 * service/daemon task priority is set by the configTIMER_TASK_PRIORITY
832 * // without a key being pressed, then the LCD back-light is switched off. In
833 * // this case, the timer is a one-shot timer, and unlike the example given for
834 * // the xTimerReset() function, the key press event handler is an interrupt
837 * // The callback function assigned to the one-shot timer. In this case the
841 * // The timer expired, therefore 5 seconds must have passed since a key
842 * // was pressed. Switch off the LCD back-light.
846 * // The key press interrupt service routine.
851 * // Ensure the LCD back-light is on, then restart the timer that is
852 * // responsible for turning the back-light off after 5 seconds of
858 * // as both cause the timer to re-calculate its expiry time.
863 * // The start command was not executed successfully. Take appropriate
867 * // Perform the rest of the key processing here.
870 * // should be performed. The syntax required to perform a context switch
872 * // compiler. Inspect the demos for the port you are using to find the
876 * // Call the interrupt safe yield function here (actual function
877 * // depends on the FreeRTOS port being used).
892 * @param xTimer The handle of the timer being stopped.
894 * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most
895 * of its time in the Blocked state, waiting for messages to arrive on the timer
896 * command queue. Calling xTimerStopFromISR() writes a message to the timer
897 * command queue, so has the potential to transition the timer service/daemon
898 * task out of the Blocked state. If calling xTimerStopFromISR() causes the
899 * timer service/daemon task to leave the Blocked state, and the timer service/
900 * daemon task has a priority equal to or greater than the currently executing
901 * task (the task that was interrupted), then *pxHigherPriorityTaskWoken will
902 * get set to pdTRUE internally within the xTimerStopFromISR() function. If
904 * be performed before the interrupt exits.
906 * @return pdFAIL will be returned if the stop command could not be sent to
907 * the timer command queue. pdPASS will be returned if the command was
908 * successfully sent to the timer command queue. When the command is actually
909 * processed will depend on the priority of the timer service/daemon task
910 * relative to other tasks in the system. The timer service/daemon task
911 * priority is set by the configTIMER_TASK_PRIORITY configuration constant.
916 * // an interrupt occurs, the timer should be simply stopped.
918 * // The interrupt service routine that stops the timer.
923 * // The interrupt has occurred - simply stop the timer.
929 * // The stop command was not executed successfully. Take appropriate
934 * // should be performed. The syntax required to perform a context switch
936 * // compiler. Inspect the demos for the port you are using to find the
940 * // Call the interrupt safe yield function here (actual function
941 * // depends on the FreeRTOS port being used).
957 * @param xTimer The handle of the timer that is having its period changed.
959 * @param xNewPeriod The new period for xTimer. Timer periods are specified in
960 * tick periods, so the constant portTICK_PERIOD_MS can be used to convert a time
961 * that has been specified in milliseconds. For example, if the timer must
963 * if the timer must expire after 500ms, then xNewPeriod can be set to
967 * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most
968 * of its time in the Blocked state, waiting for messages to arrive on the timer
969 * command queue. Calling xTimerChangePeriodFromISR() writes a message to the
970 * timer command queue, so has the potential to transition the timer service/
971 * daemon task out of the Blocked state. If calling xTimerChangePeriodFromISR()
972 * causes the timer service/daemon task to leave the Blocked state, and the
973 * timer service/daemon task has a priority equal to or greater than the
974 * currently executing task (the task that was interrupted), then
975 * *pxHigherPriorityTaskWoken will get set to pdTRUE internally within the
977 * this value to pdTRUE then a context switch should be performed before the
980 * @return pdFAIL will be returned if the command to change the timers period
981 * could not be sent to the timer command queue. pdPASS will be returned if the
982 * command was successfully sent to the timer command queue. When the command
983 * is actually processed will depend on the priority of the timer service/daemon
984 * task relative to other tasks in the system. The timer service/daemon task
985 * priority is set by the configTIMER_TASK_PRIORITY configuration constant.
990 * // an interrupt occurs, the period of xTimer should be changed to 500ms.
992 * // The interrupt service routine that changes the period of xTimer.
997 * // The interrupt has occurred - change the period of xTimer to 500ms.
1003 * // The command to change the timers period was not executed
1008 * // should be performed. The syntax required to perform a context switch
1010 * // compiler. Inspect the demos for the port you are using to find the
1014 * // Call the interrupt safe yield function here (actual function
1015 * // depends on the FreeRTOS port being used).
1030 * @param xTimer The handle of the timer that is to be started, reset, or
1033 * @param pxHigherPriorityTaskWoken The timer service/daemon task spends most
1034 * of its time in the Blocked state, waiting for messages to arrive on the timer
1035 * command queue. Calling xTimerResetFromISR() writes a message to the timer
1036 * command queue, so has the potential to transition the timer service/daemon
1037 * task out of the Blocked state. If calling xTimerResetFromISR() causes the
1038 * timer service/daemon task to leave the Blocked state, and the timer service/
1039 * daemon task has a priority equal to or greater than the currently executing
1040 * task (the task that was interrupted), then *pxHigherPriorityTaskWoken will
1041 * get set to pdTRUE internally within the xTimerResetFromISR() function. If
1043 * be performed before the interrupt exits.
1045 * @return pdFAIL will be returned if the reset command could not be sent to
1046 * the timer command queue. pdPASS will be returned if the command was
1047 * successfully sent to the timer command queue. When the command is actually
1048 * processed will depend on the priority of the timer service/daemon task
1049 * relative to other tasks in the system, although the timers expiry time is
1050 * relative to when xTimerResetFromISR() is actually called. The timer service/daemon
1051 * task priority is set by the configTIMER_TASK_PRIORITY configuration constant.
1057 * // without a key being pressed, then the LCD back-light is switched off. In
1058 * // this case, the timer is a one-shot timer, and unlike the example given for
1059 * // the xTimerReset() function, the key press event handler is an interrupt
1062 * // The callback function assigned to the one-shot timer. In this case the
1066 * // The timer expired, therefore 5 seconds must have passed since a key
1067 * // was pressed. Switch off the LCD back-light.
1071 * // The key press interrupt service routine.
1076 * // Ensure the LCD back-light is on, then reset the timer that is
1077 * // responsible for turning the back-light off after 5 seconds of
1083 * // as both cause the timer to re-calculate its expiry time.
1088 * // The reset command was not executed successfully. Take appropriate
1092 * // Perform the rest of the key processing here.
1095 * // should be performed. The syntax required to perform a context switch
1097 * // compiler. Inspect the demos for the port you are using to find the
1101 * // Call the interrupt safe yield function here (actual function
1102 * // depends on the FreeRTOS port being used).
1118 * Used from application interrupt service routines to defer the execution of a
1119 * function to the RTOS daemon task (the timer service task, hence this function
1126 * to the RTOS daemon task.
1128 * A mechanism is provided that allows the interrupt to return directly to the
1129 * task that will subsequently execute the pended callback function. This
1130 * allows the callback function to execute contiguously in time with the
1131 * interrupt - just as if the callback had executed in the interrupt itself.
1133 * @param xFunctionToPend The function to execute from the timer service/
1134 * daemon task. The function must conform to the PendedFunction_t
1137 * @param pvParameter1 The value of the callback function's first parameter.
1138 * The parameter has a void * type to allow it to be used to pass any type.
1139 * For example, unsigned longs can be cast to a void *, or the void * can be
1142 * @param ulParameter2 The value of the callback function's second parameter.
1145 * will result in a message being sent to the timer daemon task. If the
1146 * priority of the timer daemon task (which is set using
1147 * configTIMER_TASK_PRIORITY in FreeRTOSConfig.h) is higher than the priority of
1148 * the currently running task (the task the interrupt interrupted) then
1151 * requested before the interrupt exits. For that reason
1152 * *pxHigherPriorityTaskWoken must be initialised to pdFALSE. See the
1155 * @return pdPASS is returned if the message was successfully sent to the
1161 * // The callback function that will execute in the context of the daemon task.
1167 * // The interface that requires servicing is passed in the second
1168 * // parameter. The first parameter is not used in this case.
1171 * // ...Perform the processing here...
1179 * // Query the hardware to determine which interface needs processing.
1182 * // The actual processing is to be deferred to a task. Request the
1183 * // vProcessInterface() callback function is executed, passing in the
1184 * // number of the interface that needs processing. The interface to
1185 * // service is passed in the second parameter. The first parameter is
1191 * // switch should be requested. The macro used is port specific and will
1193 * // the documentation page for the port being used.
1213 * Used to defer the execution of a function to the RTOS daemon task (the timer
1217 * @param xFunctionToPend The function to execute from the timer service/
1218 * daemon task. The function must conform to the PendedFunction_t
1221 * @param pvParameter1 The value of the callback function's first parameter.
1222 * The parameter has a void * type to allow it to be used to pass any type.
1223 * For example, unsigned longs can be cast to a void *, or the void * can be
1226 * @param ulParameter2 The value of the callback function's second parameter.
1229 * sent to the timer daemon task on a queue. xTicksToWait is the amount of
1230 * time the calling task should remain in the Blocked state (so not using any
1231 * processing time) for space to become available on the timer queue if the
1234 * @return pdPASS is returned if the message was successfully sent to the
1248 * Returns the name that was assigned to a timer when the timer was created.
1250 * @param xTimer The handle of the timer being queried.
1252 * @return The name assigned to the timer specified by the xTimer parameter.
1259 * Updates a timer to be either an auto-reload timer, in which case the timer
1261 * which case the timer will only expire once unless it is manually restarted.
1263 * @param xTimer The handle of the timer being updated.
1265 * @param xAutoReload If xAutoReload is set to pdTRUE then the timer will
1266 * expire repeatedly with a frequency set by the timer's period (see the
1267 * xTimerPeriodInTicks parameter of the xTimerCreate() API function). If
1268 * xAutoReload is set to pdFALSE then the timer will be a one-shot timer and
1269 * enter the dormant state after it expires.
1277 * Queries a timer to determine if it is an auto-reload timer, in which case the timer
1279 * which case the timer will only expire once unless it is manually restarted.
1281 * @param xTimer The handle of the timer being queried.
1283 * @return If the timer is an auto-reload timer then pdTRUE is returned, otherwise
1291 * Queries a timer to determine if it is an auto-reload timer, in which case the timer
1293 * which case the timer will only expire once unless it is manually restarted.
1295 * @param xTimer The handle of the timer being queried.
1297 * @return If the timer is an auto-reload timer then pdTRUE is returned, otherwise
1305 * Returns the period of a timer.
1307 * @param xTimer The handle of the timer being queried.
1309 * @return The period of the timer in ticks.
1316 * Returns the time in ticks at which the timer will expire. If this is less
1317 * than the current tick count then the expiry time has overflowed from the
1320 * @param xTimer The handle of the timer being queried.
1322 * @return If the timer is running then the time in ticks at which the timer
1323 * will next expire is returned. If the timer is not running then the return
1333 * buffer. This is the same buffer that is supplied at the time of
1336 * @param xTimer The timer for which to retrieve the buffer.
1338 * @param ppxTaskBuffer Used to return a pointer to the timers's data
1341 * @return pdTRUE if the buffer was retrieved, pdFALSE otherwise.
1349 * Functions beyond this part are not part of the public API and are intended
1350 * for use by the kernel only.
1355 * Splitting the xTimerGenericCommand into two sub functions and making it a macro
1356 * removes a recursion path when called from ISRs. This is primarily for the XCore
1357 * XCC port which detects the recursion path and throws an error during compilation
1390 …* This function is used to provide a statically allocated block of memory to FreeRTOS to hold the
1394 * @param ppxTimerTaskStackBuffer A handle to a statically allocated Stack buffer for the idle task
1395 …* @param pulTimerTaskStackSize A pointer to the number of elements that will fit in the allocate…
1411 * This hook function is called form the timer task once when the task starts running.