WUPSConfigItemButtonCombo: Fix displaying the conlict warning

This commit is contained in:
Maschell 2025-01-05 15:21:34 +01:00
parent 23da1e5b1a
commit e4289a172b
2 changed files with 7 additions and 2 deletions

View File

@ -13,6 +13,7 @@ typedef enum ConfigItemButtonCombo_State {
WUPS_CONFIG_ITEM_BUTTON_COMBO_STATE_PREPARE_FOR_HOLD,
WUPS_CONFIG_ITEM_BUTTON_COMBO_STATE_WAIT_FOR_HOLD,
WUPS_CONFIG_ITEM_BUTTON_COMBO_STATE_INVALID_HANDLE,
WUPS_CONFIG_ITEM_BUTTON_COMBO_STATE_CONFLICT_WAIT,
} ConfigItemButtonCombo_State;
typedef struct ConfigItemButtonCombo {

View File

@ -159,13 +159,17 @@ namespace {
if (const auto res = checkForHold(item); res == WUPS_BUTTON_COMBO_ERROR_SUCCESS || res == WUPS_BUTTON_COMBO_ERROR_ABORTED) {
item->itemState = WUPS_CONFIG_ITEM_BUTTON_COMBO_STATE_NONE;
} else {
item->itemState = WUPS_CONFIG_ITEM_BUTTON_COMBO_STATE_PREPARE_FOR_HOLD;
item->itemState = WUPS_CONFIG_ITEM_BUTTON_COMBO_STATE_CONFLICT_WAIT;
snprintf(out_buf, out_size, "ERROR: Conflict detected. Try again");
OSSleepTicks(OSMillisecondsToTicks(2000));
return 0;
}
break;
}
case WUPS_CONFIG_ITEM_BUTTON_COMBO_STATE_CONFLICT_WAIT:
OSSleepTicks(OSMillisecondsToTicks(2000));
snprintf(out_buf, out_size, "ERROR: Conflict detected. Try again");
item->itemState = WUPS_CONFIG_ITEM_BUTTON_COMBO_STATE_PREPARE_FOR_HOLD;
return 0;
case WUPS_CONFIG_ITEM_BUTTON_COMBO_STATE_NONE:
break;
}