Browse Source

Make M303 silent when "S0" is sent

If S is left out perhaps it should be silent, but check the spec for
this M code.
Scott Lahteine 11 years ago
parent
commit
0ef54f2f85
2 changed files with 13 additions and 8 deletions
  1. 1
    1
      Marlin/Configuration.h
  2. 12
    7
      Marlin/Marlin_main.cpp

+ 1
- 1
Marlin/Configuration.h View File

@@ -298,7 +298,7 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
298 298
 // #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
299 299
 // #define EXTRUDER_OFFSET_Y {0.0, 5.00}  // (in mm) for each extruder, offset of the hotend on the Y axis
300 300
 
301
-// The speed change that does not require acceleration (i.e. the software might assume it can be done instanteneously)
301
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
302 302
 #define DEFAULT_XYJERK                20.0    // (mm/sec)
303 303
 #define DEFAULT_ZJERK                 0.4     // (mm/sec)
304 304
 #define DEFAULT_EJERK                 5.0    // (mm/sec)

+ 12
- 7
Marlin/Marlin_main.cpp View File

@@ -1449,13 +1449,18 @@ void process_commands()
1449 1449
     #if defined(LARGE_FLASH) && LARGE_FLASH == true && defined(BEEPER) && BEEPER > -1
1450 1450
     case 300: // M300
1451 1451
     {
1452
-      int beepS = 1;
1453
-      int beepP = 1000;
1454
-      if(code_seen('S')) beepS = code_value();
1455
-      if(code_seen('P')) beepP = code_value();
1456
-      tone(BEEPER, beepS);
1457
-      delay(beepP);
1458
-      noTone(BEEPER);
1452
+      int beepS = code_seen('S') ? code_value() : 110;
1453
+      int beepP = code_seen('P') ? code_value() : 1000;
1454
+      if (beepS > 0)
1455
+      {
1456
+        tone(BEEPER, beepS);
1457
+        delay(beepP);
1458
+        noTone(BEEPER);
1459
+      }
1460
+      else
1461
+      {
1462
+        delay(beepP);
1463
+      }
1459 1464
     }
1460 1465
     break;
1461 1466
     #endif // M300

Loading…
Cancel
Save