🧑💻 Add standard BUZZ types
This commit is contained in:
committed by
Scott Lahteine
parent
f82b133595
commit
c49f26a7ae
@ -143,6 +143,8 @@ uint8_t MMU2::get_current_tool() {
|
||||
#define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE)
|
||||
#endif
|
||||
|
||||
inline void ATTN_BUZZ(const bool two=false) { BUZZ(200, 404); if (two) { BUZZ(10, 0); BUZZ(200, 404); } }
|
||||
|
||||
void MMU2::mmu_loop() {
|
||||
|
||||
switch (state) {
|
||||
@ -525,7 +527,7 @@ static void mmu2_not_responding() {
|
||||
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
|
||||
load_filament_to_nozzle(index);
|
||||
#else
|
||||
BUZZ(400, 40);
|
||||
ERR_BUZZ();
|
||||
#endif
|
||||
} break;
|
||||
|
||||
@ -544,7 +546,7 @@ static void mmu2_not_responding() {
|
||||
active_extruder = 0;
|
||||
}
|
||||
#else
|
||||
BUZZ(400, 40);
|
||||
ERR_BUZZ();
|
||||
#endif
|
||||
} break;
|
||||
|
||||
@ -613,7 +615,7 @@ static void mmu2_not_responding() {
|
||||
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
|
||||
load_filament_to_nozzle(index);
|
||||
#else
|
||||
BUZZ(400, 40);
|
||||
ERR_BUZZ();
|
||||
#endif
|
||||
} break;
|
||||
|
||||
@ -633,7 +635,7 @@ static void mmu2_not_responding() {
|
||||
extruder = index;
|
||||
active_extruder = 0;
|
||||
#else
|
||||
BUZZ(400, 40);
|
||||
ERR_BUZZ();
|
||||
#endif
|
||||
} break;
|
||||
|
||||
@ -707,7 +709,7 @@ static void mmu2_not_responding() {
|
||||
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
|
||||
load_filament_to_nozzle(index);
|
||||
#else
|
||||
BUZZ(400, 40);
|
||||
ERR_BUZZ();
|
||||
#endif
|
||||
} break;
|
||||
|
||||
@ -726,7 +728,7 @@ static void mmu2_not_responding() {
|
||||
extruder = index;
|
||||
active_extruder = 0;
|
||||
#else
|
||||
BUZZ(400, 40);
|
||||
ERR_BUZZ();
|
||||
#endif
|
||||
} break;
|
||||
|
||||
@ -811,25 +813,21 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
|
||||
if (turn_off_nozzle && resume_hotend_temp) {
|
||||
thermalManager.setTargetHotend(resume_hotend_temp, active_extruder);
|
||||
LCD_MESSAGE(MSG_HEATING);
|
||||
BUZZ(200, 40);
|
||||
ERR_BUZZ();
|
||||
|
||||
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(1000);
|
||||
}
|
||||
|
||||
if (move_axes && all_axes_homed()) {
|
||||
LCD_MESSAGE(MSG_MMU2_RESUMING);
|
||||
BUZZ(198, 404); BUZZ(4, 0); BUZZ(198, 404);
|
||||
LCD_MESSAGE(MSG_MMU2_RESUMING);
|
||||
ATTN_BUZZ(true);
|
||||
|
||||
if (move_axes && all_axes_homed()) {
|
||||
// Move XY to starting position, then Z
|
||||
do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE));
|
||||
|
||||
// Move Z_AXIS to saved position
|
||||
do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
||||
}
|
||||
else {
|
||||
BUZZ(198, 404); BUZZ(4, 0); BUZZ(198, 404);
|
||||
LCD_MESSAGE(MSG_MMU2_RESUMING);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -898,7 +896,7 @@ void MMU2::load_filament(const uint8_t index) {
|
||||
|
||||
command(MMU_CMD_L0 + index);
|
||||
manage_response(false, false);
|
||||
BUZZ(200, 404);
|
||||
ATTN_BUZZ();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -909,7 +907,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) {
|
||||
if (!_enabled) return false;
|
||||
|
||||
if (thermalManager.tooColdToExtrude(active_extruder)) {
|
||||
BUZZ(200, 404);
|
||||
ATTN_BUZZ();
|
||||
LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
|
||||
return false;
|
||||
}
|
||||
@ -924,7 +922,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) {
|
||||
extruder = index;
|
||||
active_extruder = 0;
|
||||
load_to_nozzle();
|
||||
BUZZ(200, 404);
|
||||
ATTN_BUZZ();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@ -945,7 +943,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
|
||||
if (!_enabled) return false;
|
||||
|
||||
if (thermalManager.tooColdToExtrude(active_extruder)) {
|
||||
BUZZ(200, 404);
|
||||
ATTN_BUZZ();
|
||||
LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
|
||||
return false;
|
||||
}
|
||||
@ -961,12 +959,11 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
|
||||
|
||||
if (recover) {
|
||||
LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
|
||||
BUZZ(200, 404);
|
||||
ATTN_BUZZ();
|
||||
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover")));
|
||||
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
|
||||
BUZZ(200, 404);
|
||||
BUZZ(200, 404);
|
||||
ATTN_BUZZ(true);
|
||||
|
||||
command(MMU_CMD_R0);
|
||||
manage_response(false, false);
|
||||
@ -979,7 +976,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
|
||||
|
||||
set_runout_valid(false);
|
||||
|
||||
BUZZ(200, 404);
|
||||
ATTN_BUZZ();
|
||||
|
||||
stepper.disable_extruder();
|
||||
|
||||
@ -994,7 +991,7 @@ bool MMU2::unload() {
|
||||
if (!_enabled) return false;
|
||||
|
||||
if (thermalManager.tooColdToExtrude(active_extruder)) {
|
||||
BUZZ(200, 404);
|
||||
ATTN_BUZZ();
|
||||
LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
|
||||
return false;
|
||||
}
|
||||
@ -1005,7 +1002,7 @@ bool MMU2::unload() {
|
||||
command(MMU_CMD_U0);
|
||||
manage_response(false, true);
|
||||
|
||||
BUZZ(200, 404);
|
||||
ATTN_BUZZ();
|
||||
|
||||
// no active tool
|
||||
extruder = MMU2_NO_TOOL;
|
||||
|
Reference in New Issue
Block a user