fix: Use keysGetMaxTrims() instead of MAX_TRIMS (#3860)

* fix: use keysGetMaxTrims() instead of MAX_TRIMS

* feat: add support for virtual trims

This is necessary for radios like X-lite where half of the trims are simulated
This commit is contained in:
Raphael Coeffic
2023-07-30 14:18:58 +10:00
committed by GitHub
parent 76423370cd
commit 574369aca4
13 changed files with 55 additions and 36 deletions
+1 -1
View File
@@ -808,7 +808,7 @@ void menuModelSetup(event_t event)
case ITEM_MODEL_SETUP_THROTTLE_TRIM_SWITCH:
lcdDrawTextAlignedLeft(y, STR_TTRIM_SW);
if (attr)
CHECK_INCDEC_MODELVAR_ZERO(event, g_model.thrTrimSw, MAX_TRIMS - 1);
CHECK_INCDEC_MODELVAR_ZERO(event, g_model.thrTrimSw, keysGetMaxTrims() - 1);
drawSource(MODEL_SETUP_2ND_COLUMN, y, g_model.getThrottleStickTrimSource(), attr);
break;