WiimoteEmu: Change define into a variable and move it to where it's used.

This commit is contained in:
Lioncash 2015-02-10 11:40:28 -05:00
parent 2aef84d80c
commit 07556b4849
1 changed files with 6 additions and 4 deletions

View File

@ -422,11 +422,13 @@ void Wiimote::GetAccelData(u8* const data, const ReportFeatures& rptf)
core.acc_y_lsb = (y >> 1) & 0x1;
core.acc_z_lsb = (z >> 1) & 0x1;
}
#define kCutoffFreq 5.0
inline void LowPassFilter(double & var, double newval, double period)
inline void LowPassFilter(double& var, double newval, double period)
{
double RC=1.0/kCutoffFreq;
double alpha=period/(period+RC);
static const double CUTOFF_FREQUENCY = 5.0;
double RC = 1.0 / CUTOFF_FREQUENCY;
double alpha = period / (period + RC);
var = newval * alpha + var * (1.0 - alpha);
}