Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Pins and debug list cleanup (#24878)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored Oct 18, 2022
1 parent e298266 commit 81976c4
Show file tree
Hide file tree
Showing 12 changed files with 1,068 additions and 739 deletions.
6 changes: 3 additions & 3 deletions Marlin/src/HAL/AVR/fastio.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ enum ClockSource2 : uint8_t {

#if HAS_MOTOR_CURRENT_PWM
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY)
#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)
#elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_Z)
#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)
#else
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1)
#endif
#else
#define PWM_CHK_MOTOR_CURRENT(P) false
Expand Down
14 changes: 7 additions & 7 deletions Marlin/src/lcd/buttons.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#if ((!HAS_ADC_BUTTONS && IS_NEWPANEL) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL
#define HAS_ENCODER_WHEEL 1
#endif
#if (HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT)) && DISABLED(TOUCH_UI_FTDI_EVE)
#if (HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DOWN, LEFT, RIGHT)) && DISABLED(TOUCH_UI_FTDI_EVE)
#define HAS_DIGITAL_BUTTONS 1
#endif
#if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL))
Expand Down Expand Up @@ -190,18 +190,18 @@
#else
#define _BUTTON_PRESSED_UP false
#endif
#if BUTTON_EXISTS(DWN)
#define _BUTTON_PRESSED_DWN _BUTTON_PRESSED(DWN)
#if BUTTON_EXISTS(DOWN)
#define _BUTTON_PRESSED_DWN _BUTTON_PRESSED(DOWN)
#else
#define _BUTTON_PRESSED_DWN false
#endif
#if BUTTON_EXISTS(LFT)
#define _BUTTON_PRESSED_LFT _BUTTON_PRESSED(LFT)
#if BUTTON_EXISTS(LEFT)
#define _BUTTON_PRESSED_LFT _BUTTON_PRESSED(LEFT)
#else
#define _BUTTON_PRESSED_LFT false
#endif
#if BUTTON_EXISTS(RT)
#define _BUTTON_PRESSED_RT _BUTTON_PRESSED(RT)
#if BUTTON_EXISTS(RIGHT)
#define _BUTTON_PRESSED_RT _BUTTON_PRESSED(RIGHT)
#else
#define _BUTTON_PRESSED_RT false
#endif
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,14 +482,14 @@ void lv_encoder_pin_init() {
#if BUTTON_EXISTS(UP)
SET_INPUT(BTN_UP);
#endif
#if BUTTON_EXISTS(DWN)
SET_INPUT(BTN_DWN);
#if BUTTON_EXISTS(DOWN)
SET_INPUT(BTN_DOWN);
#endif
#if BUTTON_EXISTS(LFT)
SET_INPUT(BTN_LFT);
#if BUTTON_EXISTS(LEFT)
SET_INPUT(BTN_LEFT);
#endif
#if BUTTON_EXISTS(RT)
SET_INPUT(BTN_RT);
#if BUTTON_EXISTS(RIGHT)
SET_INPUT(BTN_RIGHT);
#endif
}

Expand Down
18 changes: 9 additions & 9 deletions Marlin/src/lcd/marlinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,14 @@ void MarlinUI::init() {
#if BUTTON_EXISTS(UP)
SET_INPUT(BTN_UP);
#endif
#if BUTTON_EXISTS(DWN)
SET_INPUT(BTN_DWN);
#if BUTTON_EXISTS(DOWN)
SET_INPUT(BTN_DOWN);
#endif
#if BUTTON_EXISTS(LFT)
SET_INPUT(BTN_LFT);
SET_INPUT(BTN_LEFT);
#endif
#if BUTTON_EXISTS(RT)
SET_INPUT(BTN_RT);
SET_INPUT(BTN_RIGHT);
#endif
#endif

Expand Down Expand Up @@ -1303,28 +1303,28 @@ void MarlinUI::init() {
//
// Directional buttons
//
#if ANY_BUTTON(UP, DWN, LFT, RT)
#if ANY_BUTTON(UP, DOWN, LEFT, RIGHT)

const int8_t pulses = epps * encoderDirection;

if (BUTTON_PRESSED(UP)) {
encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * pulses;
next_button_update_ms = now + 300;
}
else if (BUTTON_PRESSED(DWN)) {
else if (BUTTON_PRESSED(DOWN)) {
encoderDiff = -(ENCODER_STEPS_PER_MENU_ITEM) * pulses;
next_button_update_ms = now + 300;
}
else if (BUTTON_PRESSED(LFT)) {
else if (BUTTON_PRESSED(LEFT)) {
encoderDiff = -pulses;
next_button_update_ms = now + 300;
}
else if (BUTTON_PRESSED(RT)) {
else if (BUTTON_PRESSED(RIGHT)) {
encoderDiff = pulses;
next_button_update_ms = now + 300;
}

#endif // UP || DWN || LFT || RT
#endif // UP || DOWN || LEFT || RIGHT

buttons = (newbutton | TERN0(HAS_SLOW_BUTTONS, slow_buttons)
#if BOTH(HAS_TOUCH_BUTTONS, HAS_ENCODER_ACTION)
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/pins/mega/pins_EINSTART-S.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@
// LCD Display input pins
//
#define BTN_UP 25
#define BTN_DWN 26
#define BTN_LFT 27
#define BTN_RT 28
#define BTN_DOWN 26
#define BTN_LEFT 27
#define BTN_RIGHT 28

// 'OK' button
#define BTN_ENC 29
Expand Down
15 changes: 7 additions & 8 deletions Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,13 @@

#define BTN_EN2 75 // J4, UP
#define BTN_EN1 73 // J3, DOWN
//STOP button connected as KILL_PIN
#define KILL_PIN 14 // J1, RIGHT
//KILL - not connected
// STOP button connected as KILL_PIN
#define KILL_PIN 14 // J1, RIGHT (not connected)

#define BEEPER_PIN 8 // H5, SD_WP

//on board leds
#define STAT_LED_RED_LED SERVO0_PIN // C1 (1280-EX1, DEBUG2)
// Onboard leds
#define STAT_LED_RED_PIN SERVO0_PIN // C1 (1280-EX1, DEBUG2)
#define STAT_LED_BLUE_PIN SERVO1_PIN // C0 (1280-EX2, DEBUG3)

#else
Expand All @@ -220,9 +219,9 @@
#define SR_STROBE_PIN 33 // C4

#define BTN_UP 75 // J4
#define BTN_DWN 73 // J3
#define BTN_LFT 72 // J2
#define BTN_RT 14 // J1
#define BTN_DOWN 73 // J3
#define BTN_LEFT 72 // J2
#define BTN_RIGHT 14 // J1

// Disable encoder
#undef BTN_EN1
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/mega/pins_OVERLORD.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
#if IS_NEWPANEL
#define BTN_ENC 16 // Enter Pin
#define BTN_UP 19 // Button UP Pin
#define BTN_DWN 17 // Button DOWN Pin
#define BTN_DOWN 17 // Button DOWN Pin
#endif

// Additional connectors/pins on the Overlord V1.X board
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER)

#include "pinsDebug_list.h"
#line 48
#line 49

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

#include "pinsDebug_list.h"
#line 167
#line 168

};

Expand Down
Loading

0 comments on commit 81976c4

Please sign in to comment.