Browse Source

Move M300 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
4f14849675
  1. 4
      Marlin/src/Marlin.cpp
  2. 7
      Marlin/src/gcode/gcode.cpp
  3. 13
      Marlin/src/gcode/lcd/M300.cpp

4
Marlin/src/Marlin.cpp

@ -352,10 +352,6 @@ bool pin_is_protected(const int8_t pin) {
return false;
}
#if HAS_BUZZER
#include "gcode/lcd/M300.h"
#endif
#if ENABLED(PIDTEMP)
#include "gcode/config/M301.h"
#endif

7
Marlin/src/gcode/gcode.cpp

@ -121,7 +121,6 @@ extern void gcode_M164();
extern void gcode_M165();
extern void gcode_M240();
extern void gcode_M250();
extern void gcode_M300();
extern void gcode_M301();
extern void gcode_M302();
extern void gcode_M304();
@ -567,10 +566,8 @@ void GcodeSuite::process_next_command() {
#endif
#if HAS_BUZZER
case 300: // M300: Play beep tone
gcode_M300();
break;
#endif // HAS_BUZZER
case 300: M300(); break; // M300: Play beep tone
#endif
#if ENABLED(PIDTEMP)
case 301: // M301: Set hotend PID parameters

13
Marlin/src/gcode/lcd/M300.h → Marlin/src/gcode/lcd/M300.cpp

@ -20,10 +20,19 @@
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_BUZZER
#include "../gcode.h"
#include "../../lcd/ultralcd.h" // i2c-based BUZZ
#include "../../libs/buzzer.h" // Buzzer, if possible
/**
* M300: Play beep sound S<frequency Hz> P<duration ms>
*/
void gcode_M300() {
void GcodeSuite::M300() {
uint16_t const frequency = parser.ushortval('S', 260);
uint16_t duration = parser.ushortval('P', 1000);
@ -32,3 +41,5 @@ void gcode_M300() {
BUZZ(duration, frequency);
}
#endif // HAS_BUZZER
Loading…
Cancel
Save