Skip to content

Commit

Permalink
Fix new defines, pins format
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Sep 28, 2020
1 parent 8578f4e commit d064b22
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 57 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,4 +1139,4 @@ int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) {

#endif // DEBUG_LCDPRINT

#endif // TFTGLCD_PANEL
#endif // IS_TFTGLCD_PANEL
2 changes: 1 addition & 1 deletion Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,4 +1015,4 @@ void MarlinUI::draw_status_screen() {

#endif // HAS_LCD_MENU

#endif // TFTGLCD_PANEL
#endif // IS_TFTGLCD_PANEL
2 changes: 1 addition & 1 deletion Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ extern TFTGLCD lcd;
#define EN_C 4 //for click
#endif

#endif // TFTGLCD_PANEL
#endif // IS_TFTGLCD_PANEL
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
clear_lcd();

// Re-initialize custom characters that may be re-used
#if HAS_MARLINUI_HD44780 && DISABLED(TFTGLCD_PANEL)
#if HAS_MARLINUI_HD44780
if (TERN1(AUTO_BED_LEVELING_UBL, !ubl.lcd_map_control))
set_custom_characters(on_status_screen() ? CHARSET_INFO : CHARSET_MENU);
#endif
Expand Down
4 changes: 0 additions & 4 deletions Marlin/src/lcd/menu/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@

#include "limits.h"

#if IS_TFTGLCD_PANEL
#include "../TFTGLCD/ultralcd_TFTGLCD.h"
#endif

extern int8_t encoderLine, encoderTopLine, screen_items;

void scroll_screen(const uint8_t limit, const bool is_menu);
Expand Down
13 changes: 5 additions & 8 deletions Marlin/src/lcd/menu/menu_ubl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,15 @@ inline float rounded_mesh_value() {
static void _lcd_mesh_fine_tune(PGM_P const msg) {
ui.defer_status_screen();
if (ubl.encoder_diff) {
mesh_edit_accumulator += TERN(TFTGLCD_PANEL,
mesh_edit_accumulator += TERN(IS_TFTGLCD_PANEL,
ubl.encoder_diff * 0.005f / ENCODER_PULSES_PER_STEP,
ubl.encoder_diff > 0 ? 0.005f : -0.005f
);
ubl.encoder_diff = 0;
#if DISABLED(TFTGLCD_PANEL)
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
}
#else
}
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
#endif
TERN(IS_TFTGLCD_PANEL,,ui.refresh(LCDVIEW_CALL_REDRAW_NEXT));
}
TERN_(IS_TFTGLCD_PANEL, ui.refresh(LCDVIEW_CALL_REDRAW_NEXT));

if (ui.should_draw()) {
const float rounded_f = rounded_mesh_value();
MenuEditItemBase::draw_edit_screen(msg, ftostr43sign(rounded_f));
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ bool MarlinUI::get_blink() {
* This is very display-dependent, so the lcd implementation draws this.
*/

#if ENABLED(LCD_PROGRESS_BAR) && DISABLED(TFTGLCD_PANEL)
#if ENABLED(LCD_PROGRESS_BAR) && !IS_TFTGLCD_PANEL
millis_t MarlinUI::progress_bar_ms; // = 0
#if PROGRESS_MSG_EXPIRE > 0
millis_t MarlinUI::expire_status_ms; // = 0
Expand All @@ -517,7 +517,7 @@ void MarlinUI::status_screen() {

TERN_(HAS_LCD_MENU, ENCODER_RATE_MULTIPLY(false));

#if ENABLED(LCD_PROGRESS_BAR) && DISABLED(TFTGLCD_PANEL)
#if ENABLED(LCD_PROGRESS_BAR) && !IS_TFTGLCD_PANEL

//
// HD44780 implements the following message blinking and
Expand Down Expand Up @@ -915,7 +915,7 @@ void MarlinUI::update() {

const bool encoderPastThreshold = (abs_diff >= epps);
if (encoderPastThreshold || lcd_clicked) {
if (encoderPastThreshold && TERN1(TFTGLCD_PANEL, !external_control)) {
if (encoderPastThreshold && TERN1(IS_TFTGLCD_PANEL, !external_control)) {

#if BOTH(HAS_LCD_MENU, ENCODER_RATE_MULTIPLIER)

Expand Down Expand Up @@ -1337,7 +1337,7 @@ void MarlinUI::update() {
const millis_t ms = millis();
#endif

#if ENABLED(LCD_PROGRESS_BAR) && DISABLED(TFTGLCD_PANEL)
#if ENABLED(LCD_PROGRESS_BAR) && !IS_TFTGLCD_PANEL
progress_bar_ms = ms;
#if PROGRESS_MSG_EXPIRE > 0
expire_status_ms = persist ? 0 : ms + PROGRESS_MSG_EXPIRE;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/ultralcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#if EITHER(HAS_LCD_MENU, ULTIPANEL_FEEDMULTIPLY)
#define HAS_ENCODER_ACTION 1
#endif
#if ((!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) || BUTTONS_EXIST(EN1, EN2)) && DISABLED(TFTGLCD_PANEL)
#if ((!HAS_ADC_BUTTONS && ENABLED(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)
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@
// https://www.facebook.com/groups/505736576548648/permalink/630639874058317/
#ifndef SDCARD_CONNECTION
#if ANY(MKS_MINI_12864, ENDER2_STOCKDISPLAY, IS_TFTGLCD_PANEL)
#define SDCARD_CONNECTION LCD
#define SDCARD_CONNECTION LCD
#else
#define SDCARD_CONNECTION ONBOARD
#define SDCARD_CONNECTION ONBOARD
#endif
#endif

Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
#define ENET_TXD1 P1_01 // J12-12

#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION ONBOARD
#define SDCARD_CONNECTION ONBOARD
#endif

#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
Expand Down Expand Up @@ -234,12 +234,12 @@
#define BTN_EN1 P3_26 // EXP2.5
#define BTN_EN2 P3_25 // EXP2.3
#define LCD_PINS_RS P0_16 // EXP1.4
#define LCD_SDSS
#define LCD_SDSS P0_28 // EXP2.4
#define LCD_PINS_ENABLE P0_18 // EXP1.3
#define LCD_PINS_D4 P0_15 // EXP1.5
#if ANY(VIKI2, miniVIKI)
#define DOGLCD_SCK SCK_PIN
#define DOGLCD_MOSI MOSI_PIN
#define DOGLCD_SCK SCK_PIN
#define DOGLCD_MOSI MOSI_PIN
#endif

#if ENABLED(FYSETC_MINI_12864)
Expand All @@ -260,7 +260,7 @@
#define DOGLCD_MOSI P4_28 // J8-6 (MOSI on FYSETC schematic)

//#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
// results in LCD soft SPI mode 3, SD soft SPI mode 0
// results in LCD soft SPI mode 3, SD soft SPI mode 0

#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
#ifndef RGB_LED_R_PIN
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/ramps/pins_RAMPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@
#define LCD_PINS_D6 44
#define LCD_PINS_D7 64

#elif IS_TFTGLCD_PANEL
#elif ENABLED(TFTGLCD_PANEL_SPI)

#define TFTGLCD_CS 33

Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,7 @@

#if SD_CONNECTION_IS(ONBOARD)
#define SD_DETECT_PIN PC4
#endif

#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) && SD_CONNECTION_IS(LCD)
#elif SD_CONNECTION_IS(LCD) && BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
#define SD_DETECT_PIN PA15
#define SS_PIN PA10
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
Expand Down
10 changes: 4 additions & 6 deletions Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@

#if ENABLED(TFTGLCD_PANEL_SPI)

#error "CAUTION! TFTGLCD_PANEL requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue."
#error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue."

/**
* TFTGLCD_PANEL display pinout
* TFTGLCD_PANEL_SPI display pinout
*
* Board Display
* _____ _____
Expand Down Expand Up @@ -210,7 +210,7 @@
#endif

#else
#error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864 and TFTGLCD_PANEL are currently supported on the BIGTREE_SKR_MINI_E3."
#error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BIGTREE_SKR_MINI_E3."
#endif

#endif // HAS_WIRED_LCD
Expand Down Expand Up @@ -267,9 +267,7 @@

#if SD_CONNECTION_IS(ONBOARD)
#define SD_DETECT_PIN PC4
#endif

#if (BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) || IS_TFTGLCD_PANEL) && SD_CONNECTION_IS(LCD)
#elif SD_CONNECTION_IS(LCD) && (BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) || IS_TFTGLCD_PANEL)
#define SD_DETECT_PIN PB5
#define SS_PIN PA10
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
Expand Down
36 changes: 18 additions & 18 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,35 +228,35 @@
#elif IS_TFTGLCD_PANEL

#if ENABLED(TFTGLCD_PANEL_SPI)
#define TFTGLCD_CS PG5
#define TFTGLCD_CS PG5
#endif

#elif HAS_WIRED_LCD

#define BEEPER_PIN PC5
#define BTN_ENC PG2
#define LCD_PINS_ENABLE PG0
#define LCD_PINS_RS PG1
#define BTN_EN1 PG5
#define BTN_EN2 PG4
#define BEEPER_PIN PC5
#define BTN_ENC PG2
#define LCD_PINS_ENABLE PG0
#define LCD_PINS_RS PG1
#define BTN_EN1 PG5
#define BTN_EN2 PG4

// MKS MINI12864 and MKS LCD12864B. If using MKS LCD12864A (Need to remove RPK2 resistor)
#if ENABLED(MKS_MINI_12864)

#define LCD_BACKLIGHT_PIN -1
#define LCD_RESET_PIN -1
#define DOGLCD_A0 PF12
#define DOGLCD_CS PF15
#define DOGLCD_SCK PB13
#define DOGLCD_MOSI PB15
#define LCD_BACKLIGHT_PIN -1
#define LCD_RESET_PIN -1
#define DOGLCD_A0 PF12
#define DOGLCD_CS PF15
#define DOGLCD_SCK PB13
#define DOGLCD_MOSI PB15

#else // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY
#else // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY

#define LCD_PINS_D4 PF14
#define LCD_PINS_D4 PF14
#if ENABLED(ULTIPANEL)
#define LCD_PINS_D5 PF15
#define LCD_PINS_D6 PF12
#define LCD_PINS_D7 PF13
#define LCD_PINS_D5 PF15
#define LCD_PINS_D6 PF12
#define LCD_PINS_D7 PF13
#endif

#endif // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY
Expand Down
2 changes: 1 addition & 1 deletion buildroot/tests/LPC1769-tests
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PI
Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \
LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER
opt_set GRID_MAX_POINTS_X 16
exec_test $1 $2 "Smoothieboard with TFTGLCD_PANEL"
exec_test $1 $2 "Smoothieboard with TFTGLCD_PANEL_SPI"

#restore_configs
#opt_set MOTHERBOARD BOARD_AZTEEG_X5_MINI_WIFI
Expand Down

0 comments on commit d064b22

Please sign in to comment.