Merge pull request #3880 from wavexx/m300_s0_m312
Make M300 S0 pause like Marlin (3.12)
This commit is contained in:
commit
54356f8d97
2 changed files with 13 additions and 8 deletions
|
@ -7366,8 +7366,7 @@ Sigma_Exit:
|
||||||
break;
|
break;
|
||||||
#endif // NUM_SERVOS > 0
|
#endif // NUM_SERVOS > 0
|
||||||
|
|
||||||
#if (LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER)))
|
#if (LARGE_FLASH == true && BEEPER > 0 )
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
### M300 - Play tone <a href="https://reprap.org/wiki/G-code#M300:_Play_beep_sound">M300: Play beep sound</a>
|
### M300 - Play tone <a href="https://reprap.org/wiki/G-code#M300:_Play_beep_sound">M300: Play beep sound</a>
|
||||||
In Prusa Firmware the defaults are `100Hz` and `1000ms`, so that `M300` without parameters will beep for a second.
|
In Prusa Firmware the defaults are `100Hz` and `1000ms`, so that `M300` without parameters will beep for a second.
|
||||||
|
@ -7381,12 +7380,19 @@ Sigma_Exit:
|
||||||
*/
|
*/
|
||||||
case 300: // M300
|
case 300: // M300
|
||||||
{
|
{
|
||||||
uint16_t beepS = code_seen('S') ? code_value() : 0;
|
|
||||||
uint16_t beepP = code_seen('P') ? code_value() : 1000;
|
uint16_t beepP = code_seen('P') ? code_value() : 1000;
|
||||||
#if BEEPER > 0
|
uint16_t beepS;
|
||||||
if (beepP > 0)
|
if (!code_seen('S'))
|
||||||
Sound_MakeCustom(beepP,beepS,false);
|
beepS = 0;
|
||||||
#endif
|
else {
|
||||||
|
beepS = code_value();
|
||||||
|
if (!beepS) {
|
||||||
|
// handle S0 as a pause
|
||||||
|
_delay(beepP);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Sound_MakeCustom(beepP, beepS, false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif // M300
|
#endif // M300
|
||||||
|
|
|
@ -84,7 +84,6 @@ void Sound_MakeCustom(uint16_t ms,uint16_t tone_,bool critical){
|
||||||
WRITE(BEEPER, HIGH);
|
WRITE(BEEPER, HIGH);
|
||||||
_delay(ms);
|
_delay(ms);
|
||||||
WRITE(BEEPER, LOW);
|
WRITE(BEEPER, LOW);
|
||||||
_delay(ms);
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
_tone(BEEPER, tone_);
|
_tone(BEEPER, tone_);
|
||||||
|
|
Loading…
Reference in a new issue