Browse Source

Move M300 to cpp

Scott Lahteine 8 years ago
parent
commit
4f14849675
3 changed files with 14 additions and 10 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 2
    5
      Marlin/src/gcode/gcode.cpp
  3. 12
    1
      Marlin/src/gcode/lcd/M300.cpp

+ 0
- 4
Marlin/src/Marlin.cpp View File

352
   return false;
352
   return false;
353
 }
353
 }
354
 
354
 
355
-#if HAS_BUZZER
356
-  #include "gcode/lcd/M300.h"
357
-#endif
358
-
359
 #if ENABLED(PIDTEMP)
355
 #if ENABLED(PIDTEMP)
360
   #include "gcode/config/M301.h"
356
   #include "gcode/config/M301.h"
361
 #endif
357
 #endif

+ 2
- 5
Marlin/src/gcode/gcode.cpp View File

121
 extern void gcode_M165();
121
 extern void gcode_M165();
122
 extern void gcode_M240();
122
 extern void gcode_M240();
123
 extern void gcode_M250();
123
 extern void gcode_M250();
124
-extern void gcode_M300();
125
 extern void gcode_M301();
124
 extern void gcode_M301();
126
 extern void gcode_M302();
125
 extern void gcode_M302();
127
 extern void gcode_M304();
126
 extern void gcode_M304();
567
       #endif
566
       #endif
568
 
567
 
569
       #if HAS_BUZZER
568
       #if HAS_BUZZER
570
-        case 300: // M300: Play beep tone
571
-          gcode_M300();
572
-          break;
573
-      #endif // HAS_BUZZER
569
+        case 300: M300(); break;  // M300: Play beep tone
570
+      #endif
574
 
571
 
575
       #if ENABLED(PIDTEMP)
572
       #if ENABLED(PIDTEMP)
576
         case 301: // M301: Set hotend PID parameters
573
         case 301: // M301: Set hotend PID parameters

Marlin/src/gcode/lcd/M300.h → Marlin/src/gcode/lcd/M300.cpp View File

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if HAS_BUZZER
26
+
27
+#include "../gcode.h"
28
+
29
+#include "../../lcd/ultralcd.h" // i2c-based BUZZ
30
+#include "../../libs/buzzer.h"  // Buzzer, if possible
31
+
23
 /**
32
 /**
24
  * M300: Play beep sound S<frequency Hz> P<duration ms>
33
  * M300: Play beep sound S<frequency Hz> P<duration ms>
25
  */
34
  */
26
-void gcode_M300() {
35
+void GcodeSuite::M300() {
27
   uint16_t const frequency = parser.ushortval('S', 260);
36
   uint16_t const frequency = parser.ushortval('S', 260);
28
   uint16_t duration = parser.ushortval('P', 1000);
37
   uint16_t duration = parser.ushortval('P', 1000);
29
 
38
 
32
 
41
 
33
   BUZZ(duration, frequency);
42
   BUZZ(duration, frequency);
34
 }
43
 }
44
+
45
+#endif // HAS_BUZZER

Loading…
Cancel
Save