source: rtems/c/src/exec/posix/src/ptimer1.c @ 02fe6ab

4.104.114.84.95
Last change on this file since 02fe6ab was 02fe6ab, checked in by Joel Sherrill <joel.sherrill@…>, on 08/15/00 at 13:23:13

2000-08-15 Joel Sherrill <joel@…>

  • src/ptimer1.c: Minor formatting fixes.
  • Property mode set to 100644
File size: 22.5 KB
Line 
1/*
2 *  ptimer.c,v 1.1 1996/06/03 16:29:58 joel Exp
3 */
4 
5#include <assert.h>
6#include <time.h>
7#include <errno.h>
8
9#include <rtems/system.h>
10#include <rtems/score/isr.h>
11#include <rtems/score/thread.h>
12#include <rtems/score/tod.h>
13
14#include <rtems/posix/time.h>
15
16/************************************/
17/* These includes are now necessary */
18/************************************/
19
20#include <sys/features.h>
21#include <rtems/rtems/status.h>
22#include <rtems/rtems/types.h>
23#include <rtems/rtems/timer.h>
24#include <rtems/rtems/clock.h>
25#include <rtems/posix/psignal.h>
26#include <rtems/score/wkspace.h>
27#include <pthread.h>
28#include <stdio.h>
29#include <signal.h>
30
31#include <rtems/posix/seterr.h>
32#include <rtems/posix/timer.h>
33
34/*****************************/
35/* End of necessary includes */
36/*****************************/
37
38/* ************
39 * Constants
40 * ************/
41
42/*
43#define DEBUG_MESSAGES
44 */
45
46/*
47 * Data for the signals
48 */
49
50struct sigaction signal_inf[SIGRTMAX];
51
52/***********************************
53 * Definition of Internal Functions
54 ***********************************/
55
56/* ***************************************************************************
57 * PRINT_MSG_S
58 *
59 *  Description: This function write a message in the display.
60 *               It is used for debugging and all the calls must be deleted
61 *               when the tests finish
62 * ***************************************************************************/
63
64static void PRINT_MSG_S ( char *msg )
65{
66
67#ifdef DEBUG_MESSAGES
68   printf("%s\n", msg);
69#endif
70
71}
72
73/* ***************************************************************************
74 * TIMER_INITIALIZE_S
75 *
76 *  Description: Initialize the data of a timer
77 * ***************************************************************************/
78
79extern void TIMER_INITIALIZE_S ( int timer_pos );
80
81/* ***************************************************************************
82 * _POSIX_Timer_Manager_initialization
83 *
84 *  Description: Initialize the internal structure in which the data of all
85 *               the timers are stored
86 * ***************************************************************************/
87
88/* split to reduce minimum size */
89
90/* ***************************************************************************
91 * FIRST_FREE_POSITION_F
92 *
93 *  Description: Returns the first free position in the table of timers.
94 *               If there is not a free position, it returns NO_MORE_TIMERS_C
95 * ***************************************************************************/
96
97int FIRST_FREE_POSITION_F ()
98{
99   int index;
100
101   for (index=0; index<timer_max; index++) {
102      if ( timer_struct[index].state == STATE_FREE_C ) {
103         return index;
104      }
105   }
106   
107   /* The function reaches this point only if all the position are occupied */
108
109   return NO_MORE_TIMERS_C;
110}
111
112/* ***************************************************************************
113 * TIMER_POSITION_F
114 *
115 *  Description: Returns the position in the table of timers in which the
116 *               data of the timer are stored.
117 *               If the timer identifier does not exist, it returns
118 *               BAD_TIMER_C
119 * ***************************************************************************/
120
121int TIMER_POSITION_F ( timer_t timer_id )
122{
123  int index;
124
125  for (index=0; index<timer_max; index++ ) {
126
127     /* Looks for the position of the timer. The timer must exist and the
128      * position can not be free */
129     if ( ( timer_struct[index].timer_id == timer_id ) &&
130          ( timer_struct[index].state != STATE_FREE_C ) ) {
131        return index;
132     }
133  }
134
135  /* If the function reaches this point is because the timer identifier
136   * is not correct */
137
138   return BAD_TIMER_C;
139
140}
141
142/* ***************************************************************************
143 * COPY_ITIMERSPEC_S
144 *
145 *  Description: Does a copy of a variable of type struct itimerspec 
146 * ***************************************************************************/
147
148void COPY_ITIMERSPEC_S ( const struct itimerspec *source,
149                         struct itimerspec *target )
150{
151
152   target->it_value.tv_sec     = source->it_value.tv_sec;
153   target->it_value.tv_nsec    = source->it_value.tv_nsec;
154   target->it_interval.tv_sec  = source->it_interval.tv_sec;
155   target->it_interval.tv_nsec = source->it_interval.tv_nsec;
156
157}
158
159/* ***************************************************************************
160 * ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S
161 *
162 *  Description: This function converts the data of a structure itimerspec
163 *               into structure rtems_time_of_day
164 * ***************************************************************************/
165
166void ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S
167   ( const struct itimerspec *itimer, rtems_time_of_day *rtems_time )
168{
169   unsigned long int seconds;
170
171   /* The leap years and the months with 28, 29 or 31 days have not been
172    * considerated. It will be made in the future */
173
174   seconds            = itimer->it_value.tv_sec;
175
176   rtems_time->year   = seconds / SECONDS_PER_YEAR_C;
177   seconds            = seconds % SECONDS_PER_YEAR_C;
178
179   rtems_time->month  = seconds / SECONDS_PER_MONTH_C;
180   seconds            = seconds % SECONDS_PER_MONTH_C;
181
182   rtems_time->day    = seconds / SECONDS_PER_DAY_C;
183   seconds            = seconds % SECONDS_PER_DAY_C;
184
185   rtems_time->hour   = seconds / SECONDS_PER_HOUR_C;
186   seconds            = seconds % SECONDS_PER_HOUR_C;
187
188   rtems_time->minute = seconds / SECONDS_PER_MINUTE_C;
189   seconds            = seconds % SECONDS_PER_MINUTE_C;
190
191   rtems_time->second = seconds;
192
193   rtems_time->ticks  = ( itimer->it_value.tv_nsec * SEC_TO_TICKS_C ) /
194                        NSEC_PER_SEC_C;
195
196}
197
198
199/* ***************************************************************************
200 * FIRE_TIMER_S
201 *
202 *  Description: This is the operation that is ran when a timer expires
203 * ***************************************************************************/
204
205
206rtems_timer_service_routine FIRE_TIMER_S (rtems_id timer, void *data)
207{
208  int               timer_pos;  /* Position in the table of the timer that   
209                                 *  has expirated                            */
210  rtems_status_code return_v;   /* Return value of rtems_timer_fire_after    */
211  int               sig_number; /* Number of the signal to send              */
212
213 
214  /* The position of the table of timers that contains the data of the
215   * expired timer will be stored in "timer_pos". In theory a timer can not
216   * expire if it has not been created or has been deleted */
217
218  PRINT_MSG_S ("FIRE_TIMER_S");
219
220  timer_pos = TIMER_POSITION_F(timer);
221
222  /* Increases the number of expiration of the timer in one unit. */
223  timer_struct[timer_pos].overrun = timer_struct[timer_pos].overrun + 1;
224
225
226  if ( ( timer_struct[timer_pos].timer_data.it_interval.tv_sec  != 0 ) ||
227       ( timer_struct[timer_pos].timer_data.it_interval.tv_nsec != 0 ) ) {
228
229     /* The timer must be reprogrammed */
230
231     return_v = rtems_timer_fire_after ( timer,
232                                        timer_struct[timer_pos].ticks,
233                                        FIRE_TIMER_S,
234                                        NULL );
235
236     /* Stores the time when the timer was started again */
237
238     timer_struct[timer_pos].time = _TOD_Current;
239     
240     /* The state has not to be actualized, because nothing modifies it */
241
242     timer_struct[timer_pos].state = STATE_CREATE_RUN_C;
243
244  } else {
245     /* Indicates that the timer is stopped */
246 
247     timer_struct[timer_pos].state = STATE_CREATE_STOP_C;
248
249  }
250
251  /*
252   * The sending of the signal to the process running the handling function
253   * specified for that signal is simulated
254   */
255
256  sig_number = timer_struct[timer_pos].inf.sigev_signo;
257
258  if( pthread_kill ( timer_struct[timer_pos].thread_id ,
259                     timer_struct[timer_pos].inf.sigev_signo ) ) {
260     PRINT_MSG_S ("ERROR_PTHREAD_KILL");
261  } else {
262     PRINT_MSG_S ("SUCCESS_PTHREAD_KILL");
263  }
264
265  /*
266   * After the signal handler returns, the count of expirations of the
267   * timer must be set to 0.
268   */
269
270  timer_struct[timer_pos].overrun = 0;
271
272}
273
274/* *********************************************************************
275 *  14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264
276 * ********************************************************************/
277
278/* **************
279 * timer_create
280 * **************/
281
282int timer_create(
283  clockid_t        clock_id,
284  struct sigevent *evp,
285  timer_t         *timerid
286)
287{
288
289  rtems_status_code return_v;  /* return value of the operation    */
290  rtems_id          timer_id;  /* created timer identifier         */
291  int               timer_pos; /* Position in the table of timers  */
292
293 /*
294  *  The data of the structure evp are checked in order to verify if they
295  *  are coherent.
296  */
297
298  if (evp != NULL) {
299    /* The structure has data */
300    if ( ( evp->sigev_notify != SIGEV_NONE ) &&
301         ( evp->sigev_notify != SIGEV_SIGNAL ) ) {
302       /* The value of the field sigev_notify is not valid */
303       set_errno_and_return_minus_one( EINVAL );
304     }
305  }
306 
307 /*
308  *  A timer is created using the primitive rtems_timer_create
309  */
310
311  return_v = rtems_timer_create ( clock_id, &timer_id );
312
313  switch (return_v) {
314     case RTEMS_SUCCESSFUL :
315
316       PRINT_MSG_S("SUCCESS: rtems create timer RTEMS_SUCCESSFUL");
317     
318       /*
319        * The timer has been created properly
320        */
321 
322        /* Obtains the first free position in the table of timers */
323
324        timer_pos = FIRST_FREE_POSITION_F();
325
326        if ( timer_pos == NO_MORE_TIMERS_C ) {
327           /* There is not position for another timers in spite of RTEMS
328            * supports it. It will necessaty to increase the structure used */
329
330           set_errno_and_return_minus_one( EAGAIN );
331        }
332
333        /* Exit parameter */
334
335        *timerid  = timer_id;
336
337        /* The data of the created timer are stored to use them later */
338
339        timer_struct[timer_pos].state     = STATE_CREATE_NEW_C;
340
341        /* NEW VERSION*/
342        timer_struct[timer_pos].thread_id = pthread_self ();
343       
344        if ( evp != NULL ) {
345           timer_struct[timer_pos].inf.sigev_notify = evp->sigev_notify;
346           timer_struct[timer_pos].inf.sigev_signo  = evp->sigev_signo;
347           timer_struct[timer_pos].inf.sigev_value  = evp->sigev_value;
348        }
349
350        timer_struct[timer_pos].timer_id = timer_id;
351        timer_struct[timer_pos].overrun  = 0;
352
353        timer_struct[timer_pos].timer_data.it_value.tv_sec     = 0;
354        timer_struct[timer_pos].timer_data.it_value.tv_nsec    = 0;
355        timer_struct[timer_pos].timer_data.it_interval.tv_sec  = 0;
356        timer_struct[timer_pos].timer_data.it_interval.tv_nsec = 0;
357
358        return 0;
359
360     case RTEMS_INVALID_NAME : /* The assigned name is not valid */
361
362       PRINT_MSG_S ("ERROR: rtems create timer RTEMS_INVALID_NAME");
363       set_errno_and_return_minus_one( EINVAL );
364
365     case RTEMS_TOO_MANY :
366
367       /* There has been created too much timers for the same process */
368       PRINT_MSG_S ("ERROR: rtems create timer RTEMS_TOO_MANY ");
369       set_errno_and_return_minus_one( EAGAIN );
370     
371     default :
372
373       /*
374        * Does nothing. It only returns the error without assigning a value
375        * to errno. In theory, it can not happen because the call to
376        * rtems_timer_create can not return other different value.
377        */
378
379       set_errno_and_return_minus_one( EINVAL );
380  }
381
382  /*
383   * The next sentence is used to avoid singular situations
384   */
385
386  set_errno_and_return_minus_one( EINVAL );
387}
388
389/*
390 *  14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266
391 */
392
393int timer_delete(
394  timer_t timerid
395)
396{
397 
398 /*
399  * IDEA: This function must probably stop the timer first and then delete it
400  *
401  *       It will have to do a call to rtems_timer_cancel and then another
402  *       call to rtems_timer_delete.
403  *       The call to rtems_timer_delete will be probably unnecessary,
404  *       because rtems_timer_delete stops the timer before deleting it.
405  */
406
407  int               timer_pos;
408  rtems_status_code status;
409
410
411   /* First the position in the table of timers is obtained */
412
413   timer_pos = TIMER_POSITION_F ( timerid );
414
415   if ( timer_pos == BAD_TIMER_C ) {
416      /* The timer identifier is erroneus */
417      set_errno_and_return_minus_one( EINVAL );
418   }
419
420   /* The timer is deleted */
421
422   status = rtems_timer_delete ( timerid );
423
424   if ( status == RTEMS_INVALID_ID ) {
425     /* The timer identifier is erroneus */
426     set_errno_and_return_minus_one( EINVAL );
427   }
428
429   /* Initializes the data of the timer */
430
431   TIMER_INITIALIZE_S ( timer_pos );
432   return 0;
433}
434
435/*
436 *  14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
437 */
438
439/* **************
440 * timer_settime
441 * **************/
442
443
444int timer_settime(
445  timer_t                  timerid,
446  int                      flags,
447  const struct itimerspec *value,
448  struct itimerspec       *ovalue
449)
450{
451
452   rtems_status_code return_v;   /* Return of the calls to RTEMS        */
453   int               timer_pos;  /* Position of the timer in the table  */
454   rtems_time_of_day rtems_time; /* Time in RTEMS                       */
455   
456
457   /* First the position in the table of timers is obtained */
458
459   timer_pos = TIMER_POSITION_F ( timerid );
460
461   if ( timer_pos == BAD_TIMER_C ) {
462     /* The timer identifier is erroneus */
463     set_errno_and_return_minus_one( EINVAL );
464   }
465
466   if ( value == NULL ) {
467     /* The stucture of times of the timer is free, and then returns an
468        error but the variable errno is not actualized */
469
470     set_errno_and_return_minus_one( EINVAL );
471   }
472
473   /* If the function reaches this point, then it will be necessary to do
474    * something with the structure of times of the timer: to stop, start
475    * or start it again */
476
477   /* First, it verifies if the timer must be stopped */
478
479   if ( value->it_value.tv_sec == 0 && value->it_value.tv_nsec == 0 ) {
480      /* The timer is stopped */
481
482      return_v = rtems_timer_cancel ( timerid );
483
484      /* The old data of the timer are returned */
485
486      if ( ovalue )
487        *ovalue = timer_struct[timer_pos].timer_data;
488
489      /* The new data are set */
490
491      timer_struct[timer_pos].timer_data = *value;
492
493      /* Indicates that the timer is created and stopped */
494 
495      timer_struct[timer_pos].state = STATE_CREATE_STOP_C;
496
497      /* Returns with success */
498
499      return 0;
500   }
501
502   /*
503    * If the function reaches this point, then the timer will have to be
504    * initialized with new values: to start it or start it again
505    */
506 
507   /* First, it verifies if the structure "value" is correct */
508
509    if ( ( value->it_value.tv_nsec > MAX_NSEC_C ) ||
510         ( value->it_value.tv_nsec < MIN_NSEC_C ) ) {
511       /* The number of nanoseconds is not correct */
512
513       set_errno_and_return_minus_one( EINVAL );
514    }
515
516   /* Then, "value" must be converted from seconds and nanoseconds to clock
517    * ticks, to use it in the calls to RTEMS */
518
519   /* It is also necessary to take in account if the time is absolute
520    * or relative */
521
522   switch (flags) {
523      case TIMER_ABSTIME:
524
525        /* The fire time is absolute:
526         * It has to use "rtems_time_fire_when" */
527
528        /* First, it converts from struct itimerspec to rtems_time_of_day */
529
530        ITIMERSPEC_TO_RTEMS_TIME_OF_DAY_S ( value, &rtems_time );
531
532        return_v = rtems_timer_fire_when ( timerid, &rtems_time, FIRE_TIMER_S, NULL);
533
534        switch ( return_v ) {
535           case RTEMS_SUCCESSFUL:
536
537              PRINT_MSG_S ("SUCCESS: timer_settime RTEMS_SUCCESSFUL");
538
539              /* The timer has been started and is running */
540
541              /* Actualizes the data of the structure and
542               * returns the old ones in "ovalue" */
543
544              if ( ovalue )
545                *ovalue = timer_struct[timer_pos].timer_data;
546
547              timer_struct[timer_pos].timer_data = *value;
548 
549              /* It indicates that the time is running */
550
551              timer_struct[timer_pos].state = STATE_CREATE_RUN_C;
552
553              /* Stores the time in which the timer was started again */
554
555              timer_struct[timer_pos].time = _TOD_Current;
556              return 0;
557
558              break;
559
560           case RTEMS_INVALID_ID:
561
562              PRINT_MSG_S ("ERROR: timer_settime RTEMS_INVALID_ID");
563              break;
564
565           case RTEMS_NOT_DEFINED:
566
567              PRINT_MSG_S ("ERROR: timer_settime RTEMS_NOT_DEFINED");
568              break;
569
570           case RTEMS_INVALID_CLOCK:
571
572              PRINT_MSG_S ("ERROR: timer_settime RTEMS_INVALID_CLOCK");
573              break;
574
575           default:
576
577       
578        }
579     
580        break;
581
582      case TIMER_RELATIVE_C:
583
584        /* The fire time is relative:
585         * It has to use "rtems_time_fire_after" */
586
587        /* First, it converts from seconds and nanoseconds to ticks */
588
589        /* The form in which this operation is done can produce a lost
590         * of precision of 1 second */
591 
592/*      This is the process to convert from nanoseconds to ticks
593 *
594 *      There is a tick every 10 miliseconds, then the nanoseconds are
595 *      divided between 10**7. The result of this operation will be the
596 *      number of ticks
597 */
598
599        timer_struct[timer_pos].ticks =
600             ( SEC_TO_TICKS_C * value->it_value.tv_sec ) +
601             ( value->it_value.tv_nsec / ( 1000 * 1000 * 10 ) );
602
603        return_v = rtems_timer_fire_after ( timerid,
604                                           timer_struct[timer_pos].ticks,
605                                           FIRE_TIMER_S,
606                                           NULL );
607
608        switch (return_v) {
609           case RTEMS_SUCCESSFUL:
610
611              PRINT_MSG_S ( "SUCCESS: timer_settime RTEMS_SUCCESSFUL");
612             
613              /* The timer has been started and is running */
614
615              /* Actualizes the data of the structure and
616               * returns the old ones in "ovalue" */
617
618              if ( ovalue )
619                *ovalue = timer_struct[timer_pos].timer_data;
620
621              timer_struct[timer_pos].timer_data = *value;
622 
623              /* It indicates that the time is running */
624
625              timer_struct[timer_pos].state = STATE_CREATE_RUN_C;
626
627              /* Stores the time in which the timer was started again */
628
629              timer_struct[timer_pos].time = _TOD_Current;
630 
631              return 0;
632
633              break;
634
635           case RTEMS_INVALID_ID:
636
637              PRINT_MSG_S ( "ERROR: timer_settime RTEMS_INVALID_ID");
638
639              /* The timer identifier is not correct. In theory, this
640               * situation can not occur, but the solution is easy */
641
642              set_errno_and_return_minus_one( EINVAL );
643
644              break;
645
646           case RTEMS_INVALID_NUMBER:
647
648              PRINT_MSG_S ( "ERROR: timer_settime RTEMS_INVALID_NUMBER");
649
650              /* In this case, RTEMS fails because the values of timing
651               * are incorrect */
652
653              /*
654               * I do not know if errno must be actualized
655               *
656               * errno = EINVAL;
657               */
658
659              set_errno_and_return_minus_one( EINVAL );
660              break;
661           
662           default:
663        }
664
665        break;
666
667      default:
668
669        /* It does nothing, although it will be probably necessary to
670         * return an error */
671
672   }
673
674   /* To avoid problems */
675
676   return 0;
677
678}
679
680
681/*
682 *  14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
683 */
684
685/* **************
686 * timer_gettime
687 * **************/
688
689int timer_gettime(
690  timer_t            timerid,
691  struct itimerspec *value
692)
693{
694
695 /*
696  * IDEA:  This function does not use functions of RTEMS to the handle
697  *        of timers. It uses some functions for managing the time.
698  *
699  *        A possible form to do this is the following:
700  *
701  *          - When a timer is initialized, the value of the time in
702  *            that moment is stored.
703  *          - When this function is called, it returns the difference
704  *            between the current time and the initialization time.
705  */
706 
707  rtems_time_of_day current_time;
708  int               timer_pos;
709  unsigned32        hours;
710  unsigned32        minutes;
711  unsigned32        seconds;
712  unsigned32        ticks;
713  unsigned32        nanosec;
714 
715
716  /* Reads the current time */
717
718  current_time = _TOD_Current;
719
720  timer_pos = TIMER_POSITION_F ( timerid );
721
722  if ( timer_pos == BAD_TIMER_C ) {
723    /* The timer identifier is erroneus */ 
724    set_errno_and_return_minus_one( EINVAL );
725  }
726
727  /* Calculates the difference between the start time of the timer and
728   * the current one */
729
730  hours    = current_time.hour - timer_struct[timer_pos].time.hour;
731
732  if ( current_time.minute < timer_struct[timer_pos].time.minute ) {
733     minutes = 60 - timer_struct[timer_pos].time.minute + current_time.minute;
734     hours--;
735  } else {
736     minutes = current_time.minute - timer_struct[timer_pos].time.minute;
737  }
738   
739  if ( current_time.second < timer_struct[timer_pos].time.second ) {
740     seconds = 60 - timer_struct[timer_pos].time.second + current_time.second;
741     minutes--;
742  } else {
743     seconds = current_time.second - timer_struct[timer_pos].time.second;
744  }
745
746  if ( current_time.ticks < timer_struct[timer_pos].time.ticks ) {
747     ticks = 100 - timer_struct[timer_pos].time.ticks + current_time.ticks;
748     seconds--;
749  } else {
750     ticks = current_time.ticks - timer_struct[timer_pos].time.ticks;
751  }
752
753  /* The time that the timer is running is calculated */
754  seconds = hours   * 60 * 60 +
755            minutes * 60      +
756            seconds;
757
758  nanosec  = ticks * 10 *  /* msec     */
759             1000  *       /* microsec */
760             1000;         /* nanosec  */
761
762 
763  /* Calculates the time left before the timer finishes */
764 
765  value->it_value.tv_sec =
766    timer_struct[timer_pos].timer_data.it_value.tv_sec - seconds;
767 
768  value->it_value.tv_nsec =
769    timer_struct[timer_pos].timer_data.it_value.tv_nsec - nanosec;
770
771
772  value->it_interval.tv_sec  =
773    timer_struct[timer_pos].timer_data.it_interval.tv_sec;
774  value->it_interval.tv_nsec =
775    timer_struct[timer_pos].timer_data.it_interval.tv_nsec;
776 
777
778  return 0;
779
780}
781
782/*
783 *  14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
784 */
785
786/* *****************
787 * timer_getoverrun
788 * *****************/
789
790int timer_getoverrun(
791  timer_t   timerid
792)
793{
794
795 /*
796  * IDEA: This function must count the times the timer expires.
797  *   
798  *       The expiration of a timer must increase by one a counter.
799  *       After the signal handler associated to the timer finishs
800  *       its execution, FIRE_TIMER_S will have to set this counter to 0.
801  */
802
803  int timer_pos; /* Position of the timer in the structure     */
804  int overrun;   /* Overflow count                             */
805
806
807  timer_pos = TIMER_POSITION_F ( timerid );
808
809  if ( timer_pos == BAD_TIMER_C ) {
810    /* The timer identifier is erroneus */
811    set_errno_and_return_minus_one( EINVAL );
812  }
813
814  /* The overflow count of the timer is stored in "overrun" */
815
816  overrun = timer_struct[timer_pos].overrun;
817
818  /* It is set to 0 */
819
820  timer_struct[timer_pos].overrun = 0;
821
822  return overrun;
823
824}
Note: See TracBrowser for help on using the repository browser.