Skip to content

Commit baf7045

Browse files
committed
Make tilt a single test pass/fail.
1 parent 30f8d3b commit baf7045

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Firmware/RTK_Everywhere/Tilt.ino

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,10 @@ void tiltDetect()
10201020
if (settings.detectedTilt == true)
10211021
return;
10221022

1023+
// Test for tilt only once
1024+
if (settings.testedTilt == true)
1025+
return;
1026+
10231027
#ifdef COMPILE_IM19_IMU
10241028
// Locally instantiate the library and hardware so it will release on exit
10251029
IM19 *tiltSensor;
@@ -1048,9 +1052,14 @@ void tiltDetect()
10481052

10491053
present.imu_im19 = true; // Allow tiltUpdate() to run
10501054
settings.detectedTilt = true;
1051-
recordSystemSettings();
1052-
return;
10531055
}
10541056
}
10551057
#endif // COMPILE_IM19_IMU
1058+
1059+
// if (settings.enableImuDebug == true && settings.detectedTilt == false)
1060+
systemPrintln("Tilt sensor not detected");
1061+
1062+
settings.testedTilt = true;
1063+
recordSystemSettings();
1064+
return;
10561065
}

Firmware/RTK_Everywhere/settings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,7 @@ struct Settings
10871087
//ProductVariant previouslyDetectedPlatform = RTK_UNKNOWN; //Because LFS is started after deviceID, this is mute
10881088
gnssReceiverType_e detectedGnssReceiver = GNSS_RECEIVER_UNKNOWN;
10891089
bool detectedTilt = false;
1090+
bool testedTilt = false;
10901091

10911092
// Add new settings to appropriate group above or create new group
10921093
// Then also add to the same group in rtkSettingsEntries below
@@ -1709,6 +1710,7 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
17091710

17101711
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, tGnssReceiver, 0, & settings.detectedGnssReceiver, "detectedGnssReceiver", },
17111712
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, _bool, 0, & settings.detectedTilt, "detectedTilt", },
1713+
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, _bool, 0, & settings.testedTilt, "testedTilt", },
17121714

17131715
// Add new settings to appropriate group above or create new group
17141716
// Then also add to the same group in settings above

0 commit comments

Comments
 (0)