You are right... The code of MEMS_SetNeutral is the following:
void MEMS_SetNeutral( void )
{
// Set Neutral position.
MEMS_GetPosition( &XInit, &YInit );
}
with:
void MEMS_GetPosition( s16* pX, s16* pY )
{
*pX = MEMS_Info.OutX - XInit;
*pY = MEMS_Info.OutY - YInit;
}
I guess it should be (to be tested):
void MEMS_SetNeutral( void )
{
XInit = MEMS_Info.OutX ;
YInit = MEMS_Info.OutY;
}