Browse Source

Merge pull request #434 from DDRBoxman/Marlin_v1

Add support for M300: Play beep sound
ErikZalm 11 years ago
parent
commit
86867928ac
2 changed files with 26 additions and 1 deletions
  1. 15
    0
      Marlin/Marlin_main.cpp
  2. 11
    1
      Marlin/pins.h

+ 15
- 0
Marlin/Marlin_main.cpp View File

@@ -117,6 +117,7 @@
117 117
 // M220 S<factor in percent>- set speed factor override percentage
118 118
 // M221 S<factor in percent>- set extrude factor override percentage
119 119
 // M240 - Trigger a camera to take a photograph
120
+// M300 - Play beepsound S<frequency Hz> P<duration ms>
120 121
 // M301 - Set PID parameters P I and D
121 122
 // M302 - Allow cold extrudes
122 123
 // M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
@@ -1431,6 +1432,20 @@ void process_commands()
1431 1432
       }
1432 1433
     }
1433 1434
     break;
1435
+    
1436
+    #if defined(LARGE_FLASH) && LARGE_FLASH == true && defined(BEEPER) && BEEPER > -1
1437
+    case 300: // M300
1438
+    {
1439
+      int beepS = 1;
1440
+      int beepP = 1000;
1441
+      if(code_seen('S')) beepS = code_value();
1442
+      if(code_seen('P')) beepP = code_value();
1443
+      tone(BEEPER, beepS);
1444
+      delay(beepP);
1445
+      noTone(BEEPER);
1446
+    }
1447
+    break;
1448
+    #endif // M300
1434 1449
 
1435 1450
     #ifdef PIDTEMP
1436 1451
     case 301: // M301

+ 11
- 1
Marlin/pins.h View File

@@ -321,6 +321,8 @@
321 321
 
322 322
 #if MOTHERBOARD == 33 || MOTHERBOARD == 34
323 323
 
324
+#define LARGE_FLASH        true
325
+
324 326
 #define X_STEP_PIN         54
325 327
 #define X_DIR_PIN          55
326 328
 #define X_ENABLE_PIN       38
@@ -789,6 +791,8 @@
789 791
  #endif
790 792
 #endif
791 793
 
794
+#define LARGE_FLASH true
795
+
792 796
 #define X_STEP_PIN 25
793 797
 #define X_DIR_PIN 23
794 798
 #define X_MIN_PIN 22
@@ -924,6 +928,8 @@
924 928
  #endif
925 929
 #endif
926 930
 
931
+#define LARGE_FLASH true
932
+
927 933
 #define X_STEP_PIN 25
928 934
 #define X_DIR_PIN 23
929 935
 #define X_MIN_PIN 15
@@ -1080,6 +1086,8 @@
1080 1086
 #error Oops!  Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
1081 1087
 #endif
1082 1088
 
1089
+#define LARGE_FLASH        true
1090
+
1083 1091
 #define X_STEP_PIN          0
1084 1092
 #define X_DIR_PIN           1
1085 1093
 #define X_ENABLE_PIN       39
@@ -1413,6 +1421,8 @@
1413 1421
 #error Oops!  Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu.
1414 1422
 #endif
1415 1423
 
1424
+#define LARGE_FLASH true
1425
+
1416 1426
 #define X_STEP_PIN 37
1417 1427
 #define X_DIR_PIN 48
1418 1428
 #define X_MIN_PIN 12
@@ -1488,7 +1498,7 @@
1488 1498
  #endif
1489 1499
 
1490 1500
 
1491
-
1501
+#define LARGE_FLASH        true
1492 1502
 
1493 1503
 #define X_STEP_PIN         26
1494 1504
 #define X_DIR_PIN          28

Loading…
Cancel
Save