From 0ef54f2f85609fbdad384ac6111899a385ea5f6e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 2 May 2013 09:55:15 -0700 Subject: [PATCH] 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. --- Marlin/Configuration.h | 2 +- Marlin/Marlin_main.cpp | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d710e3756..1cb7ea2de 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -298,7 +298,7 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th // #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis // #define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis -// The speed change that does not require acceleration (i.e. the software might assume it can be done instanteneously) +// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) #define DEFAULT_XYJERK 20.0 // (mm/sec) #define DEFAULT_ZJERK 0.4 // (mm/sec) #define DEFAULT_EJERK 5.0 // (mm/sec) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 04c3794fa..5917cbd08 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1449,13 +1449,18 @@ void process_commands() #if defined(LARGE_FLASH) && LARGE_FLASH == true && defined(BEEPER) && BEEPER > -1 case 300: // M300 { - int beepS = 1; - int beepP = 1000; - if(code_seen('S')) beepS = code_value(); - if(code_seen('P')) beepP = code_value(); - tone(BEEPER, beepS); - delay(beepP); - noTone(BEEPER); + int beepS = code_seen('S') ? code_value() : 110; + int beepP = code_seen('P') ? code_value() : 1000; + if (beepS > 0) + { + tone(BEEPER, beepS); + delay(beepP); + noTone(BEEPER); + } + else + { + delay(beepP); + } } break; #endif // M300