Skip to content

Commit

Permalink
🐛 Fix TFT compile, K8400 pins (#26359)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored Oct 22, 2023
1 parent b8b1aa3 commit 156e7c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,15 +975,15 @@ void MarlinUI::draw_status_screen() {

uint8_t n = LCD_WIDTH;
const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL);
const int8_t plen = fstr ? utf8_strlen(fstr) : 0,
const int8_t plen = ftpl ? utf8_strlen(ftpl) : 0,
vlen = vstr ? utf8_strlen(vstr) : 0;
int8_t pad = (center || full) ? n - plen - vlen : 0;

// SS_CENTER: Pad with half of the unused space first
if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) { lcd.write(' '); n--; }

// Draw as much of the label as fits
if (plen) n -= lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n - vlen);
if (plen) n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n - vlen);

if (vlen && n > 0) {
// SS_FULL: Pad with enough space to justify the value
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/mega/pins_GT2560_V41b.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
#define BTN_EN2 H2_08_PIN
#define BTN_ENC H2_09_PIN
#define BEEPER_PIN H2_12_PIN
#elif ENABLED(CR10_STOCKDISPLAY) // Firmware compatible with stock GT 128x64 12pin LCD for the V41b
#elif ENABLED(CR10_STOCKDISPLAY) // Firmware compatible with stock GT 128x64 12pin LCD for the V41b
#define LCD_PINS_RS H2_04_PIN // DOGLCD_CS
#define LCD_PINS_D4 H2_05_PIN // DOGLCD_SCK
#define LCD_PINS_EN H2_03_PIN // DOGLCD_MOSI
Expand Down
7 changes: 6 additions & 1 deletion Marlin/src/pins/ramps/pins_K8400.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@
#define X_STOP_PIN 3
#define Y_STOP_PIN 14

//
// Fans
//
#define FAN0_PIN 8

#if ANY(BLTOUCH, TOUCH_MI_PROBE)
#define INVERTED_PROBE_STATE
#endif

#include "pins_3DRAG.h" // ... RAMPS

//
// Heaters / Fans
// Heaters
//
#undef HEATER_1_PIN
#define HEATER_1_PIN 11
Expand Down

0 comments on commit 156e7c1

Please sign in to comment.