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.
This commit is contained in:
Scott Lahteine 2013-05-02 09:55:15 -07:00
parent a200521eab
commit 0ef54f2f85
2 changed files with 13 additions and 8 deletions

View file

@ -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_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 // #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_XYJERK 20.0 // (mm/sec)
#define DEFAULT_ZJERK 0.4 // (mm/sec) #define DEFAULT_ZJERK 0.4 // (mm/sec)
#define DEFAULT_EJERK 5.0 // (mm/sec) #define DEFAULT_EJERK 5.0 // (mm/sec)

View file

@ -1449,14 +1449,19 @@ void process_commands()
#if defined(LARGE_FLASH) && LARGE_FLASH == true && defined(BEEPER) && BEEPER > -1 #if defined(LARGE_FLASH) && LARGE_FLASH == true && defined(BEEPER) && BEEPER > -1
case 300: // M300 case 300: // M300
{ {
int beepS = 1; int beepS = code_seen('S') ? code_value() : 110;
int beepP = 1000; int beepP = code_seen('P') ? code_value() : 1000;
if(code_seen('S')) beepS = code_value(); if (beepS > 0)
if(code_seen('P')) beepP = code_value(); {
tone(BEEPER, beepS); tone(BEEPER, beepS);
delay(beepP); delay(beepP);
noTone(BEEPER); noTone(BEEPER);
} }
else
{
delay(beepP);
}
}
break; break;
#endif // M300 #endif // M300