RTEMS Class example Timer : strange behaviour (to me)

pierre kestener pierre.kestener at cea.fr
Thu May 14 12:39:15 UTC 2009


Hello,

I am running the timer class example on real hardware (Sparc/Leon2) with 
printing on console.

Timer1 and 2 service routines are each set with a 2 seconds interval, 
but I noticed that
after 2 fireouts, time between 2 LED_ON (or LED OFF)  prints becomes 4 
seconds.
To illustrate this, I put a rtems_time_of_day  global variable named 
"now" in the source code to use it to print time.

Here is the corresponding output :

*** LED BLINKER -- timer ***
LED ON  00:00:00   
01/01/2009                                                  
LED OFF  00:00:01   
01/01/2009                                                 
LED ON  00:00:02   
01/01/2009                                                  
LED OFF  00:00:03   
01/01/2009                                                 
LED ON  00:00:05   
01/01/2009                                                  
LED OFF  00:00:07   
01/01/2009                                                 
LED ON  00:00:09   
01/01/2009                                                  
LED OFF  00:00:11   
01/01/2009                                                 
LED ON  00:00:13   
01/01/2009                                                  
LED OFF  00:00:15   
01/01/2009                                                 
LED ON  00:00:17   01/01/2009

I also noticed that if I comment the line calling Timer2 service routine
Timer_Routine(Timer2, NULL);
in the Init task, then Timer1 is called twice and then it stops, no 
print anymore.
                    
*** LED BLINKER -- timer ***
LED ON  00:00:00   
01/01/2009                                                  
LED ON  00:00:02   
01/01/2009                                                  


Can someone help me and give some explanation of what seems strange to me ?
Thank you in advance.

Pierre Kestener.




More information about the users mailing list