Skip to content

Commit dd224b4

Browse files
committedDec 16, 2022
πŸ§‘β€πŸ’» Pins and debug list cleanup (MarlinFirmware#24878)
1 parent 2e2abbc commit dd224b4

12 files changed

+1068
-739
lines changed
 

β€ŽMarlin/src/HAL/AVR/fastio.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,11 @@ enum ClockSource2 : uint8_t {
293293

294294
#if HAS_MOTOR_CURRENT_PWM
295295
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
296-
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY)
296+
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY)
297297
#elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
298-
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_Z)
298+
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z)
299299
#else
300-
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E)
300+
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1)
301301
#endif
302302
#else
303303
#define PWM_CHK_MOTOR_CURRENT(P) false

β€ŽMarlin/src/lcd/buttons.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#if ((!HAS_ADC_BUTTONS && IS_NEWPANEL) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL
2727
#define HAS_ENCODER_WHEEL 1
2828
#endif
29-
#if (HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT)) && DISABLED(TOUCH_UI_FTDI_EVE)
29+
#if (HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DOWN, LEFT, RIGHT)) && DISABLED(TOUCH_UI_FTDI_EVE)
3030
#define HAS_DIGITAL_BUTTONS 1
3131
#endif
3232
#if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL))
@@ -190,18 +190,18 @@
190190
#else
191191
#define _BUTTON_PRESSED_UP false
192192
#endif
193-
#if BUTTON_EXISTS(DWN)
194-
#define _BUTTON_PRESSED_DWN _BUTTON_PRESSED(DWN)
193+
#if BUTTON_EXISTS(DOWN)
194+
#define _BUTTON_PRESSED_DWN _BUTTON_PRESSED(DOWN)
195195
#else
196196
#define _BUTTON_PRESSED_DWN false
197197
#endif
198-
#if BUTTON_EXISTS(LFT)
199-
#define _BUTTON_PRESSED_LFT _BUTTON_PRESSED(LFT)
198+
#if BUTTON_EXISTS(LEFT)
199+
#define _BUTTON_PRESSED_LFT _BUTTON_PRESSED(LEFT)
200200
#else
201201
#define _BUTTON_PRESSED_LFT false
202202
#endif
203-
#if BUTTON_EXISTS(RT)
204-
#define _BUTTON_PRESSED_RT _BUTTON_PRESSED(RT)
203+
#if BUTTON_EXISTS(RIGHT)
204+
#define _BUTTON_PRESSED_RT _BUTTON_PRESSED(RIGHT)
205205
#else
206206
#define _BUTTON_PRESSED_RT false
207207
#endif

β€ŽMarlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -482,14 +482,14 @@ void lv_encoder_pin_init() {
482482
#if BUTTON_EXISTS(UP)
483483
SET_INPUT(BTN_UP);
484484
#endif
485-
#if BUTTON_EXISTS(DWN)
486-
SET_INPUT(BTN_DWN);
485+
#if BUTTON_EXISTS(DOWN)
486+
SET_INPUT(BTN_DOWN);
487487
#endif
488-
#if BUTTON_EXISTS(LFT)
489-
SET_INPUT(BTN_LFT);
488+
#if BUTTON_EXISTS(LEFT)
489+
SET_INPUT(BTN_LEFT);
490490
#endif
491-
#if BUTTON_EXISTS(RT)
492-
SET_INPUT(BTN_RT);
491+
#if BUTTON_EXISTS(RIGHT)
492+
SET_INPUT(BTN_RIGHT);
493493
#endif
494494
}
495495

