Update the error menu after merging new changes

Will test this tomorrow
This commit is contained in:
Guðni Már Gilbert 2022-05-13 19:18:32 +00:00 committed by D.R.racer
parent c28354bf92
commit c1ec80817c
2 changed files with 8 additions and 17 deletions

View File

@ -266,12 +266,11 @@ static const char * const errorDescs[] PROGMEM = {
enum class ButtonOperations : uint8_t { enum class ButtonOperations : uint8_t {
NoOperation = 0, NoOperation = 0,
Retry = 1, Retry = 1,
SlowLoad = 2, Continue = 2,
Continue = 3, RestartMMU = 3,
RestartMMU = 4, Unload = 4,
Unload = 5, StopPrint = 5,
StopPrint = 6, DisableMMU = 6,
DisableMMU = 7,
}; };
// we have max 3 buttons/operations to select from // we have max 3 buttons/operations to select from
@ -291,7 +290,6 @@ static const char btnMore[] PROGMEM_I1 = ISTR("More\x01");
// Used to parse the buttons from Btns(). // Used to parse the buttons from Btns().
static const char * const btnOperation[] PROGMEM = { static const char * const btnOperation[] PROGMEM = {
btnRetry, btnRetry,
btnSlowLoad,
btnContinue, btnContinue,
btnRestartMMU, btnRestartMMU,
btnUnload, btnUnload,

View File

@ -37,7 +37,7 @@ void ReportErrorHook(CommandInProgress cip, uint16_t ec) {
const uint8_t button_low_nibble = BUTTON_OP_LO_NIBBLE(button_operation); const uint8_t button_low_nibble = BUTTON_OP_LO_NIBBLE(button_operation);
// Check if the menu should have three or two choices // Check if the menu should have three or two choices
if (button_low_nibble == (uint8_t)ButtonOperations::NoOperation) if (button_high_nibble == (uint8_t)ButtonOperations::NoOperation)
{ {
// Two operations not specified, the error menu should only show two choices // Two operations not specified, the error menu should only show two choices
two_choices = true; two_choices = true;
@ -58,9 +58,7 @@ back_to_choices:
NULL, // NULL, since title screen is not in PROGMEM NULL, // NULL, since title screen is not in PROGMEM
false, false,
false, false,
two_choices ? static_cast<const char * const>(pgm_read_ptr(&btnOperation[button_low_nibble - 1])),
static_cast<const char * const>(pgm_read_ptr(&btnOperation[button_high_nibble - 1]))
: static_cast<const char * const>(pgm_read_ptr(&btnOperation[button_low_nibble - 1])),
two_choices ? two_choices ?
btnMore btnMore
: static_cast<const char * const>(pgm_read_ptr(&btnOperation[button_high_nibble - 1])), : static_cast<const char * const>(pgm_read_ptr(&btnOperation[button_high_nibble - 1])),
@ -86,7 +84,6 @@ back_to_choices:
switch (button_high_nibble) switch (button_high_nibble)
{ {
case (uint8_t)ButtonOperations::Retry: case (uint8_t)ButtonOperations::Retry:
case (uint8_t)ButtonOperations::SlowLoad:
case (uint8_t)ButtonOperations::Continue: case (uint8_t)ButtonOperations::Continue:
case (uint8_t)ButtonOperations::RestartMMU: case (uint8_t)ButtonOperations::RestartMMU:
case (uint8_t)ButtonOperations::Unload: case (uint8_t)ButtonOperations::Unload:
@ -100,13 +97,9 @@ back_to_choices:
} else { } else {
// TODO: User selected the left most choice, not sure what to do. // TODO: User selected the left most choice, not sure what to do.
// At the moment just return to the status screen // At the moment just return to the status screen
switch ( two_choices ? switch (button_low_nibble)
button_high_nibble
: button_low_nibble
)
{ {
case (uint8_t)ButtonOperations::Retry: case (uint8_t)ButtonOperations::Retry:
case (uint8_t)ButtonOperations::SlowLoad:
case (uint8_t)ButtonOperations::Continue: case (uint8_t)ButtonOperations::Continue:
case (uint8_t)ButtonOperations::RestartMMU: case (uint8_t)ButtonOperations::RestartMMU:
case (uint8_t)ButtonOperations::Unload: case (uint8_t)ButtonOperations::Unload: