Browse Source

Merge pull request #4954 from thinkyhead/rc_more_debug_homing

Fix buzzer when both i2c and beeper pin are set
Scott Lahteine 8 years ago
parent
commit
9dd56e61bd
3 changed files with 111 additions and 68 deletions
  1. 1
    1
      Marlin/Marlin.h
  2. 108
    66
      Marlin/Marlin_main.cpp
  3. 2
    1
      Marlin/configuration_store.cpp

+ 1
- 1
Marlin/Marlin.h View File

395
 void calculate_volumetric_multipliers();
395
 void calculate_volumetric_multipliers();
396
 
396
 
397
 // Buzzer
397
 // Buzzer
398
-#if HAS_BUZZER && PIN_EXISTS(BEEPER)
398
+#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
399
   #include "buzzer.h"
399
   #include "buzzer.h"
400
 #endif
400
 #endif
401
 
401
 

+ 108
- 66
Marlin/Marlin_main.cpp View File

286
 
286
 
287
 uint8_t marlin_debug_flags = DEBUG_NONE;
287
 uint8_t marlin_debug_flags = DEBUG_NONE;
288
 
288
 
289
-float current_position[NUM_AXIS] = { 0.0 };
290
-static float destination[NUM_AXIS] = { 0.0 };
291
-bool axis_known_position[XYZ] = { false };
292
-bool axis_homed[XYZ] = { false };
289
+/**
290
+ * Cartesian Current Position
291
+ *   Used to track the logical position as moves are queued.
292
+ *   Used by 'line_to_current_position' to do a move after changing it.
293
+ *   Used by 'SYNC_PLAN_POSITION_KINEMATIC' to update 'planner.position'.
294
+ */
295
+float current_position[XYZE] = { 0.0 };
296
+
297
+/**
298
+ * Cartesian Destination
299
+ *   A temporary position, usually applied to 'current_position'.
300
+ *   Set with 'gcode_get_destination' or 'set_destination_to_current'.
301
+ *   'line_to_destination' sets 'current_position' to 'destination'.
302
+ */
303
+static float destination[XYZE] = { 0.0 };
304
+
305
+/**
306
+ * axis_homed
307
+ *   Flags that each linear axis was homed.
308
+ *   XYZ on cartesian, ABC on delta, ABZ on SCARA.
309
+ *
310
+ * axis_known_position
311
+ *   Flags that the position is known in each linear axis. Set when homed.
312
+ *   Cleared whenever a stepper powers off, potentially losing its position.
313
+ */
314
+bool axis_homed[XYZ] = { false }, axis_known_position[XYZ] = { false };
293
 
315
 
316
+/**
317
+ * GCode line number handling. Hosts may opt to include line numbers when
318
+ * sending commands to Marlin, and lines will be checked for sequentiality.
319
+ * M110 S<int> sets the current line number.
320
+ */
294
 static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0;
321
 static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0;
295
 
322
 
323
+/**
324
+ * GCode Command Queue
325
+ * A simple ring buffer of BUFSIZE command strings.
326
+ *
327
+ * Commands are copied into this buffer by the command injectors
328
+ * (immediate, serial, sd card) and they are processed sequentially by
329
+ * the main loop. The process_next_command function parses the next
330
+ * command and hands off execution to individual handler functions.
331
+ */
296
 static char command_queue[BUFSIZE][MAX_CMD_SIZE];
332
 static char command_queue[BUFSIZE][MAX_CMD_SIZE];
297
-static char* current_command, *current_command_args;
298
-static uint8_t cmd_queue_index_r = 0,
299
-               cmd_queue_index_w = 0,
300
-               commands_in_queue = 0;
333
+static uint8_t cmd_queue_index_r = 0, // Ring buffer read position
334
+               cmd_queue_index_w = 0, // Ring buffer write position
335
+               commands_in_queue = 0; // Count of commands in the queue
336
+
337
+/**
338
+ * Current GCode Command
339
+ * When a GCode handler is running, these will be set
340
+ */
341
+static char *current_command,      // The command currently being executed
342
+            *current_command_args, // The address where arguments begin
343
+            *seen_pointer;         // Set by code_seen(), used by the code_value functions
344
+
345
+/**
346
+ * Next Injected Command pointer. NULL if no commands are being injected.
347
+ * Used by Marlin internally to ensure that commands initiated from within
348
+ * are enqueued ahead of any pending serial or sd card commands.
349
+ */
350
+static const char *injected_commands_P = NULL;
301
 
