mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
Merge pull request #2028 from lioncash/define
WiimoteEmu: Change define into a variable and move it to where it's used.
This commit is contained in:
commit
0ff6220f4e
@ -422,11 +422,13 @@ void Wiimote::GetAccelData(u8* const data, const ReportFeatures& rptf)
|
|||||||
core.acc_y_lsb = (y >> 1) & 0x1;
|
core.acc_y_lsb = (y >> 1) & 0x1;
|
||||||
core.acc_z_lsb = (z >> 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;
|
static const double CUTOFF_FREQUENCY = 5.0;
|
||||||
double alpha=period/(period+RC);
|
|
||||||
|
double RC = 1.0 / CUTOFF_FREQUENCY;
|
||||||
|
double alpha = period / (period + RC);
|
||||||
var = newval * alpha + var * (1.0 - alpha);
|
var = newval * alpha + var * (1.0 - alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user