Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

os.h/bsp_os_a.asm or bsp_os.c

Prototype

Code Block
void  BSP_OS_TickISR (void)

Arguments

None

Returned Values

...

The code below indicates how to write BSP_OS_TickISR() if all interrupts vector to a common location, and the interrupt handler simply calls BSP_OS_TickISR(). As indicated, this code can be written completely in C and can be placed in bsp_os.c of the board support package (BSP) and be reused by applications using the same BSP.

Code Block
          void  BSP_OS_TickISR (void)
          {
              Clear the tick interrupt;
              OSTimeTick();
          }

The pseudo code below shows how to write BSP_OS_TickISR() if each interrupt directly vectors to its own interrupt handler. The code, in this case, would be written in assembly language and placed either in bsp_os_a.asm of the board support package.

Code Block
          void  BSP_OS_TickISR (void)
          {
              Save all the CPU registers onto the current task's stack;
              if (OSIntNestingCtr == 0) {
                  OSTCBCurPtr->StkPtr = SP;
              }
              OSIntEnter();
              Clear the tick interrupt;
              OSTimeTick();
              OSIntExit();
              Restore the CPU registers from the stack;
              Return from interrupt;
          }