1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-30 15:26:18 +00:00

Move M300 to cpp

This commit is contained in:
Scott Lahteine 2017-09-17 03:04:52 -05:00
parent 6ed5252884
commit 4f14849675
3 changed files with 14 additions and 10 deletions

View File

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

View File

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

View File

@ -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> * 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 const frequency = parser.ushortval('S', 260);
uint16_t duration = parser.ushortval('P', 1000); uint16_t duration = parser.ushortval('P', 1000);
@ -32,3 +41,5 @@ void gcode_M300() {
BUZZ(duration, frequency); BUZZ(duration, frequency);
} }
#endif // HAS_BUZZER