1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-25 01:05:21 +03:00

Fix compilation when USE_SECONDARY_IMU not defined

This commit is contained in:
Martin Luessi 2022-01-12 16:00:55 -08:00
parent a8016edd0d
commit da8cc2e9d2
4 changed files with 18 additions and 1 deletions

View file

@ -3344,7 +3344,11 @@ static void cliStatus(char *cmdline)
hardwareSensorStatusNames[getHwRangefinderStatus()],
hardwareSensorStatusNames[getHwOpticalFlowStatus()],
hardwareSensorStatusNames[getHwGPSStatus()],
#ifdef USE_SECONDARY_IMU
hardwareSensorStatusNames[getHwSecondaryImuStatus()]
#else
hardwareSensorStatusNames[0]
#endif
);
#ifdef USE_ESC_SENSOR

View file

@ -425,7 +425,11 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
sbufWriteU8(dst, getHwRangefinderStatus());
sbufWriteU8(dst, getHwPitotmeterStatus());
sbufWriteU8(dst, getHwOpticalFlowStatus());
#ifdef USE_SECONDARY_IMU
sbufWriteU8(dst, getHwSecondaryImuStatus());
#else
sbufWriteU8(dst, 0);
#endif
break;
case MSP_ACTIVEBOXES:

View file

@ -22,6 +22,9 @@
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
#include "platform.h"
#ifdef USE_SECONDARY_IMU
#include "stdint.h"
#include "build/debug.h"
@ -256,4 +259,6 @@ hardwareSensorStatus_e getHwSecondaryImuStatus(void)
#else
return HW_SENSOR_NONE;
#endif
}
}
#endif

View file

@ -227,7 +227,11 @@ bool isHardwareHealthy(void)
const hardwareSensorStatus_e pitotStatus = getHwPitotmeterStatus();
const hardwareSensorStatus_e gpsStatus = getHwGPSStatus();
const hardwareSensorStatus_e opflowStatus = getHwOpticalFlowStatus();
#ifdef USE_SECONDARY_IMU
const hardwareSensorStatus_e imu2Status = getHwSecondaryImuStatus();
#else
const hardwareSensorStatus_e imu2Status = HW_SENSOR_NONE;
#endif
// Sensor is considered failing if it's either unavailable (selected but not detected) or unhealthy (returning invalid readings)
if (gyroStatus == HW_SENSOR_UNAVAILABLE || gyroStatus == HW_SENSOR_UNHEALTHY)