##### Synopsis

    #include <ctl_api.h>
    void ctl_exit_isr(void *savedRegisters);

##### Description

The ctl_exit_isr function must be jumped to from an interrupt service routine with global interrupts disabled. This function will decrement the ctl_interrupt_count variable and if zero it will check if a task switch is required. The savedRegisters parameter points to the registers saved on the stack on entry to the interrupt service routine. If a task switch is needed then the register state in savedRegisters will be stored in the ctl_task_executing and a new task will be made the executing task. If a context switch isn’t required or the ctl_interrupt_count is non-zero then the register state in savedRegisters is restored and the interrupt handler returns.

##### Restrictions

This function should only be invoked by an interrupt service routine.

##### Portability

ctl_exit_isr is provided in every implementation of the CrossWorks tasking library.

###### See Also

Low-level interrupt handling