CARD_SetPulledOutCallback

Syntax

#include <nitro/card.h>
void CARD_SetPulledOutCallback( CARDPulledOutCallback callback );
  

Arguments

callback The callback function invoked when a Game Card removal is detected. It is called from within either the interrupt handler or the CARD_CheckPulledOut function.

Return Values

None.

Description

This function sets the callback function that is called when a Game Card removal is detected.

To use this function, you must first call the CARD_Init function.

CARDPulledOutCallback is the type of callback function callback, and is defined as

typedef BOOL ( *CARDPulledOutCallback )( void );

This function does not call the callback if a NULL value is specified in the callback argument.




About Callbacks

Specify TRUE in the callback return value if the program will stop after it exits from the callback (or when the power is turned off when the cover is closed). If a value of FALSE is specified in the callback return value, the function will not stop after it exits from the callback. When you stop the function after necessary processing, call CARD_TerminateForPulledOut afterward. However, the stop process notifies the ARM7 processor using PXI. You cannot call this function from inside the callback while interrupts are disabled.

For example, use the following statements to display the "DON'T PULL OUT CARD" message and to stop the program when a Game Card removal is detected.

Example:

void NitroMain( void )
{ initializeRoutine(); CARD_SetPulledOutCallback( myCallback ); // set callback while(1) { usualGameProcedure(); if ( CARD_IsPulledOut() ) // check whether card is pulled out { drawMessageRoutine( "DON'T PULL OUT CARD" ); CARD_TerminateForPulledOut(); // terminate // program halted. } } } //---- callback for pulled-out card BOOL myCallback( void ) { return FALSE; // does not terminate }

See Also

CARD_Init, CARD_TerminateForPulledOut, CARD_IsPulledOut, CARD_CheckPulledOut

Revision History

2005/06/01 Added information stating the callback is called from the interrupt handler.
2004/12/16 Fixed so the sample code uses CARD_IsPulledOut() .
2004/11/10 Added statement about the power being off if the cover is closed with the stop processing after returning from the callback.
2004/09/16 Initial version.


CONFIDENTIAL