Browse Source

🐛 Fix MMU2 buzz (#23943)

Followup to 89a9c3a391
ellensp 2 years ago
parent
commit
f1471c1549
No account linked to committer's email address
1 changed files with 14 additions and 11 deletions
  1. 14
    11
      Marlin/src/feature/mmu/mmu2.cpp

+ 14
- 11
Marlin/src/feature/mmu/mmu2.cpp View File

143
   #define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE)
143
   #define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE)
144
 #endif
144
 #endif
145
 
145
 
146
-inline void ATTN_BUZZ(const bool two=false) { BUZZ(200, 404); if (two) { BUZZ(10, 0); BUZZ(200, 404); } }
146
+void mmu2_attn_buzz(const bool two=false) {
147
+  BUZZ(200, 404);
148
+  if (two) { BUZZ(10, 0); BUZZ(200, 404); }
149
+}
147
 
150
 
148
 void MMU2::mmu_loop() {
151
 void MMU2::mmu_loop() {
149
 
152
 
819
       }
822
       }
820
 
823
 
821
       LCD_MESSAGE(MSG_MMU2_RESUMING);
824
       LCD_MESSAGE(MSG_MMU2_RESUMING);
822
-      ATTN_BUZZ(true);
825
+      mmu2_attn_buzz(true);
823
 
826
 
824
       #pragma GCC diagnostic push
827
       #pragma GCC diagnostic push
825
       #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
828
       #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
901
 
904
 
902
   command(MMU_CMD_L0 + index);
905
   command(MMU_CMD_L0 + index);
903
   manage_response(false, false);
906
   manage_response(false, false);
904
-  ATTN_BUZZ();
907
+  mmu2_attn_buzz();
905
 }
908
 }
906
 
909
 
907
 /**
910
 /**
912
   if (!_enabled) return false;
915
   if (!_enabled) return false;
913
 
916
 
914
   if (thermalManager.tooColdToExtrude(active_extruder)) {
917
   if (thermalManager.tooColdToExtrude(active_extruder)) {
915
-    ATTN_BUZZ();
918
+    mmu2_attn_buzz();
916
     LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
919
     LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
917
     return false;
920
     return false;
918
   }
921
   }
927
     extruder = index;
930
     extruder = index;
928
     active_extruder = 0;
931
     active_extruder = 0;
929
     load_to_nozzle();
932
     load_to_nozzle();
930
-    ATTN_BUZZ();
933
+    mmu2_attn_buzz();
931
   }
934
   }
932
   return success;
935
   return success;
933
 }
936
 }
948
   if (!_enabled) return false;
951
   if (!_enabled) return false;
949
 
952
 
950
   if (thermalManager.tooColdToExtrude(active_extruder)) {
953
   if (thermalManager.tooColdToExtrude(active_extruder)) {
951
-    ATTN_BUZZ();
954
+    mmu2_attn_buzz();
952
     LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
955
     LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
953
     return false;
956
     return false;
954
   }
957
   }
964
 
967
 
965
   if (recover)  {
968
   if (recover)  {
966
     LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
969
     LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
967
-    ATTN_BUZZ();
970
+    mmu2_attn_buzz();
968
     TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
971
     TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
969
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover")));
972
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover")));
970
     TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
973
     TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
971
-    ATTN_BUZZ(true);
974
+    mmu2_attn_buzz(true);
972
 
975
 
973
     command(MMU_CMD_R0);
976
     command(MMU_CMD_R0);
974
     manage_response(false, false);
977
     manage_response(false, false);
981
 
984
 
982
   set_runout_valid(false);
985
   set_runout_valid(false);
983
 
986
 
984
-  ATTN_BUZZ();
987
+  mmu2_attn_buzz();
985
 
988
 
986
   stepper.disable_extruder();
989
   stepper.disable_extruder();
987
 
990
 
996
   if (!_enabled) return false;
999
   if (!_enabled) return false;
997
 
1000
 
998
   if (thermalManager.tooColdToExtrude(active_extruder)) {
1001
   if (thermalManager.tooColdToExtrude(active_extruder)) {
999
-    ATTN_BUZZ();
1002
+    mmu2_attn_buzz();
1000
     LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
1003
     LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
1001
     return false;
1004
     return false;
1002
   }
1005
   }
1007
   command(MMU_CMD_U0);
1010
   command(MMU_CMD_U0);
1008
   manage_response(false, true);
1011
   manage_response(false, true);
1009
 
1012
 
1010
-  ATTN_BUZZ();
1013
+  mmu2_attn_buzz();
1011
 
1014
 
1012
   // no active tool
1015
   // no active tool
1013
   extruder = MMU2_NO_TOOL;
1016
   extruder = MMU2_NO_TOOL;

Loading…
Cancel
Save