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:
parent
a8016edd0d
commit
da8cc2e9d2
4 changed files with 18 additions and 1 deletions
|
@ -3344,7 +3344,11 @@ static void cliStatus(char *cmdline)
|
||||||
hardwareSensorStatusNames[getHwRangefinderStatus()],
|
hardwareSensorStatusNames[getHwRangefinderStatus()],
|
||||||
hardwareSensorStatusNames[getHwOpticalFlowStatus()],
|
hardwareSensorStatusNames[getHwOpticalFlowStatus()],
|
||||||
hardwareSensorStatusNames[getHwGPSStatus()],
|
hardwareSensorStatusNames[getHwGPSStatus()],
|
||||||
|
#ifdef USE_SECONDARY_IMU
|
||||||
hardwareSensorStatusNames[getHwSecondaryImuStatus()]
|
hardwareSensorStatusNames[getHwSecondaryImuStatus()]
|
||||||
|
#else
|
||||||
|
hardwareSensorStatusNames[0]
|
||||||
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef USE_ESC_SENSOR
|
#ifdef USE_ESC_SENSOR
|
||||||
|
|
|
@ -425,7 +425,11 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
||||||
sbufWriteU8(dst, getHwRangefinderStatus());
|
sbufWriteU8(dst, getHwRangefinderStatus());
|
||||||
sbufWriteU8(dst, getHwPitotmeterStatus());
|
sbufWriteU8(dst, getHwPitotmeterStatus());
|
||||||
sbufWriteU8(dst, getHwOpticalFlowStatus());
|
sbufWriteU8(dst, getHwOpticalFlowStatus());
|
||||||
|
#ifdef USE_SECONDARY_IMU
|
||||||
sbufWriteU8(dst, getHwSecondaryImuStatus());
|
sbufWriteU8(dst, getHwSecondaryImuStatus());
|
||||||
|
#else
|
||||||
|
sbufWriteU8(dst, 0);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_ACTIVEBOXES:
|
case MSP_ACTIVEBOXES:
|
||||||
|
|
|
@ -22,6 +22,9 @@
|
||||||
* along with this program. If not, see http://www.gnu.org/licenses/.
|
* along with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "platform.h"
|
||||||
|
#ifdef USE_SECONDARY_IMU
|
||||||
|
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
|
|
||||||
#include "build/debug.h"
|
#include "build/debug.h"
|
||||||
|
@ -256,4 +259,6 @@ hardwareSensorStatus_e getHwSecondaryImuStatus(void)
|
||||||
#else
|
#else
|
||||||
return HW_SENSOR_NONE;
|
return HW_SENSOR_NONE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -227,7 +227,11 @@ bool isHardwareHealthy(void)
|
||||||
const hardwareSensorStatus_e pitotStatus = getHwPitotmeterStatus();
|
const hardwareSensorStatus_e pitotStatus = getHwPitotmeterStatus();
|
||||||
const hardwareSensorStatus_e gpsStatus = getHwGPSStatus();
|
const hardwareSensorStatus_e gpsStatus = getHwGPSStatus();
|
||||||
const hardwareSensorStatus_e opflowStatus = getHwOpticalFlowStatus();
|
const hardwareSensorStatus_e opflowStatus = getHwOpticalFlowStatus();
|
||||||
|
#ifdef USE_SECONDARY_IMU
|
||||||
const hardwareSensorStatus_e imu2Status = getHwSecondaryImuStatus();
|
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)
|
// 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)
|
if (gyroStatus == HW_SENSOR_UNAVAILABLE || gyroStatus == HW_SENSOR_UNHEALTHY)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue