The CrossWorks C compiler provides the __ctl_interrupt modifier that declares an interrupt service routine that works with the CTL. All you have to do is write your interrupt handling code.

    void basic_timer_irq(void) __ctl_interrupt[BASIC_TIMER_VECTOR]
    {
      // Do your interrupt handling here...
    }

When you are executing an interrupt service routine you must not call the tasking library functions that may block (task_wait_events, task_wait_semaphore, task_post_message, task_receive_message, task_wait_timeout) —you can call other tasking library functions, but a task switch will only occur when the last interrupt handler has completed execution.

Whilst you are executing an interrupt service routine you can allow interrupts of a higher priority to occur by calling ctl_global_interrupts_re_enable_from_isr. You must also disable interrupts before exit from the interrupt service routine by calling ctl_global_interrupts_un_re_enable_from_isr.