1 | Timer Manager |
---|
2 | ############# |
---|
3 | |
---|
4 | .. index:: timers |
---|
5 | |
---|
6 | Introduction |
---|
7 | ============ |
---|
8 | |
---|
9 | The timer manager provides support for timer |
---|
10 | facilities. The directives provided by the timer manager are: |
---|
11 | |
---|
12 | - ``rtems_timer_create`` - Create a timer |
---|
13 | |
---|
14 | - ``rtems_timer_ident`` - Get ID of a timer |
---|
15 | |
---|
16 | - ``rtems_timer_cancel`` - Cancel a timer |
---|
17 | |
---|
18 | - ``rtems_timer_delete`` - Delete a timer |
---|
19 | |
---|
20 | - ``rtems_timer_fire_after`` - Fire timer after interval |
---|
21 | |
---|
22 | - ``rtems_timer_fire_when`` - Fire timer when specified |
---|
23 | |
---|
24 | - ``rtems_timer_initiate_server`` - Initiate server for task-based timers |
---|
25 | |
---|
26 | - ``rtems_timer_server_fire_after`` - Fire task-based timer after interval |
---|
27 | |
---|
28 | - ``rtems_timer_server_fire_when`` - Fire task-based timer when specified |
---|
29 | |
---|
30 | - ``rtems_timer_reset`` - Reset an interval timer |
---|
31 | |
---|
32 | Background |
---|
33 | ========== |
---|
34 | |
---|
35 | Required Support |
---|
36 | ---------------- |
---|
37 | |
---|
38 | A clock tick is required to support the functionality provided by this manager. |
---|
39 | |
---|
40 | Timers |
---|
41 | ------ |
---|
42 | |
---|
43 | A timer is an RTEMS object which allows the |
---|
44 | application to schedule operations to occur at specific times in |
---|
45 | the future. User supplied timer service routines are invoked by |
---|
46 | either the ``rtems_clock_tick`` directive or |
---|
47 | a special Timer Server task when the timer fires. Timer service |
---|
48 | routines may perform any operations or directives which normally |
---|
49 | would be performed by the application code which invoked the``rtems_clock_tick`` directive. |
---|
50 | |
---|
51 | The timer can be used to implement watchdog routines |
---|
52 | which only fire to denote that an application error has |
---|
53 | occurred. The timer is reset at specific points in the |
---|
54 | application to ensure that the watchdog does not fire. Thus, if |
---|
55 | the application does not reset the watchdog timer, then the |
---|
56 | timer service routine will fire to indicate that the application |
---|
57 | has failed to reach a reset point. This use of a timer is |
---|
58 | sometimes referred to as a "keep alive" or a "deadman" timer. |
---|
59 | |
---|
60 | Timer Server |
---|
61 | ------------ |
---|
62 | |
---|
63 | The Timer Server task is responsible for executing the timer |
---|
64 | service routines associated with all task-based timers. |
---|
65 | This task executes at a priority higher than any RTEMS application |
---|
66 | task, and is created non-preemptible, and thus can be viewed logically as |
---|
67 | the lowest priority interrupt. |
---|
68 | |
---|
69 | By providing a mechanism where timer service routines execute |
---|
70 | in task rather than interrupt space, the application is |
---|
71 | allowed a bit more flexibility in what operations a timer |
---|
72 | service routine can perform. For example, the Timer Server |
---|
73 | can be configured to have a floating point context in which case |
---|
74 | it would be safe to perform floating point operations |
---|
75 | from a task-based timer. Most of the time, executing floating |
---|
76 | point instructions from an interrupt service routine |
---|
77 | is not considered safe. However, since the Timer Server task |
---|
78 | is non-preemptible, only directives allowed from an ISR can be |
---|
79 | called in the timer service routine. |
---|
80 | |
---|
81 | The Timer Server is designed to remain blocked until a |
---|
82 | task-based timer fires. This reduces the execution overhead |
---|
83 | of the Timer Server. |
---|
84 | |
---|
85 | Timer Service Routines |
---|
86 | ---------------------- |
---|
87 | |
---|
88 | The timer service routine should adhere to C calling |
---|
89 | conventions and have a prototype similar to the following:.. index:: rtems_timer_service_routine |
---|
90 | |
---|
91 | .. code:: c |
---|
92 | |
---|
93 | rtems_timer_service_routine user_routine( |
---|
94 | rtems_id timer_id, |
---|
95 | void \*user_data |
---|
96 | ); |
---|
97 | |
---|
98 | Where the timer_id parameter is the RTEMS object ID |
---|
99 | of the timer which is being fired and user_data is a pointer to |
---|
100 | user-defined information which may be utilized by the timer |
---|
101 | service routine. The argument user_data may be NULL. |
---|
102 | |
---|
103 | Operations |
---|
104 | ========== |
---|
105 | |
---|
106 | Creating a Timer |
---|
107 | ---------------- |
---|
108 | |
---|
109 | The ``rtems_timer_create`` directive creates a timer by |
---|
110 | allocating a Timer Control Block (TMCB), assigning the timer a |
---|
111 | user-specified name, and assigning it a timer ID. Newly created |
---|
112 | timers do not have a timer service routine associated with them |
---|
113 | and are not active. |
---|
114 | |
---|
115 | Obtaining Timer IDs |
---|
116 | ------------------- |
---|
117 | |
---|
118 | When a timer is created, RTEMS generates a unique |
---|
119 | timer ID and assigns it to the created timer until it is |
---|
120 | deleted. The timer ID may be obtained by either of two methods. |
---|
121 | First, as the result of an invocation of the``rtems_timer_create`` |
---|
122 | directive, the timer ID is stored in a user provided location. |
---|
123 | Second, the timer ID may be obtained later using the``rtems_timer_ident`` directive. The timer ID |
---|
124 | is used by other directives to manipulate this timer. |
---|
125 | |
---|
126 | Initiating an Interval Timer |
---|
127 | ---------------------------- |
---|
128 | |
---|
129 | The ``rtems_timer_fire_after`` |
---|
130 | and ``rtems_timer_server_fire_after`` |
---|
131 | directives initiate a timer to fire a user provided |
---|
132 | timer service routine after the specified |
---|
133 | number of clock ticks have elapsed. When the interval has |
---|
134 | elapsed, the timer service routine will be invoked from the``rtems_clock_tick`` directive if it was initiated |
---|
135 | by the ``rtems_timer_fire_after`` directive |
---|
136 | and from the Timer Server task if initiated by the``rtems_timer_server_fire_after`` directive. |
---|
137 | |
---|
138 | Initiating a Time of Day Timer |
---|
139 | ------------------------------ |
---|
140 | |
---|
141 | The ``rtems_timer_fire_when`` |
---|
142 | and ``rtems_timer_server_fire_when`` |
---|
143 | directive initiate a timer to |
---|
144 | fire a user provided timer service routine when the specified |
---|
145 | time of day has been reached. When the interval has elapsed, |
---|
146 | the timer service routine will be invoked from the``rtems_clock_tick`` directive |
---|
147 | by the ``rtems_timer_fire_when`` directive |
---|
148 | and from the Timer Server task if initiated by the``rtems_timer_server_fire_when`` directive. |
---|
149 | |
---|
150 | Canceling a Timer |
---|
151 | ----------------- |
---|
152 | |
---|
153 | The ``rtems_timer_cancel`` directive is used to halt the |
---|
154 | specified timer. Once canceled, the timer service routine will |
---|
155 | not fire unless the timer is reinitiated. The timer can be |
---|
156 | reinitiated using the ``rtems_timer_reset``,``rtems_timer_fire_after``, and``rtems_timer_fire_when`` directives. |
---|
157 | |
---|
158 | Resetting a Timer |
---|
159 | ----------------- |
---|
160 | |
---|
161 | The ``rtems_timer_reset`` directive is used to restore an |
---|
162 | interval timer initiated by a previous invocation of``rtems_timer_fire_after`` or``rtems_timer_server_fire_after`` to |
---|
163 | its original interval length. If the |
---|
164 | timer has not been used or the last usage of this timer |
---|
165 | was by the ``rtems_timer_fire_when`` |
---|
166 | or ``rtems_timer_server_fire_when`` |
---|
167 | directive, then an error is returned. The timer service routine |
---|
168 | is not changed or fired by this directive. |
---|
169 | |
---|
170 | Initiating the Timer Server |
---|
171 | --------------------------- |
---|
172 | |
---|
173 | The ``rtems_timer_initiate_server`` directive is used to |
---|
174 | allocate and start the execution of the Timer Server task. The |
---|
175 | application can specify both the stack size and attributes of the |
---|
176 | Timer Server. The Timer Server executes at a priority higher than |
---|
177 | any application task and thus the user can expect to be preempted |
---|
178 | as the result of executing the ``rtems_timer_initiate_server`` |
---|
179 | directive. |
---|
180 | |
---|
181 | Deleting a Timer |
---|
182 | ---------------- |
---|
183 | |
---|
184 | The ``rtems_timer_delete`` directive is used to delete a timer. |
---|
185 | If the timer is running and has not expired, the timer is |
---|
186 | automatically canceled. The timerâs control block is returned |
---|
187 | to the TMCB free list when it is deleted. A timer can be |
---|
188 | deleted by a task other than the task which created the timer. |
---|
189 | Any subsequent references to the timerâs name and ID are invalid. |
---|
190 | |
---|
191 | Directives |
---|
192 | ========== |
---|
193 | |
---|
194 | This section details the timer managerâs directives. |
---|
195 | A subsection is dedicated to each of this managerâs directives |
---|
196 | and describes the calling sequence, related constants, usage, |
---|
197 | and status codes. |
---|
198 | |
---|
199 | TIMER_CREATE - Create a timer |
---|
200 | ----------------------------- |
---|
201 | .. index:: create a timer |
---|
202 | |
---|
203 | **CALLING SEQUENCE:** |
---|
204 | |
---|
205 | .. index:: rtems_timer_create |
---|
206 | |
---|
207 | .. code:: c |
---|
208 | |
---|
209 | rtems_status_code rtems_timer_create( |
---|
210 | rtems_name name, |
---|
211 | rtems_id \*id |
---|
212 | ); |
---|
213 | |
---|
214 | **DIRECTIVE STATUS CODES:** |
---|
215 | |
---|
216 | ``RTEMS_SUCCESSFUL`` - timer created successfully |
---|
217 | ``RTEMS_INVALID_ADDRESS`` - ``id`` is NULL |
---|
218 | ``RTEMS_INVALID_NAME`` - invalid timer name |
---|
219 | ``RTEMS_TOO_MANY`` - too many timers created |
---|
220 | |
---|
221 | **DESCRIPTION:** |
---|
222 | |
---|
223 | This directive creates a timer. The assigned timer |
---|
224 | id is returned in id. This id is used to access the timer with |
---|
225 | other timer manager directives. For control and maintenance of |
---|
226 | the timer, RTEMS allocates a TMCB from the local TMCB free pool |
---|
227 | and initializes it. |
---|
228 | |
---|
229 | **NOTES:** |
---|
230 | |
---|
231 | This directive will not cause the calling task to be |
---|
232 | preempted. |
---|
233 | |
---|
234 | TIMER_IDENT - Get ID of a timer |
---|
235 | ------------------------------- |
---|
236 | .. index:: obtain the ID of a timer |
---|
237 | |
---|
238 | **CALLING SEQUENCE:** |
---|
239 | |
---|
240 | .. index:: rtems_timer_ident |
---|
241 | |
---|
242 | .. code:: c |
---|
243 | |
---|
244 | rtems_status_code rtems_timer_ident( |
---|
245 | rtems_name name, |
---|
246 | rtems_id \*id |
---|
247 | ); |
---|
248 | |
---|
249 | **DIRECTIVE STATUS CODES:** |
---|
250 | |
---|
251 | ``RTEMS_SUCCESSFUL`` - timer identified successfully |
---|
252 | ``RTEMS_INVALID_ADDRESS`` - ``id`` is NULL |
---|
253 | ``RTEMS_INVALID_NAME`` - timer name not found |
---|
254 | |
---|
255 | **DESCRIPTION:** |
---|
256 | |
---|
257 | This directive obtains the timer id associated with |
---|
258 | the timer name to be acquired. If the timer name is not unique, |
---|
259 | then the timer id will match one of the timers with that name. |
---|
260 | However, this timer id is not guaranteed to correspond to the |
---|
261 | desired timer. The timer id is used to access this timer in |
---|
262 | other timer related directives. |
---|
263 | |
---|
264 | **NOTES:** |
---|
265 | |
---|
266 | This directive will not cause the running task to be |
---|
267 | preempted. |
---|
268 | |
---|
269 | TIMER_CANCEL - Cancel a timer |
---|
270 | ----------------------------- |
---|
271 | .. index:: cancel a timer |
---|
272 | |
---|
273 | **CALLING SEQUENCE:** |
---|
274 | |
---|
275 | .. index:: rtems_timer_cancel |
---|
276 | |
---|
277 | .. code:: c |
---|
278 | |
---|
279 | rtems_status_code rtems_timer_cancel( |
---|
280 | rtems_id id |
---|
281 | ); |
---|
282 | |
---|
283 | **DIRECTIVE STATUS CODES:** |
---|
284 | |
---|
285 | ``RTEMS_SUCCESSFUL`` - timer canceled successfully |
---|
286 | ``RTEMS_INVALID_ID`` - invalid timer id |
---|
287 | |
---|
288 | **DESCRIPTION:** |
---|
289 | |
---|
290 | This directive cancels the timer id. This timer will |
---|
291 | be reinitiated by the next invocation of ``rtems_timer_reset``,``rtems_timer_fire_after``, or``rtems_timer_fire_when`` with this id. |
---|
292 | |
---|
293 | **NOTES:** |
---|
294 | |
---|
295 | This directive will not cause the running task to be preempted. |
---|
296 | |
---|
297 | TIMER_DELETE - Delete a timer |
---|
298 | ----------------------------- |
---|
299 | .. index:: delete a timer |
---|
300 | |
---|
301 | **CALLING SEQUENCE:** |
---|
302 | |
---|
303 | .. index:: rtems_timer_delete |
---|
304 | |
---|
305 | .. code:: c |
---|
306 | |
---|
307 | rtems_status_code rtems_timer_delete( |
---|
308 | rtems_id id |
---|
309 | ); |
---|
310 | |
---|
311 | **DIRECTIVE STATUS CODES:** |
---|
312 | |
---|
313 | ``RTEMS_SUCCESSFUL`` - timer deleted successfully |
---|
314 | ``RTEMS_INVALID_ID`` - invalid timer id |
---|
315 | |
---|
316 | **DESCRIPTION:** |
---|
317 | |
---|
318 | This directive deletes the timer specified by id. If |
---|
319 | the timer is running, it is automatically canceled. The TMCB |
---|
320 | for the deleted timer is reclaimed by RTEMS. |
---|
321 | |
---|
322 | **NOTES:** |
---|
323 | |
---|
324 | This directive will not cause the running task to be |
---|
325 | preempted. |
---|
326 | |
---|
327 | A timer can be deleted by a task other than the task |
---|
328 | which created the timer. |
---|
329 | |
---|
330 | TIMER_FIRE_AFTER - Fire timer after interval |
---|
331 | -------------------------------------------- |
---|
332 | .. index:: fire a timer after an interval |
---|
333 | |
---|
334 | **CALLING SEQUENCE:** |
---|
335 | |
---|
336 | .. index:: rtems_timer_fire_after |
---|
337 | |
---|
338 | .. code:: c |
---|
339 | |
---|
340 | rtems_status_code rtems_timer_fire_after( |
---|
341 | rtems_id id, |
---|
342 | rtems_interval ticks, |
---|
343 | rtems_timer_service_routine_entry routine, |
---|
344 | void \*user_data |
---|
345 | ); |
---|
346 | |
---|
347 | **DIRECTIVE STATUS CODES:** |
---|
348 | |
---|
349 | ``RTEMS_SUCCESSFUL`` - timer initiated successfully |
---|
350 | ``RTEMS_INVALID_ADDRESS`` - ``routine`` is NULL |
---|
351 | ``RTEMS_INVALID_ID`` - invalid timer id |
---|
352 | ``RTEMS_INVALID_NUMBER`` - invalid interval |
---|
353 | |
---|
354 | **DESCRIPTION:** |
---|
355 | |
---|
356 | This directive initiates the timer specified by id. |
---|
357 | If the timer is running, it is automatically canceled before |
---|
358 | being initiated. The timer is scheduled to fire after an |
---|
359 | interval ticks clock ticks has passed. When the timer fires, |
---|
360 | the timer service routine routine will be invoked with the |
---|
361 | argument user_data. |
---|
362 | |
---|
363 | **NOTES:** |
---|
364 | |
---|
365 | This directive will not cause the running task to be |
---|
366 | preempted. |
---|
367 | |
---|
368 | TIMER_FIRE_WHEN - Fire timer when specified |
---|
369 | ------------------------------------------- |
---|
370 | .. index:: fire a timer at wall time |
---|
371 | |
---|
372 | **CALLING SEQUENCE:** |
---|
373 | |
---|
374 | .. index:: rtems_timer_fire_when |
---|
375 | |
---|
376 | .. code:: c |
---|
377 | |
---|
378 | rtems_status_code rtems_timer_fire_when( |
---|
379 | rtems_id id, |
---|
380 | rtems_time_of_day \*wall_time, |
---|
381 | rtems_timer_service_routine_entry routine, |
---|
382 | void \*user_data |
---|
383 | ); |
---|
384 | |
---|
385 | **DIRECTIVE STATUS CODES:** |
---|
386 | |
---|
387 | ``RTEMS_SUCCESSFUL`` - timer initiated successfully |
---|
388 | ``RTEMS_INVALID_ADDRESS`` - ``routine`` is NULL |
---|
389 | ``RTEMS_INVALID_ADDRESS`` - ``wall_time`` is NULL |
---|
390 | ``RTEMS_INVALID_ID`` - invalid timer id |
---|
391 | ``RTEMS_NOT_DEFINED`` - system date and time is not set |
---|
392 | ``RTEMS_INVALID_CLOCK`` - invalid time of day |
---|
393 | |
---|
394 | **DESCRIPTION:** |
---|
395 | |
---|
396 | This directive initiates the timer specified by id. |
---|
397 | If the timer is running, it is automatically canceled before |
---|
398 | being initiated. The timer is scheduled to fire at the time of |
---|
399 | day specified by wall_time. When the timer fires, the timer |
---|
400 | service routine routine will be invoked with the argument |
---|
401 | user_data. |
---|
402 | |
---|
403 | **NOTES:** |
---|
404 | |
---|
405 | This directive will not cause the running task to be |
---|
406 | preempted. |
---|
407 | |
---|
408 | TIMER_INITIATE_SERVER - Initiate server for task-based timers |
---|
409 | ------------------------------------------------------------- |
---|
410 | .. index:: initiate the Timer Server |
---|
411 | |
---|
412 | **CALLING SEQUENCE:** |
---|
413 | |
---|
414 | .. index:: rtems_timer_initiate_server |
---|
415 | |
---|
416 | .. code:: c |
---|
417 | |
---|
418 | rtems_status_code rtems_timer_initiate_server( |
---|
419 | uint32_t priority, |
---|
420 | uint32_t stack_size, |
---|
421 | rtems_attribute attribute_set |
---|
422 | ) |
---|
423 | ); |
---|
424 | |
---|
425 | **DIRECTIVE STATUS CODES:** |
---|
426 | |
---|
427 | ``RTEMS_SUCCESSFUL`` - Timer Server initiated successfully |
---|
428 | ``RTEMS_TOO_MANY`` - too many tasks created |
---|
429 | |
---|
430 | **DESCRIPTION:** |
---|
431 | |
---|
432 | This directive initiates the Timer Server task. This task |
---|
433 | is responsible for executing all timers initiated via the``rtems_timer_server_fire_after`` or``rtems_timer_server_fire_when`` directives. |
---|
434 | |
---|
435 | **NOTES:** |
---|
436 | |
---|
437 | This directive could cause the calling task to be preempted. |
---|
438 | |
---|
439 | The Timer Server task is created using the``rtems_task_create`` service and must be accounted |
---|
440 | for when configuring the system. |
---|
441 | |
---|
442 | Even through this directive invokes the ``rtems_task_create`` |
---|
443 | and ``rtems_task_start`` directives, it should only fail |
---|
444 | due to resource allocation problems. |
---|
445 | |
---|
446 | TIMER_SERVER_FIRE_AFTER - Fire task-based timer after interval |
---|
447 | -------------------------------------------------------------- |
---|
448 | .. index:: fire task-based a timer after an interval |
---|
449 | |
---|
450 | **CALLING SEQUENCE:** |
---|
451 | |
---|
452 | .. index:: rtems_timer_server_fire_after |
---|
453 | |
---|
454 | .. code:: c |
---|
455 | |
---|
456 | rtems_status_code rtems_timer_server_fire_after( |
---|
457 | rtems_id id, |
---|
458 | rtems_interval ticks, |
---|
459 | rtems_timer_service_routine_entry routine, |
---|
460 | void \*user_data |
---|
461 | ); |
---|
462 | |
---|
463 | **DIRECTIVE STATUS CODES:** |
---|
464 | |
---|
465 | ``RTEMS_SUCCESSFUL`` - timer initiated successfully |
---|
466 | ``RTEMS_INVALID_ADDRESS`` - ``routine`` is NULL |
---|
467 | ``RTEMS_INVALID_ID`` - invalid timer id |
---|
468 | ``RTEMS_INVALID_NUMBER`` - invalid interval |
---|
469 | ``RTEMS_INCORRECT_STATE`` - Timer Server not initiated |
---|
470 | |
---|
471 | **DESCRIPTION:** |
---|
472 | |
---|
473 | This directive initiates the timer specified by id and specifies |
---|
474 | that when it fires it will be executed by the Timer Server. |
---|
475 | |
---|
476 | If the timer is running, it is automatically canceled before |
---|
477 | being initiated. The timer is scheduled to fire after an |
---|
478 | interval ticks clock ticks has passed. When the timer fires, |
---|
479 | the timer service routine routine will be invoked with the |
---|
480 | argument user_data. |
---|
481 | |
---|
482 | **NOTES:** |
---|
483 | |
---|
484 | This directive will not cause the running task to be |
---|
485 | preempted. |
---|
486 | |
---|
487 | TIMER_SERVER_FIRE_WHEN - Fire task-based timer when specified |
---|
488 | ------------------------------------------------------------- |
---|
489 | .. index:: fire a task-based timer at wall time |
---|
490 | |
---|
491 | **CALLING SEQUENCE:** |
---|
492 | |
---|
493 | .. index:: rtems_timer_server_fire_when |
---|
494 | |
---|
495 | .. code:: c |
---|
496 | |
---|
497 | rtems_status_code rtems_timer_server_fire_when( |
---|
498 | rtems_id id, |
---|
499 | rtems_time_of_day \*wall_time, |
---|
500 | rtems_timer_service_routine_entry routine, |
---|
501 | void \*user_data |
---|
502 | ); |
---|
503 | |
---|
504 | **DIRECTIVE STATUS CODES:** |
---|
505 | |
---|
506 | ``RTEMS_SUCCESSFUL`` - timer initiated successfully |
---|
507 | ``RTEMS_INVALID_ADDRESS`` - ``routine`` is NULL |
---|
508 | ``RTEMS_INVALID_ADDRESS`` - ``wall_time`` is NULL |
---|
509 | ``RTEMS_INVALID_ID`` - invalid timer id |
---|
510 | ``RTEMS_NOT_DEFINED`` - system date and time is not set |
---|
511 | ``RTEMS_INVALID_CLOCK`` - invalid time of day |
---|
512 | ``RTEMS_INCORRECT_STATE`` - Timer Server not initiated |
---|
513 | |
---|
514 | **DESCRIPTION:** |
---|
515 | |
---|
516 | This directive initiates the timer specified by id and specifies |
---|
517 | that when it fires it will be executed by the Timer Server. |
---|
518 | |
---|
519 | If the timer is running, it is automatically canceled before |
---|
520 | being initiated. The timer is scheduled to fire at the time of |
---|
521 | day specified by wall_time. When the timer fires, the timer |
---|
522 | service routine routine will be invoked with the argument |
---|
523 | user_data. |
---|
524 | |
---|
525 | **NOTES:** |
---|
526 | |
---|
527 | This directive will not cause the running task to be |
---|
528 | preempted. |
---|
529 | |
---|
530 | TIMER_RESET - Reset an interval timer |
---|
531 | ------------------------------------- |
---|
532 | .. index:: reset a timer |
---|
533 | |
---|
534 | **CALLING SEQUENCE:** |
---|
535 | |
---|
536 | .. index:: rtems_timer_reset |
---|
537 | |
---|
538 | .. code:: c |
---|
539 | |
---|
540 | rtems_status_code rtems_timer_reset( |
---|
541 | rtems_id id |
---|
542 | ); |
---|
543 | |
---|
544 | **DIRECTIVE STATUS CODES:** |
---|
545 | |
---|
546 | ``RTEMS_SUCCESSFUL`` - timer reset successfully |
---|
547 | ``RTEMS_INVALID_ID`` - invalid timer id |
---|
548 | ``RTEMS_NOT_DEFINED`` - attempted to reset a when or newly created timer |
---|
549 | |
---|
550 | **DESCRIPTION:** |
---|
551 | |
---|
552 | This directive resets the timer associated with id. |
---|
553 | This timer must have been previously initiated with either the``rtems_timer_fire_after`` or``rtems_timer_server_fire_after`` |
---|
554 | directive. If active the timer is canceled, |
---|
555 | after which the timer is reinitiated using the same interval and |
---|
556 | timer service routine which the original``rtems_timer_fire_after````rtems_timer_server_fire_after`` |
---|
557 | directive used. |
---|
558 | |
---|
559 | **NOTES:** |
---|
560 | |
---|
561 | If the timer has not been used or the last usage of this timer |
---|
562 | was by a ``rtems_timer_fire_when`` or``rtems_timer_server_fire_when`` |
---|
563 | directive, then the ``RTEMS_NOT_DEFINED`` error is |
---|
564 | returned. |
---|
565 | |
---|
566 | Restarting a cancelled after timer results in the timer being |
---|
567 | reinitiated with its previous timer service routine and interval. |
---|
568 | |
---|
569 | This directive will not cause the running task to be preempted. |
---|
570 | |
---|
571 | .. COMMENT: COPYRIGHT (c) 1988-2013. |
---|
572 | |
---|
573 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
574 | |
---|
575 | .. COMMENT: All rights reserved. |
---|
576 | |
---|
577 | .. COMMENT: Open Issues |
---|
578 | |
---|
579 | .. COMMENT: - nicen up the tables |
---|
580 | |
---|
581 | .. COMMENT: - use math mode to print formulas |
---|
582 | |
---|