Skip to content

Commit

Permalink
fix: rest accel while changing set, fix #991 (#1015)
Browse files Browse the repository at this point in the history
PR: #1015
  • Loading branch information
pepper-jelly authored Jul 31, 2024
1 parent bdb2ac2 commit 05db50b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/joyaccelerometersensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ JoySensorDirection JoyAccelerometerSensor::calculateSensorDirection()
bool inPitch = pitch_abs < m_dead_zone;
bool inRoll = roll_abs < range;

if (isnan(roll))
{
return SENSOR_CENTERED;
}

if (!inPitch)
{
if (!inRoll)
Expand Down

0 comments on commit 05db50b

Please sign in to comment.