351
 
302
 #if ENABLED(INCH_MODE_SUPPORT)
352
 #if ENABLED(INCH_MODE_SUPPORT)
303
-  float linear_unit_factor = 1.0;
304
-  float volumetric_unit_factor = 1.0;
353
+  float linear_unit_factor = 1.0, volumetric_unit_factor = 1.0;
305
 #endif
354
 #endif
355
+
306
 #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
356
 #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
307
   TempUnit input_temp_units = TEMPUNIT_C;
357
   TempUnit input_temp_units = TEMPUNIT_C;
308
 #endif
358
 #endif
320
   MMM_TO_MMS(HOMING_FEEDRATE_Z), 0
370
   MMM_TO_MMS(HOMING_FEEDRATE_Z), 0
321
 };
371
 };
322
 static float feedrate_mm_s = MMM_TO_MMS(1500.0), saved_feedrate_mm_s;
372
 static float feedrate_mm_s = MMM_TO_MMS(1500.0), saved_feedrate_mm_s;
323
-int feedrate_percentage = 100, saved_feedrate_percentage;
373
+int feedrate_percentage = 100, saved_feedrate_percentage,
374
+    flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100);
324
 
375
 
325
-bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
326
-int flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100);
327
-bool volumetric_enabled = false;
328
-float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DIA);
329
-float volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0);
376
+bool axis_relative_modes[] = AXIS_RELATIVE_MODES,
377
+     volumetric_enabled = false;
378
+float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DIA),
379
+      volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0);
330
 
380
 
331
 // The distance that XYZ has been offset by G92. Reset by G28.
381
 // The distance that XYZ has been offset by G92. Reset by G28.
332
 float position_shift[XYZ] = { 0 };
382
 float position_shift[XYZ] = { 0 };
364
 
414
 
365
 static int serial_count = 0;
415
 static int serial_count = 0;
366
 
416
 
367
-// GCode parameter pointer used by code_seen(), code_value_float(), etc.
368
-static char* seen_pointer;
369
-
370
-// Next Immediate GCode Command pointer. NULL if none.
371
-const char* queued_commands_P = NULL;
372
-
373
 const int sensitive_pins[] = SENSITIVE_PINS; ///< Sensitive pin list for M42
417
 const int sensitive_pins[] = SENSITIVE_PINS; ///< Sensitive pin list for M42
374
 
418
 
375
 // Inactivity shutdown
419
 // Inactivity shutdown
387
 // Buzzer - I2C on the LCD or a BEEPER_PIN
431
 // Buzzer - I2C on the LCD or a BEEPER_PIN
388
 #if ENABLED(LCD_USE_I2C_BUZZER)
432
 #if ENABLED(LCD_USE_I2C_BUZZER)
389
   #define BUZZ(d,f) lcd_buzz(d, f)
433
   #define BUZZ(d,f) lcd_buzz(d, f)
390
-#elif HAS_BUZZER
434
+#elif PIN_EXISTS(BEEPER)
391
   Buzzer buzzer;
435
   Buzzer buzzer;
392
   #define BUZZ(d,f) buzzer.tone(d, f)
436
   #define BUZZ(d,f) buzzer.tone(d, f)
393
 #else
437
 #else
706
  * Inject the next "immediate" command, when possible.
750
  * Inject the next "immediate" command, when possible.
707
  * Return true if any immediate commands remain to inject.
751
  * Return true if any immediate commands remain to inject.
708
  */
752
  */
