[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Microseconds sleep with Leon2
- Date: Thu, 20 Nov 2008 10:02:49 +0100
- From: stephane.arquer at c-s.cnes.fr (Arquer Stephane)
- Subject: Microseconds sleep with Leon2
Hi,
I try to make a specific function to wake up tasks after some hundreds of ? seconds.
I use the timer 2 of a Leon2 with a resolution set to 50?s , but I obtain a rough result with 200?s more than the request time.
Does anybody have an idea ?
I can't load the timer with a value less than 50, a lower value block the execution.
Is it possible to manage an ISR every 10?s ?
I work with rtems 4.8.0 with the patch 4.8.1diff, and a Leon2.
Thanks for help.
sa
/*****/
rtems_isr handleTimer2(rtems_vector_number vector)
{
int i;
TIMER2_TICKS ++;
if (Nbre_Timer_Actifs > 0){
for (i=0; i < MAX_TIMER; i++)
{
if (TAB_Timer[i].actif) {
if (TAB_Timer[i].decompte > 0) {
TAB_Timer[i].decompte--;
} else {
rtems_semaphore_release(TAB_Timer[i].sem_id);
TAB_Timer[i].actif = FALSE;
}
} /*if*/
} /*for*/
}/*if*/
} /*handleTimer2*/