timer in ISR

Ian Caddy ianc at microsol.iinet.net.au
Tue Oct 5 03:36:56 UTC 2004


Hi Sebastian,

We use rtems_timer_fire_after in some of our ISR code for our 
applications and it works for us.  I realise that doesn't really help 
you but just to let you know that it can be done.

Is your CAN ISR a conforming interrupt.  In other words, does it 
register the interrupt through RTEMS.  In this way RTEMS knows that it 
is in an ISR and will do thing accordingly.

I do not know which hardware platform you are using, but there should be 
no reason that you can't access hardware outside of RTEMS, if RTEMS does 
not use the hardware timer channels, there should be no reason that you 
can't use them.

I don't quite understand why you would want to implement some of your 
CANbus ISR at some time later.  Normally you would have a task waiting 
for the interrupt to do something, and then you could get the interrupt 
to send an event, a message or a release a semaphore to the task to wake 
it up, then the task can setup a time before it wants to do something 
else, with either a timer, or a sleep.

I hope this helps.

regards,

Ian Caddy


sebastian ssmoller wrote:
> hi,
> i try to use rtems_timer_fire_after() in a CAN Bus ISR. unfortunately this
> doesnt seem to work. 
> 
> i set the timer to 1000 where in non-isr code this
> is a rather long period while using this code in the isr the timer service
> routine seems to be executed immediately ...
> 
> so should it be generally possible to use rtems_timer_fire_after() in isr
> code ?
> 
> if not, what about accessing the hardware timers directly (without rtems) -
> could this be possible in an isr ?
> 
> any other ideas ? - (i need the timer to impl. somethink like a "sync
> point" so that some part of the CAN bus isr is not executed til some time
> has passed) 
> 
> 
> thx
> regards,
> seb
> 
> hardware
> cpu : m68k
> bsp : gen68360_040
> 
> 



More information about the users mailing list