WiimoteEmu: Change define into a variable and move it to where it's used.
This commit is contained in:
parent
2aef84d80c
commit
07556b4849
|
@ -422,10 +422,12 @@ 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)
|
||||
{
|
||||
double RC=1.0/kCutoffFreq;
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue