Make init MMU error screens send buttons (Idle mode)
This commit is contained in:
parent
b880559ba7
commit
236098dbca
|
|
@ -510,7 +510,7 @@ void MMU2::CheckUserInput(){
|
||||||
Button(btn);
|
Button(btn);
|
||||||
break;
|
break;
|
||||||
case RestartMMU:
|
case RestartMMU:
|
||||||
Reset(CutThePower);
|
Reset(ResetPin); // we cannot do power cycle on the MK3
|
||||||
break;
|
break;
|
||||||
case StopPrint:
|
case StopPrint:
|
||||||
// @@TODO not sure if we shall handle this high level operation at this spot
|
// @@TODO not sure if we shall handle this high level operation at this spot
|
||||||
|
|
@ -576,14 +576,17 @@ StepStatus MMU2::LogicStep() {
|
||||||
break;
|
break;
|
||||||
case CommandError:
|
case CommandError:
|
||||||
ReportError(logic.Error());
|
ReportError(logic.Error());
|
||||||
|
CheckUserInput();
|
||||||
break;
|
break;
|
||||||
case CommunicationTimeout:
|
case CommunicationTimeout:
|
||||||
state = xState::Connecting;
|
state = xState::Connecting;
|
||||||
ReportError(ErrorCode::MMU_NOT_RESPONDING);
|
ReportError(ErrorCode::MMU_NOT_RESPONDING);
|
||||||
|
CheckUserInput();
|
||||||
break;
|
break;
|
||||||
case ProtocolError:
|
case ProtocolError:
|
||||||
state = xState::Connecting;
|
state = xState::Connecting;
|
||||||
ReportError(ErrorCode::PROTOCOL_ERROR);
|
ReportError(ErrorCode::PROTOCOL_ERROR);
|
||||||
|
CheckUserInput();
|
||||||
break;
|
break;
|
||||||
case VersionMismatch:
|
case VersionMismatch:
|
||||||
StopKeepPowered();
|
StopKeepPowered();
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,9 @@ Buttons ButtonPressed(uint16_t ec) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ERR_MECHANICAL_SELECTOR_CANNOT_HOME:
|
case ERR_MECHANICAL_SELECTOR_CANNOT_HOME:
|
||||||
|
case ERR_MECHANICAL_SELECTOR_CANNOT_MOVE:
|
||||||
case ERR_MECHANICAL_IDLER_CANNOT_HOME:
|
case ERR_MECHANICAL_IDLER_CANNOT_HOME:
|
||||||
|
case ERR_MECHANICAL_IDLER_CANNOT_MOVE:
|
||||||
case ERR_MECHANICAL_PULLEY_CANNOT_MOVE:
|
case ERR_MECHANICAL_PULLEY_CANNOT_MOVE:
|
||||||
switch (buttonSelectedOperation) {
|
switch (buttonSelectedOperation) {
|
||||||
// may be allow move selector right and left in the future
|
// may be allow move selector right and left in the future
|
||||||
|
|
|
||||||
|
|
@ -271,8 +271,7 @@ StepStatus Idle::Step() {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case State::Ready: // check timeout
|
case State::Ready: // check timeout
|
||||||
if (logic->Elapsed(heartBeatPeriod)) {
|
if (logic->Elapsed(heartBeatPeriod)) {
|
||||||
logic->SendMsg(RequestMsg(RequestMsgCodes::Query, 0));
|
SendQuery();
|
||||||
state = State::QuerySent;
|
|
||||||
return Processing;
|
return Processing;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -397,6 +396,9 @@ void ProtocolLogic::PlanGenericRequest(RequestMsg rq) {
|
||||||
bool ProtocolLogic::ActivatePlannedRequest(){
|
bool ProtocolLogic::ActivatePlannedRequest(){
|
||||||
if( plannedRq.code == RequestMsgCodes::Button ){
|
if( plannedRq.code == RequestMsgCodes::Button ){
|
||||||
// only issue the button to the MMU and do not restart the state machines
|
// only issue the button to the MMU and do not restart the state machines
|
||||||
|
// @@TODO - this is not completely correct, but it does the job.
|
||||||
|
// In Idle mode the command part is not active, but we still need button handling in Idle mode (resolve MMU init errors)
|
||||||
|
// -> command.SendButton is not correct, but it sends the message and everything works (for now)
|
||||||
command.SendButton(plannedRq.value);
|
command.SendButton(plannedRq.value);
|
||||||
plannedRq = RequestMsg(RequestMsgCodes::unknown, 0);
|
plannedRq = RequestMsg(RequestMsgCodes::unknown, 0);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ enum class ReportErrorHookStates : uint8_t {
|
||||||
DISMISS_ERROR_SCREEN = 2,
|
DISMISS_ERROR_SCREEN = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ReportErrorHookStates ReportErrorHookState;
|
enum ReportErrorHookStates ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Render MMU error screen on the LCD. This must be non-blocking
|
* @brief Render MMU error screen on the LCD. This must be non-blocking
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue