# PM_GetExitFactor

## Syntax

      #include <twl/spi.h>

      PMExitFactor PM_GetExitFactor( void );

## Arguments

None.

## Return Values

Cause for exit processing.

## Description

Gets the cause that led to exit processing.

The return values have the following meanings. When the system has not entered exit processing, the return value is `PM_EXIT_FACTOR_NONE`.

`Return Values` | Cause for exit processing
--- | ---
`PM_EXIT_FACTOR_PWSW` | The Power Button was detected to be held down longer than a fixed amount of time
`PM_EXIT_FACTOR_BATTERY` | The ARM7 detected a drop in battery power
`PM_EXIT_FACTOR_USER` | The user forced a hardware reset or power-off
`PM_EXIT_FACTOR_NONE` | (Not in exit processing.)

Reset or Power-Off Transition

When the value is `PM_EXIT_FACTOR_PWSW`, it is not yet known whether this will lead to a hardware reset or whether it will lead to a power-off. Which sequence it becomes depends upon the time at which the Power Button is released.

When the value is `PM_EXIT_FACTOR_BATTERY`, the power-off sequence will begin.

When the value is `PM_EXIT_FACTOR_USER`, the `PM_ForceToResetHardware` or `PM_ForceToPowerOff` function has been called, so the hardware reset or shutdown sequence will begin.

In any case, the exit callback must end promptly.

`The `PM_EXIT_FACTOR_USER` Return Value`

This value is set when execution has passed through the `PM_ForceToResetHardware` or `PM_ForceToPowerOff` function. A value of `PM_EXIT_FACTOR_USER` will be set even if these functions are called ultimately from another system function rather than directly by the user. For example, a call to the `OS_JumpToSystemMenu` function ultimately causes execution to reach the `PM_ForceToResetHardware` function.

## See Also

`PM_SetExitCallbackInfo, PM_SetAutoExit, PM_GetAutoExit
`

## Revision History

2008/05/01 Added `PM_EXIT_FACTOR_USER`. 2008/02/07 Initial version.

CONFIDENTIAL