rtel wrote on Tuesday, October 02, 2007:
> - to "install" an interrupt, you register it in the VIC. Do I
> also have to do
> something for the RTOS to "know" this interrupt?
No - registering it with the VIC will cause the interrupt to fire (presuming it is configured correctly :o) - if this interrupt is not going to cause a context switch then you can just write the interrupt as per any other (refer to the compiler documentation). If this interrupt is potentially going to cause a context switch then you have to construct the interrupt as per the documentation page for the port you are using. Different compilers require slightly different syntax. You will also be able to refer to the demo application for your port for an example of how to switch context from within an interrupt.
> - what do I have to look at when giving the ISR priorities?
> whats the impact
> for ISR’s that have higher/lower priority than the OS tick?
Unless you implement a nesting scheme then there the only effect the priorities have is when the kernel chooses which of a number of pending interrupts should be serviced first. If you are implementing a nesting scheme then interrupts that use the API must run at the same priority as the kernel tick.
> - when I use a semaphore for synchronizing a task with an ISR
> (and do the actual
> data processing within the task. as it was suggested in the
> API doc), should
> I always call portTaskYield() or how can I ensure that the
> task which is related
> to the interrupt is being scheduled as soon as possible? or
> does the scheduler
> do that by default?
As per question one above - you can cause a context switch within an interrupt by following the example given in the demo application. When you do this the interrupt will automatically return to the highest priority task in the system that is able to run. The interrupt can interrupt a low priority task, then return directly to a higher priority task if one is readied from within the interrupt. This occurs automatically when following the examples - so you don’t have to worry about anything other than the priorities you assign to your tasks.