fix(color): UI freeze when setting up 'Set' special function with no timers configured (#6377)

This commit is contained in:
philmoz
2025-06-21 20:03:30 +10:00
committed by GitHub
parent f4c019bbb1
commit 847d779de0
25 changed files with 1098 additions and 1040 deletions
@@ -256,9 +256,15 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
}
#endif
else if (func == FUNC_SET_TIMER) {
maxParam = TIMERS-1;
drawStringWithIndex(lcdNextPos, y, STR_TIMER, CFN_TIMER_INDEX(cfn)+1, attr);
if (active) CFN_TIMER_INDEX(cfn) = checkIncDec(event, CFN_TIMER_INDEX(cfn), 0, maxParam, eeFlags, isTimerSourceAvailable);
if (timersSetupCount()> 0) {
maxParam = TIMERS-1;
drawStringWithIndex(lcdNextPos, y, STR_TIMER, CFN_TIMER_INDEX(cfn)+1, attr);
if (active) CFN_TIMER_INDEX(cfn) = checkIncDec(event, CFN_TIMER_INDEX(cfn), 0, maxParam, eeFlags, isTimerSourceAvailable);
} else {
lcdDrawText(lcdNextPos + FW, y, STR_NO_TIMERS, 0);
if (attr)
repeatLastCursorHorMove(event);
}
break;
}
else if (attr) {
@@ -300,8 +306,12 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
}
#endif
else if (func == FUNC_SET_TIMER) {
getMixSrcRange(MIXSRC_FIRST_TIMER, val_min, val_max);
drawTimer(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT|TIMEHOUR, attr);
if (timersSetupCount() > 0) {
getMixSrcRange(MIXSRC_FIRST_TIMER, val_min, val_max);
drawTimer(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT|TIMEHOUR, attr);
} else if (attr) {
repeatLastCursorHorMove(event);
}
}
else if (func == FUNC_PLAY_SOUND) {
val_max = AU_SPECIAL_SOUND_LAST-AU_SPECIAL_SOUND_FIRST-1;