Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add MMU2_ATTN_BUZZ #23943

Merged
merged 2 commits into from
Mar 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions Marlin/src/feature/mmu/mmu2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ 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_attn_buzz(const bool two=false) {
BUZZ(200, 404);
if (two) { BUZZ(10, 0); BUZZ(200, 404); }
}

void MMU2::mmu_loop() {

Expand Down Expand Up @@ -819,7 +822,7 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
}

LCD_MESSAGE(MSG_MMU2_RESUMING);
ATTN_BUZZ(true);
mmu2_attn_buzz(true);

if (move_axes && all_axes_homed()) {
// Move XY to starting position, then Z
Expand Down Expand Up @@ -896,7 +899,7 @@ void MMU2::load_filament(const uint8_t index) {

command(MMU_CMD_L0 + index);
manage_response(false, false);
ATTN_BUZZ();
mmu2_attn_buzz();
}

/**
Expand All @@ -907,7 +910,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) {
if (!_enabled) return false;

if (thermalManager.tooColdToExtrude(active_extruder)) {
ATTN_BUZZ();
mmu2_attn_buzz();
LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
return false;
}
Expand All @@ -922,7 +925,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) {
extruder = index;
active_extruder = 0;
load_to_nozzle();
ATTN_BUZZ();
mmu2_attn_buzz();
}
return success;
}
Expand All @@ -943,7 +946,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
if (!_enabled) return false;

if (thermalManager.tooColdToExtrude(active_extruder)) {
ATTN_BUZZ();
mmu2_attn_buzz();
LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
return false;
}
Expand All @@ -959,11 +962,11 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {

if (recover) {
LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
ATTN_BUZZ();
mmu2_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());
ATTN_BUZZ(true);
mmu2_attn_buzz(true);

command(MMU_CMD_R0);
manage_response(false, false);
Expand All @@ -976,7 +979,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {

set_runout_valid(false);

ATTN_BUZZ();
mmu2_attn_buzz();

stepper.disable_extruder();

Expand All @@ -991,7 +994,7 @@ bool MMU2::unload() {
if (!_enabled) return false;

if (thermalManager.tooColdToExtrude(active_extruder)) {
ATTN_BUZZ();
mmu2_attn_buzz();
LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
return false;
}
Expand All @@ -1002,7 +1005,7 @@ bool MMU2::unload() {
command(MMU_CMD_U0);
manage_response(false, true);

ATTN_BUZZ();
mmu2_attn_buzz();

// no active tool
extruder = MMU2_NO_TOOL;
Expand Down