mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Merge pull request #6254 from mikeller/remove_feature_call
Removed calls to (latching) 'feature()'.
This commit is contained in:
commit
4b965a572a
59 changed files with 280 additions and 250 deletions
|
@ -788,7 +788,7 @@ static bool osdDrawSingleElement(uint8_t item)
|
|||
|
||||
#ifdef USE_ESC_SENSOR
|
||||
// Show warning if we lose motor output, the ESC is overheating or excessive current draw
|
||||
if (feature(FEATURE_ESC_SENSOR) && osdWarnGetState(OSD_WARNING_ESC_FAIL)) {
|
||||
if (featureIsEnabled(FEATURE_ESC_SENSOR) && osdWarnGetState(OSD_WARNING_ESC_FAIL)) {
|
||||
char escWarningMsg[OSD_FORMAT_MESSAGE_BUFFER_SIZE];
|
||||
unsigned pos = 0;
|
||||
|
||||
|
@ -956,13 +956,13 @@ static bool osdDrawSingleElement(uint8_t item)
|
|||
|
||||
#ifdef USE_ESC_SENSOR
|
||||
case OSD_ESC_TMP:
|
||||
if (feature(FEATURE_ESC_SENSOR)) {
|
||||
if (featureIsEnabled(FEATURE_ESC_SENSOR)) {
|
||||
tfp_sprintf(buff, "%3d%c", osdConvertTemperatureToSelectedUnit(escDataCombined->temperature * 10) / 10, osdGetTemperatureSymbolForSelectedUnit());
|
||||
}
|
||||
break;
|
||||
|
||||
case OSD_ESC_RPM:
|
||||
if (feature(FEATURE_ESC_SENSOR)) {
|
||||
if (featureIsEnabled(FEATURE_ESC_SENSOR)) {
|
||||
tfp_sprintf(buff, "%5d", escDataCombined == NULL ? 0 : calcEscRpm(escDataCombined->rpm));
|
||||
}
|
||||
break;
|
||||
|
@ -1040,7 +1040,7 @@ static void osdDrawElements(void)
|
|||
#endif // GPS
|
||||
|
||||
#ifdef USE_ESC_SENSOR
|
||||
if (feature(FEATURE_ESC_SENSOR)) {
|
||||
if (featureIsEnabled(FEATURE_ESC_SENSOR)) {
|
||||
osdDrawSingleElement(OSD_ESC_TMP);
|
||||
osdDrawSingleElement(OSD_ESC_RPM);
|
||||
}
|
||||
|
@ -1226,7 +1226,7 @@ void osdUpdateAlarms(void)
|
|||
}
|
||||
|
||||
#ifdef USE_ESC_SENSOR
|
||||
if (feature(FEATURE_ESC_SENSOR)) {
|
||||
if (featureIsEnabled(FEATURE_ESC_SENSOR)) {
|
||||
// This works because the combined ESC data contains the maximum temperature seen amongst all ESCs
|
||||
if (osdConfig()->esc_temp_alarm != ESC_TEMP_ALARM_OFF && escDataCombined->temperature >= osdConfig()->esc_temp_alarm) {
|
||||
SET_BLINK(OSD_ESC_TMP);
|
||||
|
@ -1560,7 +1560,7 @@ STATIC_UNIT_TESTED void osdRefresh(timeUs_t currentTimeUs)
|
|||
blinkState = (currentTimeUs / 200000) % 2;
|
||||
|
||||
#ifdef USE_ESC_SENSOR
|
||||
if (feature(FEATURE_ESC_SENSOR)) {
|
||||
if (featureIsEnabled(FEATURE_ESC_SENSOR)) {
|
||||
escDataCombined = getEscSensorData(ESC_SENSOR_COMBINED);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue