1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 09:45:37 +03:00

Update RPM data in smartport and frsky_hub telemetry

Both previously displayed eRPM.  frsky_hub RPM data is constrained to int16 so the value sent is RPM/10.

Updates per review and function renaming
This commit is contained in:
Bruce Luckcuck 2018-04-24 18:31:41 -04:00
parent 063f3829d4
commit 809c2a950b
8 changed files with 16 additions and 9 deletions

View file

@ -264,7 +264,7 @@ static uint8_t decodeEscFrame(void)
frameStatus = ESC_SENSOR_FRAME_COMPLETE;
DEBUG_SET(DEBUG_ESC_SENSOR_RPM, escSensorMotor, (escSensorData[escSensorMotor].rpm * 10) / (motorConfig()->motorPolesCount / 2)); // output actual rpm/10 to fit in 16bit signed.
DEBUG_SET(DEBUG_ESC_SENSOR_RPM, escSensorMotor, calcEscRpm(escSensorData[escSensorMotor].rpm) / 10); // output actual rpm/10 to fit in 16bit signed.
DEBUG_SET(DEBUG_ESC_SENSOR_TMP, escSensorMotor, escSensorData[escSensorMotor].temperature);
} else {
frameStatus = ESC_SENSOR_FRAME_FAILED;
@ -350,4 +350,9 @@ void escSensorProcess(timeUs_t currentTimeUs)
break;
}
}
int calcEscRpm(int erpm)
{
return (erpm * 100) / (motorConfig()->motorPoleCount / 2);
}
#endif

View file

@ -52,3 +52,5 @@ void startEscDataRead(uint8_t *frameBuffer, uint8_t frameLength);
uint8_t getNumberEscBytesRead(void);
uint8_t calculateCrc8(const uint8_t *Buf, const uint8_t BufLen);
int calcEscRpm(int erpm);