From 504bb7a98cb41a310c471c114b43e8dfb7f6789e Mon Sep 17 00:00:00 2001 From: Andre Bernet Date: Sat, 15 Oct 2016 13:51:52 +0200 Subject: [PATCH] [Horus] Reset SF didn't handle telemetry sensors --- radio/src/gui/480x272/model_special_functions.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/480x272/model_special_functions.cpp b/radio/src/gui/480x272/model_special_functions.cpp index 46d483643..55632db09 100644 --- a/radio/src/gui/480x272/model_special_functions.cpp +++ b/radio/src/gui/480x272/model_special_functions.cpp @@ -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) { -- 2.11.4.GIT