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

Added checks for ESC_SENSOR feature being enabled when reading ESC sensor data. (#5663)

This commit is contained in:
Michael Keller 2018-04-11 23:31:14 +12:00 committed by GitHub
parent 6cfec6fc53
commit e0dcea4d48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 5 deletions

View file

@ -145,6 +145,10 @@ bool isEscSensorActive(void)
escSensorData_t *getEscSensorData(uint8_t motorNumber)
{
if (!feature(FEATURE_ESC_SENSOR)) {
return NULL;
}
if (motorNumber < getMotorCount()) {
return &escSensorData[motorNumber];
} else if (motorNumber == ESC_SENSOR_COMBINED) {