WPADGetLatestIndexInBuf

Syntax

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

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

u32 WPADGetLatestIndexInBuf ( s32 chan );

Parameters

chan One of the WPAD_CHANn values.

Return Values

Returns the index of the ring buffer where the most recent data is stored. If no data has been obtained yet, returns 0.

Description

Gets the index to the data last stored in the ring buffer for the Wii remote for the specified channel.

Be aware that this function's return value will also be cleared when the ring buffer is cleared in the following circumstances.

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.

See Also

WPADSetAutoSamplingBuf

Revision History

2013/05/08 Automated cleanup pass.
2006/10/05 Added mention that values are cleared when a controller is connected.
2006/07/24 Removed statement that values are cleared when an external extension controller is plugged into or unplugged from the console.
2005/10/20 Added a note about behavior when data has never been obtained. Added WPAD_CHANn macros.
2005/08/01 Initial version.


CONFIDENTIAL