Switch from Start Seq into Idle immediately + disable FS autoload on MMU
This commit is contained in:
parent
400fec5d9f
commit
14b2befb7d
|
|
@ -107,9 +107,17 @@ bool Filament_sensor::checkFilamentEvents() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Filament_sensor::triggerFilamentInserted() {
|
void Filament_sensor::triggerFilamentInserted() {
|
||||||
if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) &&
|
if (autoLoadEnabled
|
||||||
!(moves_planned() || IS_SD_PRINTING || usb_timer.running() || (lcd_commands_type == LcdCommands::Layer1Cal) ||
|
&& (eFilamentAction == FilamentAction::None)
|
||||||
eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE))) {
|
&& (! MMU2::mmu2.Enabled() ) // quick and dirty hack to prevent spurious runouts while the MMU is in charge
|
||||||
|
&& !(
|
||||||
|
moves_planned()
|
||||||
|
|| IS_SD_PRINTING
|
||||||
|
|| usb_timer.running()
|
||||||
|
|| (lcd_commands_type == LcdCommands::Layer1Cal)
|
||||||
|
|| eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE)
|
||||||
|
)
|
||||||
|
) {
|
||||||
filAutoLoad();
|
filAutoLoad();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,10 @@ StepStatus StartSeq::Step() {
|
||||||
break;
|
break;
|
||||||
case State::FilamentSensorStateSent:
|
case State::FilamentSensorStateSent:
|
||||||
state = State::Ready;
|
state = State::Ready;
|
||||||
return Finished;
|
logic->SwitchFromStartToIdle();
|
||||||
|
return Processing; // Returning Finished is not a good idea in case of a fast error recovery
|
||||||
|
// - it tells the printer, that the command which experienced a protocol error and recovered successfully actually terminated.
|
||||||
|
// In such a case we must return "Processing" in order to keep the MMU state machine running and prevent the printer from executing next G-codes.
|
||||||
break;
|
break;
|
||||||
case State::RecoveringProtocolError:
|
case State::RecoveringProtocolError:
|
||||||
// timer elapsed, clear the input buffer
|
// timer elapsed, clear the input buffer
|
||||||
|
|
@ -483,6 +486,14 @@ void ProtocolLogic::SwitchToIdle() {
|
||||||
idle.Restart();
|
idle.Restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProtocolLogic::SwitchFromStartToIdle(){
|
||||||
|
state = State::Running;
|
||||||
|
currentState = &idle;
|
||||||
|
idle.Restart();
|
||||||
|
idle.SendQuery(); // force sending Q0 immediately
|
||||||
|
idle.state = Idle::State::QuerySent;
|
||||||
|
}
|
||||||
|
|
||||||
bool ProtocolLogic::Elapsed(uint32_t timeout) const {
|
bool ProtocolLogic::Elapsed(uint32_t timeout) const {
|
||||||
return _millis() >= (lastUARTActivityMs + timeout);
|
return _millis() >= (lastUARTActivityMs + timeout);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -276,6 +276,7 @@ private:
|
||||||
void LogError(const char *reason);
|
void LogError(const char *reason);
|
||||||
void LogResponse();
|
void LogResponse();
|
||||||
void SwitchFromIdleToCommand();
|
void SwitchFromIdleToCommand();
|
||||||
|
void SwitchFromStartToIdle();
|
||||||
|
|
||||||
enum class State : uint_fast8_t {
|
enum class State : uint_fast8_t {
|
||||||
Stopped, ///< stopped for whatever reason
|
Stopped, ///< stopped for whatever reason
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue