mmu: Add CheckErrorScreenUserInput
Due to differences in 8-bit FW I had to implement two new get functions * GetCommandInProgress * GetLastErrorCode
This commit is contained in:
parent
7bc7e7a7e8
commit
12a3051c50
|
|
@ -191,12 +191,7 @@ void MMU2::mmu_loop() {
|
||||||
|
|
||||||
void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) {
|
void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) {
|
||||||
logicStepLastStatus = LogicStep(reportErrors); // it looks like the mmu_loop doesn't need to be a blocking call
|
logicStepLastStatus = LogicStep(reportErrors); // it looks like the mmu_loop doesn't need to be a blocking call
|
||||||
|
CheckErrorScreenUserInput();
|
||||||
if (isErrorScreenRunning()) {
|
|
||||||
// Call this every iteration to keep the knob rotation responsive
|
|
||||||
// This includes when mmu_loop is called within manage_response
|
|
||||||
ReportErrorHook((CommandInProgress)logic.CommandInProgress(), lastErrorCode, uint8_t(lastErrorSource));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MMU2::CheckFINDARunout() {
|
void MMU2::CheckFINDARunout() {
|
||||||
|
|
|
||||||
|
|
@ -160,9 +160,15 @@ public:
|
||||||
/// @returns Current error code
|
/// @returns Current error code
|
||||||
inline ErrorCode MMUCurrentErrorCode() const { return logic.Error(); }
|
inline ErrorCode MMUCurrentErrorCode() const { return logic.Error(); }
|
||||||
|
|
||||||
|
/// @returns Command in progress
|
||||||
|
inline uint8_t GetCommandInProgress() const { return logic.CommandInProgress(); }
|
||||||
|
|
||||||
/// @returns Last error source
|
/// @returns Last error source
|
||||||
inline ErrorSource MMULastErrorSource() const { return lastErrorSource; }
|
inline ErrorSource MMULastErrorSource() const { return lastErrorSource; }
|
||||||
|
|
||||||
|
/// @returns Last error code
|
||||||
|
inline ErrorCode GetLastErrorCode() const { return lastErrorCode; }
|
||||||
|
|
||||||
/// @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 {
|
||||||
|
|
|
||||||
|
|
@ -221,6 +221,14 @@ static bool is_mmu_error_monitor_active;
|
||||||
// Set to false to allow the error screen to render again.
|
// Set to false to allow the error screen to render again.
|
||||||
static bool putErrorScreenToSleep;
|
static bool putErrorScreenToSleep;
|
||||||
|
|
||||||
|
void CheckErrorScreenUserInput() {
|
||||||
|
if (isErrorScreenRunning()) {
|
||||||
|
// Call this every iteration to keep the knob rotation responsive
|
||||||
|
// This includes when mmu_loop is called within manage_response
|
||||||
|
ReportErrorHook((CommandInProgress)mmu2.GetCommandInProgress(), mmu2.GetLastErrorCode(), mmu2.MMULastErrorSource());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool isErrorScreenRunning() {
|
bool isErrorScreenRunning() {
|
||||||
return is_mmu_error_monitor_active;
|
return is_mmu_error_monitor_active;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ void BeginReport(CommandInProgress cip, ProgressCode ec);
|
||||||
/// Called at the end of every MMU operation
|
/// Called at the end of every MMU operation
|
||||||
void EndReport(CommandInProgress cip, ProgressCode ec);
|
void EndReport(CommandInProgress cip, ProgressCode ec);
|
||||||
|
|
||||||
|
/// Checks for error screen user input, if the error screen is open
|
||||||
|
void CheckErrorScreenUserInput();
|
||||||
|
|
||||||
/// Return true if the printer's LCD is drawing the error screen
|
/// Return true if the printer's LCD is drawing the error screen
|
||||||
bool isErrorScreenRunning();
|
bool isErrorScreenRunning();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue