RTEMS Timer problem

hwulf at et-inf.fho-emden.de hwulf at et-inf.fho-emden.de
Wed Apr 4 08:40:43 UTC 2007



----- Weitergeleitete Nachricht von hwulf at et-inf.fho-emden.de -----
      Datum: Wed,  4 Apr 2007 10:00:03 +0200
        Von: hwulf at et-inf.fho-emden.de
Antwort an: hwulf at et-inf.fho-emden.de
    Betreff: Re: RTEMS Timer problem
         An: Joel Sherrill <joel.sherrill at oarcorp.com>

I see. I just deleted the timer driver, the clock driver
was already defined before. Some tests show, that the timer
interrupt routine (timerISR) isn't gonna be called.

I passed the name "timerISR" as an argument to rtems_timer_fire_after()
in the function activateTimer(). The data type
rtems_timer_service_routine_entry
is just a function pointer, isn't it? So I could insert timerISR or &timerISR?

What datatypes are rtems_timer_service_routine and
rtems_timer_service_routine_entry?

Thank you very much in advance,
   Hank

Quoting Joel Sherrill <joel.sherrill at oarcorp.com>:

> hwulf at et-inf.fho-emden.de wrote:
>> Hi,
>>
>> I wanted to configure a timer, whose ISR sends an event to a user task.
>> But unfortunately, the timer doesn't seem to expire.
>> I already defined CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER and
>> CONFIGURE_MAXIMUM_TIMERS 3 in the main module.
>>
>>
> The Timer driver is a benchmark timer.  You need the Clock driver not
> the Timer driver.
>
> --joel
>> Are there some other configurations or processor-registers to set in
>> order to get the timer started?
>>
>> Below is the code of the user task and the important functions from my
>> timer module.
>>
>> I'm running the RTEMS program in TSIM.
>>
>> I thank you very much for every advice in advance!
>>
>> Kind regards,
>>  Hank
>>
>>
>> /******************************************************************************
>>  *
>>  * USER_TASK1
>>  *
>>  *     
>> ****************************************************************************/
>> rtems_task user_task_1(rtems_task_argument unused)
>> {
>> 	rtems_status_code status;
>> 	rtems_event_set task1_event;
>>
>> 	printf("Task 1: Creating Timer\n");
>> 	createTimer(&tTimer[0], Timer_name[0], TIMER_PERIODIC, 100);
>> 	printf("Task 1: Activating Timer\n");
>> 	activateTimer(tTimer[0]);
>>
>> 	while(TRUE)
>> 	{
>> 		int i = 0;
>> 		waitForTimerEvent(task1_event, 2*TIMER_INTERVAL);
>> 		i++;
>> 		printf("Task 1: Event #%i received", i);
>> 	}
>>
>> 	return(status);
>> }
>>
>>
>> ......
>>
>> rtems_timer_service_routine timerISR(rtems_id timer_id, void *user_data)
>> {
>> 	int i;
>>
>> 	/* restart timer with the same interval */
>> 	rtems_timer_reset(timer_id);
>>
>> 	/* send event to particular task */
>> 	for(i = 0; i < MAXIMUM_TIMER_TASKS; i++)
>> 		if(Timer_id[i] == timer_id)
>> 		{
>> 			rtems_event_send(Task_id[i], RTEMS_EVENT_0);
>> 			break;
>> 		}
>> }
>>
>> ......
>>
>> rtems_status_code createTimer(struct obdhtimer_t *tTimer,    
>> rtems_name  name, enum timer_mode mode, rtems_interval interval)
>> {
>> 	rtems_status_code status;
>>
>> 	tTimer->mode = mode;
>> 	tTimer->interval = interval;
>>
>> 	status = rtems_timer_create(name, &(tTimer->id));
>>
>> 	return(status);
>> }
>>
>> ......
>>
>> rtems_status_code activateTimer(struct obdhtimer_t tTimer)
>> {
>> 	rtems_status_code status;
>>
>> 	status = rtems_timer_fire_after(tTimer.id, tTimer.interval,    
>> timerISR, NULL);
>>
>> 	return(status);
>> }
>>
>> ......
>>
>> rtems_status_code waitForTimerEvent(rtems_event_set *event_out,     
>> rtems_interval timeout)
>> {
>> 	rtems_status_code status;
>>
>> 	status = rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT |     
>> RTEMS_EVENT_ANY, timeout, event_out);
>>
>> 	return(status);
>> }
>>
>> _______________________________________________
>> rtems-users mailing list
>> rtems-users at rtems.com
>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>




----- Ende der weitergeleiteten Nachricht -----





More information about the users mailing list