Skip to content

Commit

Permalink
rest accel while changing set, fix #991
Browse files Browse the repository at this point in the history
  • Loading branch information
pepper-jelly authored and pepper-jelly committed Jul 31, 2024
1 parent 7b64715 commit 8a96b02
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 8a96b02

Please sign in to comment.