# CP_RestoreContext

## C Specification

  `#include <nitro/cp.h>`
  `void CP_RestoreContext( CPContext* context );`

## Description

This function restores divider and square root calculator status (context) that was saved with `CP_SaveContext`.

When you use a divider or square root calculator inside an interrupt, save the divider and square root calculator contexts prior to their use by these functions.

Twenty cycles are required after this function ends to complete the restore process. In order to wait for the restore process to complete, you will either have to run other processes that take at least 20 cycles, or call `CP_WaitDiv`. With a standard SDK interrupt process, it takes at least 20 cycles to return to the original routine after the interrupt handler finishes, and therefore there is no need for a wait process. However, if you are using your own interrupt process, implement it so that the context restore process finishes before you return to the original routine.

During thread switch, the context are also automatically switched. Therefore, there is no need for this function to explicitly run a save process.

## Arguments

Pointer to the context structure for the divider or square root calculator that you want to restore.

## Return Values

None

## See Also

`CP_SaveContext, CP_SetDiv*, CP_SetSqrt*`

## Revision History

05/06/2004 Initial Version