Don't enable lcd update inside mmu_eject_filament().
This commit is contained in:
parent
f496076508
commit
a687b8e64a
|
|
@ -150,6 +150,29 @@ extern void lcd_update_enable(uint8_t enabled);
|
||||||
|
|
||||||
extern void lcd_buttons_update(void);
|
extern void lcd_buttons_update(void);
|
||||||
|
|
||||||
|
//! @brief Helper class to temporarily disable LCD updates
|
||||||
|
//!
|
||||||
|
//! When constructed (on stack), original state state of lcd_update_enabled is stored
|
||||||
|
//! and LCD updates are disabled.
|
||||||
|
//! When destroyed (gone out of scope), original state of LCD update is restored.
|
||||||
|
//! It has zero overhead compared to storing bool saved = lcd_update_enabled
|
||||||
|
//! and calling lcd_update_enable(false) and lcd_update_enable(saved).
|
||||||
|
class LcdUpdateDisabler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LcdUpdateDisabler(): m_updateEnabled(lcd_update_enabled)
|
||||||
|
{
|
||||||
|
lcd_update_enable(false);
|
||||||
|
}
|
||||||
|
~LcdUpdateDisabler()
|
||||||
|
{
|
||||||
|
lcd_update_enable(m_updateEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_updateEnabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1012,14 +1012,15 @@ void mmu_eject_filament(uint8_t filament, bool recover)
|
||||||
if (degHotend0() > EXTRUDE_MINTEMP)
|
if (degHotend0() > EXTRUDE_MINTEMP)
|
||||||
{
|
{
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
lcd_update_enable(false);
|
|
||||||
lcd_clear();
|
|
||||||
lcd_set_cursor(0, 1); lcd_puts_P(_i("Ejecting filament"));
|
|
||||||
current_position[E_AXIS] -= 80;
|
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2500 / 60, active_extruder);
|
|
||||||
st_synchronize();
|
|
||||||
|
|
||||||
lcd_update_enable(true);
|
{
|
||||||
|
LcdUpdateDisabler disableLcdUpdate;
|
||||||
|
lcd_clear();
|
||||||
|
lcd_set_cursor(0, 1); lcd_puts_P(_i("Ejecting filament"));
|
||||||
|
current_position[E_AXIS] -= 80;
|
||||||
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2500 / 60, active_extruder);
|
||||||
|
st_synchronize();
|
||||||
|
}
|
||||||
|
|
||||||
mmu_command(MMU_CMD_E0 + filament);
|
mmu_command(MMU_CMD_E0 + filament);
|
||||||
manage_response(false, false);
|
manage_response(false, false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue