Browse Source

Use millis for M600 audio feedback interval

Scott Lahteine 10 years ago
parent
commit
5ccb1c9e7d
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      Marlin/Marlin_main.cpp

+ 7
- 2
Marlin/Marlin_main.cpp View File

@@ -4963,10 +4963,14 @@ inline void gcode_M503() {
4963 4963
     disable_e3();
4964 4964
     delay(100);
4965 4965
     LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE);
4966
-    uint8_t cnt = 0;
4966
+    millis_t next_tick = 0;
4967 4967
     while (!lcd_clicked()) {
4968 4968
       #ifndef AUTO_FILAMENT_CHANGE
4969
-        if (++cnt == 0) lcd_quick_feedback(); // every 256th frame till the lcd is clicked
4969
+        millis_t ms = millis();
4970
+        if (ms >= next_tick) {
4971
+          lcd_quick_feedback();
4972
+          next_tick = ms + 2500; // feedback every 2.5s while waiting
4973
+        }
4970 4974
         manage_heater();
4971 4975
         manage_inactivity(true);
4972 4976
         lcd_update();
@@ -4976,6 +4980,7 @@ inline void gcode_M503() {
4976 4980
         st_synchronize();
4977 4981
       #endif
4978 4982
     } // while(!lcd_clicked)
4983
+    lcd_quick_feedback(); // click sound feedback
4979 4984
 
4980 4985
     #ifdef AUTO_FILAMENT_CHANGE
4981 4986
       current_position[E_AXIS]= 0;

Loading…
Cancel
Save