709
-static bool drain_queued_commands_P() {
710
-  if (queued_commands_P != NULL) {
753
+static bool drain_injected_commands_P() {
754
+  if (injected_commands_P != NULL) {
711
     size_t i = 0;
755
     size_t i = 0;
712
     char c, cmd[30];
756
     char c, cmd[30];
713
-    strncpy_P(cmd, queued_commands_P, sizeof(cmd) - 1);
757
+    strncpy_P(cmd, injected_commands_P, sizeof(cmd) - 1);
714
     cmd[sizeof(cmd) - 1] = '\0';
758
     cmd[sizeof(cmd) - 1] = '\0';
715
     while ((c = cmd[i]) && c != '\n') i++; // find the end of this gcode command
759
     while ((c = cmd[i]) && c != '\n') i++; // find the end of this gcode command
716
     cmd[i] = '\0';
760
     cmd[i] = '\0';
717
     if (enqueue_and_echo_command(cmd)) {   // success?
761
     if (enqueue_and_echo_command(cmd)) {   // success?
718
       if (c)                               // newline char?
762
       if (c)                               // newline char?
719
-        queued_commands_P += i + 1;        // advance to the next command
763
+        injected_commands_P += i + 1;        // advance to the next command
720
       else
764
       else
721
-        queued_commands_P = NULL;          // nul char? no more commands
765
+        injected_commands_P = NULL;          // nul char? no more commands
722
     }
766
     }
723
   }
767
   }
724
-  return (queued_commands_P != NULL);      // return whether any more remain
768
+  return (injected_commands_P != NULL);      // return whether any more remain
725
 }
769
 }
726
 
770
 
727
 /**
771
 /**
728
  * Record one or many commands to run from program memory.
772
  * Record one or many commands to run from program memory.
729
  * Aborts the current queue, if any.
773
  * Aborts the current queue, if any.
730
- * Note: drain_queued_commands_P() must be called repeatedly to drain the commands afterwards
774
+ * Note: drain_injected_commands_P() must be called repeatedly to drain the commands afterwards
731
  */
775
  */
732
 void enqueue_and_echo_commands_P(const char* pgcode) {
776
 void enqueue_and_echo_commands_P(const char* pgcode) {
733
-  queued_commands_P = pgcode;
734
-  drain_queued_commands_P(); // first command executed asap (when possible)
777
+  injected_commands_P = pgcode;
778
+  drain_injected_commands_P(); // first command executed asap (when possible)
735
 }
779
 }
736
 
780
 
737
 void clear_command_queue() {
781
 void clear_command_queue() {
770
   if (_enqueuecommand(cmd, say_ok)) {
814
   if (_enqueuecommand(cmd, say_ok)) {
771
     SERIAL_ECHO_START;
815
     SERIAL_ECHO_START;
772
     SERIAL_ECHOPAIR(MSG_Enqueueing, cmd);
816
     SERIAL_ECHOPAIR(MSG_Enqueueing, cmd);
773
-    SERIAL_ECHOLNPGM("\"");
817
+    SERIAL_CHAR('"');
818
+    SERIAL_EOL;
774
     return true;
819
     return true;
775
   }
820
   }
776
   return false;
821
   return false;
1084
 
1129
 
1085
 /**
1130
 /**
1086
  * Add to the circular command queue the next command from:
1131
  * Add to the circular command queue the next command from:
1087
- *  - The command-injection queue (queued_commands_P)
1132
+ *  - The command-injection queue (injected_commands_P)
1088
  *  - The active serial input (usually USB)
1133
  *  - The active serial input (usually USB)
1089
  *  - The SD card file being actively printed
1134
  *  - The SD card file being actively printed
1090
  */
1135
  */
1091
 void get_available_commands() {
1136
 void get_available_commands() {
1092
 
1137
 
1093
   // if any immediate commands remain, don't get other commands yet
1138
   // if any immediate commands remain, don't get other commands yet
1094
-  if (drain_queued_commands_P()) return;
1139
+  if (drain_injected_commands_P()) return;
1095
 
1140
 
1096
   get_serial_commands();
1141
   get_serial_commands();
1097
 
1142
 
1734
     #endif
1779
     #endif
1735
   }
1780
   }
1736
 
1781
 
1737
-#endif // Z_PROBE_SLED
1738
-#if ENABLED(Z_PROBE_ALLEN_KEY)
1782
+#elif ENABLED(Z_PROBE_ALLEN_KEY)
1783
+
1739
   void run_deploy_moves_script() {
1784
   void run_deploy_moves_script() {
1740
     #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Z)
1785
     #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Z)
1741
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_X
1786
       #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_X
1813
       do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_5_X, Z_PROBE_ALLEN_KEY_DEPLOY_5_Y, Z_PROBE_ALLEN_KEY_DEPLOY_5_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE));
1858
       do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_5_X, Z_PROBE_ALLEN_KEY_DEPLOY_5_Y, Z_PROBE_ALLEN_KEY_DEPLOY_5_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE));
