1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 16:55:29 +03:00

Report motor RPM via MSP

This commit is contained in:
Pawel Spychalski (DzikuVx) 2022-07-13 19:54:17 +02:00
parent 95c5ac8d26
commit e4226acf31
2 changed files with 16 additions and 0 deletions

View file

@ -116,6 +116,7 @@
#include "sensors/gyro.h"
#include "sensors/opflow.h"
#include "sensors/temperature.h"
#include "sensors/esc_sensor.h"
#include "telemetry/telemetry.h"
@ -1521,6 +1522,19 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
break;
#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:
return false;
}

View file

@ -81,3 +81,5 @@
#define MSP2_INAV_MISC2 0x203A
#define MSP2_INAV_LOGIC_CONDITIONS_SINGLE 0x203B
#define MSP2_INAV_ESC_RPM 0x2040