更换语言:
   Contact us
  • Follow CooCox
  •         
  • CooCox Market
  •         
  • Tech Support
  •     
Home  ›  CoOS › Task Management

Interrupts

     In CooCox CoOS, the interrupt is divided into two categories according to whether called the system API functions inside or not.

     For the ISR which has nothing to do with OS, CooCox CoOS does not force it to do anything and you can operate just like there is not an OS.

     However, for the ISR which called the system API functions inside, CooCox CoOS demands that you call the relevant functions when entering or exiting the interrupt (as shown in code 8).

Code 8 The interrupt handler which called the system API
  • void WWDG_IRQHandler(void)
    {
          CoEnterISR ( );                               // Enter the interrupt
          isr_SetFlag(flagID);                       // API function
         ..................;                              // Interrupt service routine
          CoExitISR ( );                                // Exit the interrupt
    }

     All the system API which can be called in the interrupt service routine begin with isr_, such as isr_PostSem ( ), isr_PostMail ( ), isr_PostQueueMail ( ) and isr_SetFlag ( ).The calling of any other API inside the ISR will lead to the system chaos.

     When calling the corresponding API functions in the interrupt service routine, system need to determine whether the task scheduling is locked or not. If it is unlocked, system can call it normally. Otherwise, system will send a relevant service request to the service request list and then wait for the unlocking of the scheduler to respond it.


CooCox CoOS

© 2009 -2011 CooCox - Terms of Use         Business Model         Market             About us             Terms and Conditions