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

Initial cut on generic hardware status reporting via MSP and CLI

This commit is contained in:
Konstantin Sharlaimov (DigitalEntity) 2016-11-15 21:05:27 +10:00
parent 7e88da2f06
commit 009a046ceb
7 changed files with 204 additions and 7 deletions

View file

@ -67,6 +67,7 @@
#include "sensors/boardalignment.h"
#include "sensors/sensors.h"
#include "sensors/diagnostics.h"
#include "sensors/battery.h"
#include "sensors/rangefinder.h"
#include "sensors/acceleration.h"
@ -509,6 +510,17 @@ static bool mspFcProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProcessFn
break;
#endif
case MSP_SENSOR_STATUS:
sbufWriteU8(dst, isHardwareHealthy() ? 1 : 0);
sbufWriteU8(dst, getHwGyroStatus());
sbufWriteU8(dst, getHwAccelerometerStatus());
sbufWriteU8(dst, getHwCompassStatus());
sbufWriteU8(dst, getHwBarometerStatus());
sbufWriteU8(dst, getHwGPSStatus());
sbufWriteU8(dst, getHwRangefinderStatus());
sbufWriteU8(dst, HW_SENSOR_NONE); // Optical flow
break;
case MSP_STATUS_EX:
sbufWriteU16(dst, cycleTime);
#ifdef USE_I2C