Friday, October 12, 2012

5. MQX RTOS Handling Interrupts -2


How to install an application ISR?

By call _int_install_isr(). MQX updates its interrupt vector table appropriately and calls your ISR handler when ever your interrupt occurs.

You might have guessed from my previous post when installing an ISR you have to supply
  • Interrupt Number
  • ISR function pointer
  • data pointer
Whats most frequent things Done in ISR?
  • setting a event bit
  • posting a semaphore, message queues etc.
  • DE-queing a task from task queue
 Whats all  MQX does not allow to place in an ISR?
 Basically, MQX has put some intelligent to stop you doing some stupid thing inside ISR. If you try to perform those illegal operations MQX would return error. You cannot 
  • cannot create/destroy a semaphore/message queue/events
  • cannot wait for an event inside an ISR
  • to cut the chase, you can not create any kernel object inside an ISR
 What you should not call inside an ISR?
  • No IO functions as they may take unpredictable time
  • never call _int_default_isr
  • any wait event function
  • any mutex lock operation
  • never create/destroy a task
  •  
     Next topic explains Semaphores in detail. Click here

No comments: