mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 09:16:01 +03:00
Report motor RPM via MSP
This commit is contained in:
parent
95c5ac8d26
commit
e4226acf31
2 changed files with 16 additions and 0 deletions
|
@ -116,6 +116,7 @@
|
||||||
#include "sensors/gyro.h"
|
#include "sensors/gyro.h"
|
||||||
#include "sensors/opflow.h"
|
#include "sensors/opflow.h"
|
||||||
#include "sensors/temperature.h"
|
#include "sensors/temperature.h"
|
||||||
|
#include "sensors/esc_sensor.h"
|
||||||
|
|
||||||
#include "telemetry/telemetry.h"
|
#include "telemetry/telemetry.h"
|
||||||
|
|
||||||
|
@ -1521,6 +1522,19 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_ESC_SENSOR
|
||||||
|
case MSP2_INAV_ESC_RPM:
|
||||||
|
{
|
||||||
|
uint8_t motorCount = getMotorCount();
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < motorCount; i++){
|
||||||
|
const escSensorData_t *escState = getEscTelemetry(i); //Get ESC telemetry
|
||||||
|
sbufWriteU32(dst, escState->rpm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,3 +81,5 @@
|
||||||
|
|
||||||
#define MSP2_INAV_MISC2 0x203A
|
#define MSP2_INAV_MISC2 0x203A
|
||||||
#define MSP2_INAV_LOGIC_CONDITIONS_SINGLE 0x203B
|
#define MSP2_INAV_LOGIC_CONDITIONS_SINGLE 0x203B
|
||||||
|
|
||||||
|
#define MSP2_INAV_ESC_RPM 0x2040
|
Loading…
Add table
Add a link
Reference in a new issue