Fix FW update needed button order

This commit is contained in:
D.R.racer 2022-05-14 17:45:15 +02:00
parent 108f439bb7
commit 87ed42ba9b
3 changed files with 8 additions and 4 deletions

View File

@ -330,7 +330,7 @@ static const uint8_t errorButtons[] PROGMEM = {
Btns(ButtonOperations::Unload, ButtonOperations::Continue),
Btns(ButtonOperations::StopPrint, ButtonOperations::RestartMMU),
Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),
Btns(ButtonOperations::NoOperation, ButtonOperations::DisableMMU),
Btns(ButtonOperations::DisableMMU, ButtonOperations::NoOperation),
Btns(ButtonOperations::RestartMMU, ButtonOperations::NoOperation),
Btns(ButtonOperations::Retry, ButtonOperations::NoOperation),
};

View File

@ -29,6 +29,9 @@ static constexpr uint8_t FindErrorIndex(uint16_t pec) {
// check that the searching algoritm works
static_assert( FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER) == 0);
static_assert( FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_GO_OFF) == 1);
static_assert( FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER) == 2);
static_assert( FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_GO_OFF) == 3);
uint8_t PrusaErrorCodeIndex(uint16_t ec) {
switch (ec) {
@ -132,7 +135,8 @@ uint8_t PrusaErrorButtons(uint8_t i){
}
const char * const PrusaErrorButtonTitle(uint8_t bi){
return (const char * const)pgm_read_ptr(btnOperation + bi);
// -1 represents the hidden NoOperation button which is not drawn in any way
return (const char * const)pgm_read_ptr(btnOperation + bi - 1);
}
const char * const PrusaErrorButtonMore(){

View File

@ -56,8 +56,8 @@ back_to_choices:
NULL, // NULL, since title screen is not in PROGMEM
false,
two_choices ? LEFT_BUTTON_CHOICE : MIDDLE_BUTTON_CHOICE,
_T(PrusaErrorButtonTitle(button_low_nibble - 1)),
_T(two_choices ? PrusaErrorButtonMore() : PrusaErrorButtonTitle(button_high_nibble - 1)),
_T(PrusaErrorButtonTitle(button_low_nibble)),
_T(two_choices ? PrusaErrorButtonMore() : PrusaErrorButtonTitle(button_high_nibble)),
two_choices ? nullptr : _T(PrusaErrorButtonMore()),
two_choices ?
10 // If two choices, allow the first choice to have more characters