β€ŽMarlin/src/lcd/marlinui.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,14 @@ void MarlinUI::init() {
227227
#if BUTTON_EXISTS(UP)
228228
SET_INPUT(BTN_UP);
229229
#endif
230-
#if BUTTON_EXISTS(DWN)
231-
SET_INPUT(BTN_DWN);
230+
#if BUTTON_EXISTS(DOWN)
231+
SET_INPUT(BTN_DOWN);
232232
#endif
233233
#if BUTTON_EXISTS(LFT)
234-
SET_INPUT(BTN_LFT);
234+
SET_INPUT(BTN_LEFT);
235235
#endif
236236
#if BUTTON_EXISTS(RT)
237-
SET_INPUT(BTN_RT);
237+
SET_INPUT(BTN_RIGHT);
238238
#endif
239239
#endif
240240

@@ -1303,28 +1303,28 @@ void MarlinUI::init() {
13031303
//
13041304
// Directional buttons
13051305
//
1306-
#if ANY_BUTTON(UP, DWN, LFT, RT)
1306+
#if ANY_BUTTON(UP, DOWN, LEFT, RIGHT)
13071307

13081308
const int8_t pulses = epps * encoderDirection;
13091309

13101310
if (BUTTON_PRESSED(UP)) {
13111311
encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * pulses;
13121312
next_button_update_ms = now + 300;
13131313
}
1314-
else if (BUTTON_PRESSED(DWN)) {
1314+
else if (BUTTON_PRESSED(DOWN)) {
13151315
encoderDiff = -(ENCODER_STEPS_PER_MENU_ITEM) * pulses;
13161316
next_button_update_ms = now + 300;
13171317
}
1318-
else if (BUTTON_PRESSED(LFT)) {
1318+
else if (BUTTON_PRESSED(LEFT)) {
13191319
encoderDiff = -pulses;
13201320
next_button_update_ms = now + 300;
13211321
}
1322-
else if (BUTTON_PRESSED(RT)) {
1322+
else if (BUTTON_PRESSED(RIGHT)) {
13231323
encoderDiff = pulses;
13241324
next_button_update_ms = now + 300;
13251325
}
13261326

1327-
#endif // UP || DWN || LFT || RT
1327+
#endif // UP || DOWN || LEFT || RIGHT
13281328

13291329
buttons = (newbutton | TERN0(HAS_SLOW_BUTTONS, slow_buttons)
13301330
#if BOTH(HAS_TOUCH_BUTTONS, HAS_ENCODER_ACTION)

β€ŽMarlin/src/pins/mega/pins_EINSTART-S.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@
101101
// LCD Display input pins
102102
//
103103
#define BTN_UP 25
104-
#define BTN_DWN 26
105-
#define BTN_LFT 27
106-
#define BTN_RT 28
104+
#define BTN_DOWN 26
105+
#define BTN_LEFT 27
106+
#define BTN_RIGHT 28
107107

108108
// 'OK' button
109109
#define BTN_ENC 29

β€ŽMarlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h

+7-8
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,13 @@
203203

204204
#define BTN_EN2 75 // J4, UP
205205
#define BTN_EN1 73 // J3, DOWN
206-
//STOP button connected as KILL_PIN
207-
#define KILL_PIN 14 // J1, RIGHT
208-
//KILL - not connected
206+
// STOP button connected as KILL_PIN
207+
#define KILL_PIN 14 // J1, RIGHT (not connected)
209208

210209
#define BEEPER_PIN 8 // H5, SD_WP
211210

212-
//on board leds
213-
#define STAT_LED_RED_LED SERVO0_PIN // C1 (1280-EX1, DEBUG2)
211+
// Onboard leds
212+
#define STAT_LED_RED_PIN SERVO0_PIN // C1 (1280-EX1, DEBUG2)
214213
#define STAT_LED_BLUE_PIN SERVO1_PIN // C0 (1280-EX2, DEBUG3)
215214

216215
#else
@@ -220,9 +219,9 @@
220219
#define SR_STROBE_PIN 33 // C4
221220

222221
#define BTN_UP 75 // J4
223-
#define BTN_DWN 73 // J3
224-
#define BTN_LFT 72 // J2
225-
#define BTN_RT 14 // J1
222+
#define BTN_DOWN 73 // J3
223+
#define BTN_LEFT 72 // J2
224+
#define BTN_RIGHT 14 // J1
226225

227226
// Disable encoder
228227
#undef BTN_EN1

β€ŽMarlin/src/pins/mega/pins_OVERLORD.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
#if IS_NEWPANEL
136136
#define BTN_ENC 16 // Enter Pin
137137
#define BTN_UP 19 // Button UP Pin
138-
#define BTN_DWN 17 // Button DOWN Pin
138+
#define BTN_DOWN 17 // Button DOWN Pin
139139
#endif
140140

141141
// Additional connectors/pins on the Overlord V1.X board

β€ŽMarlin/src/pins/pinsDebug.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER)
4646

4747
#include "pinsDebug_list.h"
48-
#line 48
48+
#line 49
4949

5050
// manually add pins that have names that are macros which don't play well with these macros
5151
#if ANY(AVR_ATmega2560_FAMILY, AVR_ATmega1284_FAMILY, ARDUINO_ARCH_SAM, TARGET_LPC1768)
@@ -164,7 +164,7 @@ const PinInfo pin_array[] PROGMEM = {
164164
#endif
165165

166166
#include "pinsDebug_list.h"
167-
#line 167
167+
#line 168
168168

169169
};
170170

β€ŽMarlin/src/pins/pinsDebug_list.h

+1,013-672
Large diffs are not rendered by default.

β€ŽMarlin/src/pins/ramps/pins_RIGIDBOARD.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@
103103

104104
// Direction buttons
105105
#define BTN_UP 37
106-
#define BTN_DWN 35
107-
#define BTN_LFT 33
108-
#define BTN_RT 32
106+
#define BTN_DOWN 35
107+
#define BTN_LEFT 33
108+
#define BTN_RIGHT 32
109109

110110
// 'R' button
111111
#undef BTN_ENC

β€ŽMarlin/src/pins/ramps/pins_ULTIMAIN_2.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
#define SDSS 53
108108
#define SD_DETECT_PIN 39
109109
#define LED_PIN 8
110-
#define SAFETY_TRIGGERED_PIN 28 // PIN to detect the safety circuit has triggered
111-
#define MAIN_VOLTAGE_MEASURE_PIN 14 // ANALOG PIN to measure the main voltage, with a 100k - 4k7 resitor divider.
110+
//#define SAFETY_TRIGGERED_PIN 28 // PIN to detect the safety circuit has triggered
111+
//#define MAIN_VOLTAGE_MEASURE_PIN 14 // ANALOG PIN to measure the main voltage, with a 100k - 4k7 resitor divider.
112112

113113
//
114114
// LCD / Controller

β€ŽMarlin/src/pins/ramps/pins_ZRIB_V20.h

+12-23
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,20 @@
2828

2929
#include "pins_MKS_GEN_13.h" // ... RAMPS
3030

31-
#define ZRIB_V20_D6_PIN 6 // Fan
32-
#define ZRIB_V20_D9_PIN 9 // Fan2
33-
#define ZRIB_V20_A10_PIN 10
34-
#define ZRIB_V20_D16_PIN 16
35-
#define ZRIB_V20_D17_PIN 17
36-
#define ZRIB_V20_D23_PIN 23
37-
#define ZRIB_V20_D25_PIN 25
38-
#define ZRIB_V20_D27_PIN 27
39-
#define ZRIB_V20_D29_PIN 29
40-
#define ZRIB_V20_D37_PIN 37
41-
4231
//
4332
// Auto fans
4433
//
4534
#ifndef E0_AUTO_FAN_PIN
46-
#define E0_AUTO_FAN_PIN ZRIB_V20_D6_PIN
35+
#define E0_AUTO_FAN_PIN 6 // Fan
4736
#endif
4837
#ifndef E1_AUTO_FAN_PIN
49-
#define E1_AUTO_FAN_PIN ZRIB_V20_D6_PIN
38+
#define E1_AUTO_FAN_PIN 6
5039
#endif
5140
#ifndef E2_AUTO_FAN_PIN
52-
#define E2_AUTO_FAN_PIN ZRIB_V20_D6_PIN
41+
#define E2_AUTO_FAN_PIN 6
5342
#endif
5443
#ifndef E3_AUTO_FAN_PIN
55-
#define E3_AUTO_FAN_PIN ZRIB_V20_D6_PIN
44+
#define E3_AUTO_FAN_PIN 6
5645
#endif
5746

5847
#ifndef FILWIDTH_PIN
@@ -76,12 +65,12 @@
7665
#undef BTN_EN2
7766
#undef BTN_ENC
7867

79-
#define LCD_PINS_RS ZRIB_V20_D16_PIN
80-
#define LCD_PINS_ENABLE ZRIB_V20_D17_PIN
81-
#define LCD_PINS_D4 ZRIB_V20_D23_PIN
82-
#define LCD_PINS_D5 ZRIB_V20_D25_PIN
83-
#define LCD_PINS_D6 ZRIB_V20_D27_PIN
84-
#define LCD_PINS_D7 ZRIB_V20_D29_PIN
85-
#define ADC_KEYPAD_PIN ZRIB_V20_A10_PIN
86-
#define BEEPER_PIN ZRIB_V20_D37_PIN
68+
#define LCD_PINS_RS 16
69+
#define LCD_PINS_ENABLE 17
70+
#define LCD_PINS_D4 23
71+
#define LCD_PINS_D5 25
72+
#define LCD_PINS_D6 27
73+
#define LCD_PINS_D7 29
74+
#define ADC_KEYPAD_PIN 10 // Analog Input
75+
#define BEEPER_PIN 37
8776
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.