1814
     #endif
1859
     #endif
1815
   }
1860
   }
1861
+
1816
   void run_stow_moves_script() {
1862
   void run_stow_moves_script() {
1817
     #if defined(Z_PROBE_ALLEN_KEY_STOW_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Z)
1863
     #if defined(Z_PROBE_ALLEN_KEY_STOW_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Z)
1818
       #ifndef Z_PROBE_ALLEN_KEY_STOW_1_X
1864
       #ifndef Z_PROBE_ALLEN_KEY_STOW_1_X
1890
       do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_5_X, Z_PROBE_ALLEN_KEY_STOW_5_Y, Z_PROBE_ALLEN_KEY_STOW_5_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE));
1936
       do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_5_X, Z_PROBE_ALLEN_KEY_STOW_5_Y, Z_PROBE_ALLEN_KEY_STOW_5_Z, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE));
1891
     #endif
1937
     #endif
1892
   }
1938
   }
1939
+
1893
 #endif
1940
 #endif
1894
 
1941
 
1895
 #if HAS_BED_PROBE
1942
 #if HAS_BED_PROBE
2094
       if (DEBUGGING(LEVELING)) {
2141
       if (DEBUGGING(LEVELING)) {
2095
         SERIAL_ECHOPAIR(">>> probe_pt(", x);
2142
         SERIAL_ECHOPAIR(">>> probe_pt(", x);
2096
         SERIAL_ECHOPAIR(", ", y);
2143
         SERIAL_ECHOPAIR(", ", y);
2097
-        SERIAL_ECHOPAIR(", ", stow ? "stow" : "no stow");
2098
-        SERIAL_CHAR(')');
2099
-        SERIAL_EOL;
2144
+        SERIAL_ECHOPAIR(", ", stow ? "" : "no ");
2145
+        SERIAL_ECHOLNPGM("stow)");
2100
         DEBUG_POS("", current_position);
2146
         DEBUG_POS("", current_position);
2101
       }
2147
       }
2102
     #endif
2148
     #endif
2647
 void unknown_command_error() {
2693
 void unknown_command_error() {
2648
   SERIAL_ECHO_START;
2694
   SERIAL_ECHO_START;
2649
   SERIAL_ECHOPAIR(MSG_UNKNOWN_COMMAND, current_command);
2695
   SERIAL_ECHOPAIR(MSG_UNKNOWN_COMMAND, current_command);
2650
-  SERIAL_ECHOLNPGM("\"");
2696
+  SERIAL_CHAR('"');
2697
+  SERIAL_EOL;
2651
 }
2698
 }
2652
 
2699
 
2653
 #if ENABLED(HOST_KEEPALIVE_FEATURE)
2700
 #if ENABLED(HOST_KEEPALIVE_FEATURE)
6714
     delay(100);
6761
     delay(100);
6715
 
6762
 
6716
     #if HAS_BUZZER
6763
     #if HAS_BUZZER
6717
-      millis_t next_tick = 0;
6764
+      millis_t next_buzz = 0;
6718
     #endif
6765
     #endif
6719
 
6766
 
6720
     // Wait for filament insert by user and press button
6767
     // Wait for filament insert by user and press button
