Przeglądaj źródła

Rename BEEPER to BEEPER_PIN

For consistency with other pins, allowing use of `PIN_EXISTS` macro.
Scott Lahteine 8 lat temu
rodzic
commit
94a796c8cc

+ 1
- 1
Marlin/Conditionals.h Wyświetl plik

@@ -512,7 +512,7 @@
512 512
     #define WRITE_FAN(v) WRITE(FAN_PIN, v)
513 513
   #endif
514 514
 
515
-  #define HAS_BUZZER ((defined(BEEPER) && BEEPER >= 0) || defined(LCD_USE_I2C_BUZZER))
515
+  #define HAS_BUZZER (PIN_EXISTS(BEEPER) || defined(LCD_USE_I2C_BUZZER))
516 516
 
517 517
   #if defined(NUM_SERVOS) && NUM_SERVOS > 0
518 518
     #ifndef X_ENDSTOP_SERVO_NR

+ 7
- 7
Marlin/buzzer.cpp Wyświetl plik

@@ -7,22 +7,22 @@
7 7
     if (freq > 0) {
8 8
       #if ENABLED(LCD_USE_I2C_BUZZER)
9 9
         lcd_buzz(duration, freq);
10
-      #elif defined(BEEPER) && BEEPER >= 0 // on-board buzzers have no further condition
11
-        SET_OUTPUT(BEEPER);
10
+      #elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition
11
+        SET_OUTPUT(BEEPER_PIN);
12 12
         #ifdef SPEAKER // a speaker needs a AC ore a pulsed DC
13
-          //tone(BEEPER, freq, duration); // needs a PWMable pin
13
+          //tone(BEEPER_PIN, freq, duration); // needs a PWMable pin
14 14
           unsigned int delay = 1000000 / freq / 2;
15 15
           int i = duration * freq / 1000;
16 16
           while (i--) {
17
-            WRITE(BEEPER,HIGH);
17
+            WRITE(BEEPER_PIN, HIGH);
18 18
             delayMicroseconds(delay);
19
-            WRITE(BEEPER,LOW);
19
+            WRITE(BEEPER_PIN, LOW);
20 20
             delayMicroseconds(delay);
21 21
            }
22 22
         #else // buzzer has its own resonator - needs a DC
23
-          WRITE(BEEPER, HIGH);
23
+          WRITE(BEEPER_PIN, HIGH);
24 24
           delay(duration);
25
-          WRITE(BEEPER, LOW);
25
+          WRITE(BEEPER_PIN, LOW);
26 26
         #endif
27 27
       #else
28 28
         delay(duration);

+ 3
- 3
Marlin/pins_3DRAG.h Wyświetl plik

@@ -30,8 +30,8 @@
30 30
 #define HEATER_BED_PIN     9    // BED
31 31
 
32 32
 #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
33
-  #undef BEEPER
34
-  #define BEEPER -1
33
+  #undef BEEPER_PIN
34
+  #define BEEPER_PIN -1
35 35
 
36 36
   #undef LCD_PINS_RS
37 37
   #undef LCD_PINS_ENABLE
@@ -56,6 +56,6 @@
56 56
 
57 57
 #else
58 58
 
59
-  #define BEEPER 33
59
+  #define BEEPER_PIN 33
60 60
 
61 61
 #endif // ULTRA_LCD && NEWPANEL

+ 2
- 1
Marlin/pins_AZTEEG_X3.h Wyświetl plik

@@ -8,7 +8,8 @@
8 8
 
9 9
 #if ENABLED(VIKI2) || ENABLED(miniVIKI)
10 10
 
11
- #define BEEPER 33
11
+ #define BEEPER_PIN 33
12
+
12 13
  // Pins for DOGM SPI LCD Support
13 14
  #define DOGLCD_A0  31 
14 15
  #define DOGLCD_CS  32 

+ 2
- 2
Marlin/pins_AZTEEG_X3_PRO.h Wyświetl plik

@@ -6,7 +6,7 @@
6 6
 
7 7
 #undef FAN_PIN
8 8
 #define FAN_PIN             6 //Part Cooling System
9
-#define BEEPER             33
9
+#define BEEPER_PIN         33
10 10
 #define CONTROLLERFAN_PIN   4 //Pin used for the fan to cool motherboard (-1 to disable)
11 11
 //Fans/Water Pump to cool the hotend cool side.
12 12
 #define EXTRUDER_0_AUTO_FAN_PIN   5
@@ -97,7 +97,7 @@
97 97
 //LCD Pins//
98 98
 
99 99
  #if ENABLED(VIKI2) || ENABLED(miniVIKI)
100
-  #define BEEPER           33
100
+  #define BEEPER_PIN       33
101 101
  // Pins for DOGM SPI LCD Support
102 102
   #define DOGLCD_A0        44
103 103
   #define DOGLCD_CS        45

+ 1
- 1
Marlin/pins_ELEFU_3.h Wyświetl plik

@@ -53,7 +53,7 @@
53 53
 #define TEMP_2_PIN         1  //ANALOG NUMBERING
54 54
 #define TEMP_BED_PIN       0  //ANALOG NUMBERING
55 55
 
56
-#define BEEPER             36
56
+#define BEEPER_PIN         36
57 57
 
58 58
 #define KILL_PIN           -1
59 59
 

+ 1
- 1
Marlin/pins_GEN7_CUSTOM.h Wyświetl plik

@@ -56,7 +56,7 @@
56 56
 //#define TX_ENABLE_PIN       12
57 57
 //#define RX_ENABLE_PIN       13
58 58
 
59
-#define BEEPER -1
59
+#define BEEPER_PIN -1
60 60
 #define SDCARDDETECT -1
61 61
 #define SUICIDE_PIN -1    //has to be defined; otherwise Power_off doesn't work
62 62
 

+ 1
- 1
Marlin/pins_MEGACONTROLLER.h Wyświetl plik

@@ -89,7 +89,7 @@
89 89
 #endif
90 90
 
91 91
 #ifdef MINIPANEL
92
-    #define BEEPER 46
92
+    #define BEEPER_PIN 46
93 93
     // Pins for DOGM SPI LCD Support
94 94
     #define DOGLCD_A0  47
95 95
     #define DOGLCD_CS  45

+ 1
- 1
Marlin/pins_MEGATRONICS.h Wyświetl plik

@@ -58,7 +58,7 @@
58 58
 #define HEATER_BED_PIN     10   // BED
59 59
 #define TEMP_BED_PIN       14   // ANALOG NUMBERING
60 60
 
61
-#define BEEPER             33   // AUX-4
61
+#define BEEPER_PIN         33   // AUX-4
62 62
 
63 63
 #if defined(ULTRA_LCD) && defined(NEWPANEL)
64 64
 

+ 1
- 1
Marlin/pins_MEGATRONICS_2.h Wyświetl plik

@@ -74,7 +74,7 @@
74 74
   #define TEMP_BED_PIN 14 // ANALOG NUMBERING
75 75
 #endif
76 76
 
77
-#define BEEPER 64
77
+#define BEEPER_PIN 64
78 78
 
79 79
 
80 80
 #define LCD_PINS_RS 14

+ 1
- 1
Marlin/pins_MEGATRONICS_3.h Wyświetl plik

@@ -76,7 +76,7 @@
76 76
 #define TEMP_2_PIN   (TEMP_SENSOR_2 == -1 ?   9 : 12) // ANALOG NUMBERING
77 77
 #define TEMP_BED_PIN (TEMP_SENSOR_BED == -1 ? 8 : 14) // ANALOG NUMBERING
78 78
 
79
-#define BEEPER 61
79
+#define BEEPER_PIN 61
80 80
 
81 81
 #define LCD_PINS_RS 32
82 82
 #define LCD_PINS_ENABLE 31

+ 2
- 2
Marlin/pins_MINIRAMBO.h Wyświetl plik

@@ -91,8 +91,8 @@
91 91
 #if ENABLED(ULTRA_LCD)
92 92
   #define KILL_PIN 32
93 93
   #if ENABLED(NEWPANEL)
94
-   //arduino pin which triggers an piezzo beeper
95
-    #define BEEPER 84      // Beeper on AUX-4
94
+
95
+    #define BEEPER_PIN 84      // Beeper on AUX-4
96 96
     #define LCD_PINS_RS 82
97 97
     #define LCD_PINS_ENABLE 18
98 98
     #define LCD_PINS_D4 19

+ 1
- 2
Marlin/pins_MINITRONICS.h Wyświetl plik

@@ -59,8 +59,7 @@
59 59
 #define HEATER_BED_PIN 3 // BED
60 60
 #define TEMP_BED_PIN 6 // ANALOG NUMBERING
61 61
 
62
-#define BEEPER -1
63
-
62
+#define BEEPER_PIN -1
64 63
 
65 64
 #define LCD_PINS_RS -1
66 65
 #define LCD_PINS_ENABLE -1

+ 2
- 2
Marlin/pins_PRINTRBOARD.h Wyświetl plik

@@ -79,7 +79,7 @@
79 79
 
80 80
 #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
81 81
   //we have no buzzer installed
82
-  #define BEEPER -1
82
+  #define BEEPER_PIN -1
83 83
   //LCD Pins
84 84
   #if ENABLED(LCD_I2C_PANELOLU2)
85 85
     #define BTN_EN1 27  //RX1 - fastio.h pin mapping 27
@@ -92,7 +92,7 @@
92 92
 #endif // ULTRA_LCD && NEWPANEL
93 93
 
94 94
 #if ENABLED(VIKI2) || ENABLED(miniVIKI)
95
- #define BEEPER 32 //FastIO
95
+ #define BEEPER_PIN 32 //FastIO
96 96
  // Pins for DOGM SPI LCD Support
97 97
  #define DOGLCD_A0  42 //Non-FastIO
98 98
  #define DOGLCD_CS  43 //Non-FastIO

+ 7
- 5
Marlin/pins_RAMBO.h Wyświetl plik

@@ -112,8 +112,9 @@
112 112
 #if ENABLED(ULTRA_LCD)
113 113
   #define KILL_PIN 80
114 114
   #if ENABLED(NEWPANEL)
115
-   //arduino pin which triggers an piezzo beeper
116
-    #define BEEPER 79      // Beeper on AUX-4
115
+
116
+    #define BEEPER_PIN 79      // Beeper on AUX-4
117
+
117 118
     #define LCD_PINS_RS 70
118 119
     #define LCD_PINS_ENABLE 71
119 120
     #define LCD_PINS_D4 72
@@ -133,8 +134,9 @@
133 134
     #define SDCARDDETECT 81    // Ramps does not use this port
134 135
 
135 136
   #else //!NEWPANEL - old style panel with shift register
136
-    //arduino pin witch triggers an piezzo beeper
137
-    #define BEEPER 33    No Beeper added
137
+
138
+    #define BEEPER_PIN 33    // No Beeper added
139
+
138 140
     //buttons are attached to a shift register
139 141
     // Not wired this yet
140 142
     // #define SHIFT_CLK 38
@@ -165,7 +167,7 @@
165 167
 #endif // ULTRA_LCD
166 168
 
167 169
 #if ENABLED(VIKI2) || ENABLED(miniVIKI)
168
- #define BEEPER 44
170
+ #define BEEPER_PIN 44
169 171
  // Pins for DOGM SPI LCD Support
170 172
  #define DOGLCD_A0  70 
171 173
  #define DOGLCD_CS  71 

+ 8
- 7
Marlin/pins_RAMPS_13.h Wyświetl plik

@@ -159,7 +159,7 @@
159 159
     #endif
160 160
 
161 161
     #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
162
-      #define BEEPER 37
162
+      #define BEEPER_PIN 37
163 163
 
164 164
       #define BTN_EN1 31
165 165
       #define BTN_EN2 33
@@ -186,12 +186,12 @@
186 186
       #define SDCARDDETECT 49
187 187
       #define LCD_SDSS 53
188 188
       #define KILL_PIN 41
189
-      #define BEEPER 23
189
+      #define BEEPER_PIN 23
190 190
       #define DOGLCD_CS 29
191 191
       #define DOGLCD_A0 27
192 192
       #define LCD_PIN_BL 33
193 193
     #elif defined(MINIPANEL)
194
-       #define BEEPER 42
194
+       #define BEEPER_PIN 42
195 195
        // Pins for DOGM SPI LCD Support
196 196
        #define DOGLCD_A0  44
197 197
        #define DOGLCD_CS  66
@@ -211,9 +211,10 @@
211 211
        #define BTN_ENC 59  //the click switch
212 212
        //not connected to a pin
213 213
        #define SDCARDDETECT 49
214
+
214 215
     #else
215
-      // arduino pin which triggers an piezzo beeper
216
-      #define BEEPER 33  // Beeper on AUX-4
216
+
217
+      #define BEEPER_PIN 33  // Beeper on AUX-4
217 218
 
218 219
       // buttons are directly attached using AUX-2
219 220
       #if ENABLED(REPRAPWORLD_KEYPAD)
@@ -241,8 +242,8 @@
241 242
 
242 243
     #endif
243 244
   #else // !NEWPANEL (Old-style panel with shift register)
244
-    // Arduino pin to trigger a piezzo beeper
245
-    #define BEEPER 33   // No Beeper added
245
+
246
+    #define BEEPER_PIN 33   // No Beeper added
246 247
 
247 248
     // Buttons are attached to a shift register
248 249
     // Not wired yet

+ 4
- 4
Marlin/pins_RIGIDBOARD.h Wyświetl plik

@@ -22,8 +22,8 @@
22 22
 
23 23
 #if ENABLED(RIGIDBOT_PANEL)
24 24
 
25
-  #undef BEEPER
26
-  #define BEEPER -1
25
+  #undef BEEPER_PIN
26
+  #define BEEPER_PIN -1
27 27
 
28 28
   #undef SDCARDDETECT
29 29
   #define SDCARDDETECT 22
@@ -48,8 +48,8 @@
48 48
 
49 49
 #elif defined(REPRAP_DISCOUNT_SMART_CONTROLLER)
50 50
 
51
-  #undef BEEPER
52
-  #define BEEPER -1
51
+  #undef BEEPER_PIN
52
+  #define BEEPER_PIN -1
53 53
 
54 54
   #undef  SDCARDDETECT
55 55
   #define SDCARDDETECT 22

+ 1
- 1
Marlin/pins_RUMBA.h Wyświetl plik

@@ -102,7 +102,7 @@
102 102
 #define SDPOWER            -1
103 103
 #define SDSS               53
104 104
 #define SDCARDDETECT       49
105
-#define BEEPER             44
105
+#define BEEPER_PIN         44
106 106
 #define LCD_PINS_RS        19
107 107
 #define LCD_PINS_ENABLE    42
108 108
 #define LCD_PINS_D4        18

+ 3
- 3
Marlin/pins_SANGUINOLOLU_11.h Wyświetl plik

@@ -95,7 +95,7 @@
95 95
 #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
96 96
 
97 97
   // No buzzer installed
98
-  #define BEEPER -1
98
+  #define BEEPER_PIN -1
99 99
 
100 100
   // LCD Pins
101 101
   #if ENABLED(DOGLCD)
@@ -106,7 +106,7 @@
106 106
         #define LCD_PINS_RS     30 //CS chip select /SS chip slave select
107 107
         #define LCD_PINS_ENABLE 29 //SID (MOSI)
108 108
         #define LCD_PINS_D4     17 //SCK (CLK) clock
109
-        #define BEEPER          27 // Pin 27 is take by LED_Pin, but Melzi LED do nothing with Marlin and I take this pin for BEEPER.... See here > [github.com] , If you want use this pin with Gcode M42 instead BEEPER
109
+        #define BEEPER_PIN      27 // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with Marlin so this can be used for BEEPER_PIN. You can use this pin with M42 instead of BEEPER_PIN.
110 110
       #else         // Sanguinololu 1.3
111 111
         #define LCD_PINS_RS      4 
112 112
         #define LCD_PINS_ENABLE 17 
@@ -160,7 +160,7 @@
160 160
 
161 161
 #elif ENABLED(MAKRPANEL)
162 162
 
163
-  #define BEEPER                29
163
+  #define BEEPER_PIN            29
164 164
 
165 165
   // Pins for DOGM SPI LCD Support
166 166
   #define DOGLCD_A0             30

+ 1
- 1
Marlin/pins_SAV_MKI.h Wyświetl plik

@@ -85,7 +85,7 @@
85 85
 #define ALARM_PIN          -1
86 86
 #define SDCARDDETECT       -1
87 87
 
88
-#define BEEPER             -1
88
+#define BEEPER_PIN         -1
89 89
 #define LCD_PINS_RS        -1
90 90
 #define LCD_PINS_ENABLE    -1
91 91
 #define LCD_PINS_D4        -1

+ 3
- 2
Marlin/pins_TEENSYLU.h Wyświetl plik

@@ -68,9 +68,10 @@
68 68
 #endif
69 69
 
70 70
 #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
71
-  //we have no buzzer installed
72
-  #define BEEPER -1
73 71
   //LCD Pins
72
+
73
+  #define BEEPER_PIN -1
74
+
74 75
   #if ENABLED(LCD_I2C_PANELOLU2)
75 76
     #define BTN_EN1 27  //RX1 - fastio.h pin mapping 27
76 77
     #define BTN_EN2 26  //TX1 - fastio.h pin mapping 26

+ 1
- 2
Marlin/pins_ULTIMAIN_2.h Wyświetl plik

@@ -58,8 +58,7 @@
58 58
 #define MOTOR_CURRENT_PWM_RANGE 2000
59 59
 #define DEFAULT_PWM_MOTOR_CURRENT  {1300, 1300, 1250}
60 60
 
61
-//arduino pin witch triggers an piezzo beeper
62
-#define BEEPER 18
61
+#define BEEPER_PIN 18
63 62
 
64 63
 #define LCD_PINS_RS 20
65 64
 #define LCD_PINS_ENABLE 15

+ 3
- 6
Marlin/pins_ULTIMAKER.h Wyświetl plik

@@ -57,9 +57,9 @@
57 57
 
58 58
 #if ENABLED(ULTRA_LCD)
59 59
 
60
+  #define BEEPER_PIN 18
61
+
60 62
   #if ENABLED(NEWPANEL)
61
-  //arduino pin witch triggers an piezzo beeper
62
-    #define BEEPER 18
63 63
 
64 64
     #define LCD_PINS_RS 20
65 65
     #define LCD_PINS_ENABLE 17
@@ -71,15 +71,12 @@
71 71
     //buttons are directly attached
72 72
     #define BTN_EN1 40
73 73
     #define BTN_EN2 42
74
-    #define BTN_ENC 19  //the click
74
+    #define BTN_ENC 19
75 75
 
76 76
     #define SDCARDDETECT 38
77 77
 
78 78
   #else //!NEWPANEL - Old style panel with shift register
79 79
 
80
-    //arduino pin witch triggers an piezzo beeper
81
-    #define BEEPER 18
82
-
83 80
     //buttons are attached to a shift register
84 81
     #define SHIFT_CLK 38
85 82
     #define SHIFT_LD 42

+ 1
- 1
Marlin/ultralcd.cpp Wyświetl plik

@@ -1325,7 +1325,7 @@ void lcd_quick_feedback() {
1325 1325
       #define LCD_FEEDBACK_FREQUENCY_DURATION_MS (1000/6)
1326 1326
     #endif    
1327 1327
     lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
1328
-  #elif defined(BEEPER) && BEEPER >= 0
1328
+  #elif PIN_EXISTS(BEEPER)
1329 1329
     #ifndef LCD_FEEDBACK_FREQUENCY_HZ
1330 1330
       #define LCD_FEEDBACK_FREQUENCY_HZ 5000
1331 1331
     #endif

Ładowanie…
Anuluj
Zapisz