nn::hid::CTR::AccelerometerReader::ConvertToAcceleration Member Function

Syntax

void ConvertToAcceleration(
     AccelerationFloat * pAcceleration,
     s32 bufLen,
     const AccelerometerStatus * pSamplingData,
     s32 samplingLen = -1
);

Parameters

Name Description
out pAcceleration Stores data that has been converted to acceleration values.
in bufLen Specifies the number of acceleration values that can be stored in pAcceleration.
in pSamplingData Sampling data from the accelerometers before conversion.
in samplingLen Specifies the amount of data for pSamplingData. If smaller than bufLen, there will be an assert failure. If left unspecified or if a negative value has been specified, there will be no assert check.

Return Values

None.

Description

Converts the raw sampling data from the accelerometers into acceleration values (in g's).

This converts exactly bufLen number of data items in pSamplingData to pAcceleration, so if the pSamplingData array is smaller than bufLen, this results in access beyond the bounds of the pSamplingData array.

Make sure to allocate the pSamplingData array to be at least bufLen items long.

Revision History

2012/02/22
Added caution about possible invalid memory access.
2010/01/07
Initial version.

CONFIDENTIAL