6723
     while (!lcd_clicked()) {
6770
     while (!lcd_clicked()) {
6724
       #if HAS_BUZZER
6771
       #if HAS_BUZZER
6725
         millis_t ms = millis();
6772
         millis_t ms = millis();
6726
-        if (ms >= next_tick) {
6773
+        if (ms >= next_buzz) {
6727
           BUZZ(300, 2000);
6774
           BUZZ(300, 2000);
6728
-          next_tick = ms + 2500; // Beep every 2.5s while waiting
6775
+          next_buzz = ms + 2500; // Beep every 2.5s while waiting
6729
         }
6776
         }
6730
       #endif
6777
       #endif
6731
       idle(true);
6778
       idle(true);
8855
 
8902
 
8856
     float mm_of_travel = HYPOT(angular_travel * radius, fabs(linear_travel));
8903
     float mm_of_travel = HYPOT(angular_travel * radius, fabs(linear_travel));
8857
     if (mm_of_travel < 0.001) return;
8904
     if (mm_of_travel < 0.001) return;
8905
+
8858
     uint16_t segments = floor(mm_of_travel / (MM_PER_ARC_SEGMENT));
8906
     uint16_t segments = floor(mm_of_travel / (MM_PER_ARC_SEGMENT));
8859
     if (segments == 0) segments = 1;
8907
     if (segments == 0) segments = 1;
8860
 
8908
 
8861
-    float theta_per_segment = angular_travel / segments;
8862
-    float linear_per_segment = linear_travel / segments;
8863
-    float extruder_per_segment = extruder_travel / segments;
8864
-
8865
     /**
8909
     /**
8866
      * Vector rotation by transformation matrix: r is the original vector, r_T is the rotated vector,
8910
      * Vector rotation by transformation matrix: r is the original vector, r_T is the rotated vector,
8867
      * and phi is the angle of rotation. Based on the solution approach by Jens Geisler.
8911
      * and phi is the angle of rotation. Based on the solution approach by Jens Geisler.
8868
      *     r_T = [cos(phi) -sin(phi);
8912
      *     r_T = [cos(phi) -sin(phi);
8869
-     *            sin(phi)  cos(phi] * r ;
8913
+     *            sin(phi)  cos(phi)] * r ;
8870
      *
8914
      *
8871
      * For arc generation, the center of the circle is the axis of rotation and the radius vector is
8915
      * For arc generation, the center of the circle is the axis of rotation and the radius vector is
8872
      * defined from the circle center to the initial position. Each line segment is formed by successive
8916
      * defined from the circle center to the initial position. Each line segment is formed by successive
8889
      * This is important when there are successive arc motions.
8933
      * This is important when there are successive arc motions.
8890
      */
8934
      */
8891
     // Vector rotation matrix values
8935
     // Vector rotation matrix values
8892
-    float cos_T = 1 - 0.5 * sq(theta_per_segment); // Small angle approximation
8893
-    float sin_T = theta_per_segment;
8894
-
8895
-    float arc_target[NUM_AXIS];
8896
-    float sin_Ti, cos_Ti, r_new_Y;
8897
-    uint16_t i;
8898
-    int8_t count = 0;
8936
+    float arc_target[XYZE],
8937
+          theta_per_segment = angular_travel / segments,
8938
+          linear_per_segment = linear_travel / segments,
8939
+          extruder_per_segment = extruder_travel / segments,
8940
+          sin_T = theta_per_segment,
8941
+          cos_T = 1 - 0.5 * sq(theta_per_segment); // Small angle approximation
8899
 
8942
 
8900
     // Initialize the linear axis
8943
     // Initialize the linear axis
8901
     arc_target[Z_AXIS] = current_position[Z_AXIS];
8944
     arc_target[Z_AXIS] = current_position[Z_AXIS];
8907
 
8950
 
8908
     millis_t next_idle_ms = millis() + 200UL;
8951
     millis_t next_idle_ms = millis() + 200UL;
8909
 
8952
 
8910
-    for (i = 1; i < segments; i++) { // Iterate (segments-1) times
8953
+    int8_t count = 0;
8954
+    for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times
8911
 
8955
 
8912
       thermalManager.manage_heater();
8956
       thermalManager.manage_heater();
8913
-      millis_t now = millis();
8914
-      if (ELAPSED(now, next_idle_ms)) {
8915
-        next_idle_ms = now + 200UL;
8957
+      if (ELAPSED(millis(), next_idle_ms)) {
8958
+        next_idle_ms = millis() + 200UL;
8916
         idle();
8959
         idle();
8917
       }
8960
       }
8918
 
8961
 
8919
       if (++count < N_ARC_CORRECTION) {
8962
       if (++count < N_ARC_CORRECTION) {
8920
         // Apply vector rotation matrix to previous r_X / 1
8963
         // Apply vector rotation matrix to previous r_X / 1
8921
-        r_new_Y = r_X * sin_T + r_Y * cos_T;
8964
+        float r_new_Y = r_X * sin_T + r_Y * cos_T;
8922
         r_X = r_X * cos_T - r_Y * sin_T;
8965
         r_X = r_X * cos_T - r_Y * sin_T;
8923
         r_Y = r_new_Y;
8966
         r_Y = r_new_Y;
8924
       }
8967
       }
8927
         // Compute exact location by applying transformation matrix from initial radius vector(=-offset).
8970
         // Compute exact location by applying transformation matrix from initial radius vector(=-offset).
8928
         // To reduce stuttering, the sin and cos could be computed at different times.
8971
         // To reduce stuttering, the sin and cos could be computed at different times.
8929
         // For now, compute both at the same time.
8972
         // For now, compute both at the same time.
8930
-        cos_Ti = cos(i * theta_per_segment);
8931
-        sin_Ti = sin(i * theta_per_segment);
8973
+        float cos_Ti = cos(i * theta_per_segment),
8974
+              sin_Ti = sin(i * theta_per_segment);
8932
         r_X = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti;
8975
         r_X = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti;
8933
         r_Y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti;
8976
         r_Y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti;
8934
         count = 0;
8977
         count = 0;
9198
 
9241
 
9199
 float calculate_volumetric_multiplier(float diameter) {
9242
 float calculate_volumetric_multiplier(float diameter) {
9200
   if (!volumetric_enabled || diameter == 0) return 1.0;
9243
   if (!volumetric_enabled || diameter == 0) return 1.0;
9201
-  float d2 = diameter * 0.5;
9202
-  return 1.0 / (M_PI * d2 * d2);
9244
+  return 1.0 / (M_PI * diameter * 0.5 * diameter * 0.5);
9203
 }
9245
 }
9204
 
9246
 
9205
 void calculate_volumetric_multipliers() {
9247
 void calculate_volumetric_multipliers() {
9425
     print_job_timer.tick();
9467
     print_job_timer.tick();
9426
   #endif
9468
   #endif
9427
 
9469
 
9428
-  #if HAS_BUZZER && PIN_EXISTS(BEEPER)
9470
+  #if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
9429
     buzzer.tick();
9471
     buzzer.tick();
9430
   #endif
9472
   #endif
9431
 }
9473
 }

+ 2
- 1
Marlin/configuration_store.cpp View File

383
 
383
 
384
   //  SERIAL_ECHOPAIR("Version: [", ver);
384
   //  SERIAL_ECHOPAIR("Version: [", ver);
385
   //  SERIAL_ECHOPAIR("] Stored version: [", stored_ver);
385
   //  SERIAL_ECHOPAIR("] Stored version: [", stored_ver);
386
-  //  SERIAL_ECHOLNPGM("]");
386
+  //  SERIAL_CHAR(']');
387
+  //  SERIAL_EOL;
387
 
388
 
388
   if (strncmp(version, stored_ver, 3) != 0) {
389
   if (strncmp(version, stored_ver, 3) != 0) {
389
     Config_ResetDefault();
390
     Config_ResetDefault();

Loading…
Cancel
Save