WPADSetSamplingCallback

C Specification

#include <revolution/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 );

Arguments

chan One of 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 Control at the specified channel. If NULL is specified, no notifications are made until reset.

Although the Wii Remote sends data to the Wii Console approximately every five milliseconds, be sure to note that due to Wii 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. Further note that the registered callback function is not always called at this interval due to the fact that the data frame from the Wii Remote may not be received by the Wii Console depending on ambient electromagnetic conditions.

Note that the registered callback function is cleared in the following cases.

In addition, the callback functions are not cleared when a controller is connected, so they can be registered in advance.

See Also

WPAD Functions

Revision History

08/15/2006 Added a description of the time interval at which the callback function is called, and deleted that the callback is cleared when an External Extension Controller is connected or disconnected. Revised the sampling cycle to one of approximately 4ms.
08/01/2005 Initial version.


CONFIDENTIAL