PFW-1323 Fix MMU error screen doesn't disappear when error resolved on the MMU
This commit is contained in:
parent
7b91e73c8b
commit
d49e858cf7
|
|
@ -120,6 +120,9 @@ public:
|
||||||
/// @returns current state of FINDA (true=filament present, false=filament not present)
|
/// @returns current state of FINDA (true=filament present, false=filament not present)
|
||||||
inline bool FindaDetectsFilament()const { return logic.FindaPressed(); }
|
inline bool FindaDetectsFilament()const { return logic.FindaPressed(); }
|
||||||
|
|
||||||
|
/// @returns Current error code
|
||||||
|
inline ErrorCode MMUCurrentErrorCode() const { return logic.Error(); }
|
||||||
|
|
||||||
/// @returns the version of the connected MMU FW.
|
/// @returns the version of the connected MMU FW.
|
||||||
/// In the future we'll return the trully detected FW version
|
/// In the future we'll return the trully detected FW version
|
||||||
Version GetMMUFWVersion()const {
|
Version GetMMUFWVersion()const {
|
||||||
|
|
|
||||||
|
|
@ -190,8 +190,9 @@ static uint8_t ReportErrorHookMonitor(uint16_t ec) {
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class ReportErrorHookStates : uint8_t {
|
enum class ReportErrorHookStates : uint8_t {
|
||||||
RENDER_ERROR_SCREEN = 0,
|
RENDER_ERROR_SCREEN = 0,
|
||||||
MONITOR_SELECTION = 1,
|
MONITOR_SELECTION = 1,
|
||||||
|
DISMISS_ERROR_SCREEN = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ReportErrorHookStates ReportErrorHookState;
|
enum ReportErrorHookStates ReportErrorHookState;
|
||||||
|
|
@ -202,6 +203,14 @@ enum ReportErrorHookStates ReportErrorHookState;
|
||||||
* @param[in] ec Error code
|
* @param[in] ec Error code
|
||||||
*/
|
*/
|
||||||
void ReportErrorHook(uint16_t ec) {
|
void ReportErrorHook(uint16_t ec) {
|
||||||
|
if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK)
|
||||||
|
{
|
||||||
|
// If the error code suddenly changes to OK, that means
|
||||||
|
// a button was pushed on the MMU and the LCD should
|
||||||
|
// dismiss the error screen until MMU raises a new error
|
||||||
|
ReportErrorHookState = ReportErrorHookStates::DISMISS_ERROR_SCREEN;
|
||||||
|
}
|
||||||
|
|
||||||
switch ((uint8_t)ReportErrorHookState)
|
switch ((uint8_t)ReportErrorHookState)
|
||||||
{
|
{
|
||||||
case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN:
|
case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN:
|
||||||
|
|
@ -234,6 +243,14 @@ void ReportErrorHook(uint16_t ec) {
|
||||||
}
|
}
|
||||||
return; // Always return to loop() to let MMU trigger a call to ReportErrorHook again
|
return; // Always return to loop() to let MMU trigger a call to ReportErrorHook again
|
||||||
break;
|
break;
|
||||||
|
case (uint8_t)ReportErrorHookStates::DISMISS_ERROR_SCREEN:
|
||||||
|
lcd_set_custom_characters();
|
||||||
|
lcd_update_enable(true);
|
||||||
|
lcd_return_to_status();
|
||||||
|
// Reset the state in case a new error is reported
|
||||||
|
mmu2.is_mmu_error_monitor_active = false;
|
||||||
|
ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue