1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 08:45:24 +03:00

[Horus] Reset SF didn't handle telemetry sensors

This commit is contained in:
Andre Bernet 2016-10-15 13:51:52 +02:00
parent 8de57dc1a3
commit 504bb7a98c

View file

@ -243,8 +243,16 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
int16_t val_min = 0;
int16_t val_max = 255;
if (func == FUNC_RESET) {
val_max = FUNC_RESET_PARAM_LAST;
lcdDrawTextAtIndex(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_VFSWRESET, CFN_PARAM(cfn), attr);
val_max = FUNC_RESET_PARAM_FIRST_TELEM+lastUsedTelemetryIndex();
int param = CFN_PARAM(cfn);
if (param < FUNC_RESET_PARAM_FIRST_TELEM) {
lcdDrawTextAtIndex(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_VFSWRESET, param, attr);
}
else {
TelemetrySensor * sensor = & g_model.telemetrySensors[param-FUNC_RESET_PARAM_FIRST_TELEM];
lcdDrawSizedText(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, sensor->label, TELEM_LABEL_LEN, attr|ZCHAR);
}
if (active) INCDEC_ENABLE_CHECK(functions == g_eeGeneral.customFn ? isSourceAvailableInGlobalResetSpecialFunction : isSourceAvailableInResetSpecialFunction);
}
#if defined(OVERRIDE_CHANNEL_FUNCTION)
else if (func == FUNC_OVERRIDE_CHANNEL) {