WPADSetSamplingCallback

Syntax

#include <cafe/pads/wpad/wpad.h>

#define WPAD_CHAN0               0
#define WPAD_CHAN1               1
#define WPAD_CHAN2               2
#define WPAD_CHAN3               3

typedef void (* WPADSamplingCallback )( s32 chan );

WPADSamplingCallback WPADSetSamplingCallback( s32 chan, WPADSamplingCallback callback );

Parameters

chan One of the WPAD_CHANn values.
callback The callback function that indicates receipt of data from the Wii remote.

Return Values

Pointer to the most recently registered callback function.

Description

Registers the callback function that notifies the receipt of data by the Wii remote at the specified channel. If NULL is specified, no notifications are made until reset.

Although the Wii remote sends data to the Wii U console approximately every five milliseconds, due to Wii U hardware specifications, the registered callback function is not called at even intervals every 5 milliseconds, but rather is called at an interval of four milliseconds, then six milliseconds, then four milliseconds, then six milliseconds, and so on. The registered callback function is not always called at this interval because the data frame from the Wii remote may not be received by the Wii U console depending on ambient radio signal conditions.

The registered callback function is cleared in the following cases.

Do Not Call From

Background Do not call this function from the background.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.
Multiple Cores Do not call this function from more than one Core.

Revision History

2013/05/08 Automated cleanup pass.
2013/04/09 Removed references to WPADStartFastSyncDevice
2012/04/12 Removed references to simple pairing api.
2006/10/05 Added mention that the buffer is cleared when a controller is connected.
2006/09/18 Added notes for calling the WPADStartFastSyncDevice function.
2006/08/15 Added descriptions regarding callback function call intervals. Removed mention of the callback function being cleared when the external extension controller is inserted or removed.
2006/06/19 Changed the name of the game remote control; changed explanations to product specifications.
2005/11/01 Added the WPAD_CHANn macro. Revised the sampling cycle to be a 4ms cycle.
2005/08/01 Initial version.


CONFIDENTIAL