Skip to content

Commit

Permalink
misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 11, 2022
1 parent 8d4c022 commit d74deda
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
8 changes: 3 additions & 5 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1511,9 +1511,7 @@ void DWIN_HandleScreen() {
break;
case Locked: HMI_LockScreen(); break;
case PrintDone:
#if HAS_ESDIAG
case ESDiagProcess:
#endif
TERN_(HAS_ESDIAG, case ESDiagProcess:)
case WaitResponse: HMI_WaitForUser(); break;
case Homing:
case PidProcess:
Expand Down Expand Up @@ -2150,7 +2148,7 @@ void SetPID(celsius_t t, heater_id_t h) {
}
#endif

#if HAS_HEATED_BED && ENABLED(PREHEAT_BEFORE_LEVELING)
#if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING)
void SetBedLevT() { SetPIntOnClick(BED_MINTEMP, BED_MAX_TARGET); }
#endif

Expand Down Expand Up @@ -3149,7 +3147,7 @@ void Draw_Move_Menu() {
EDIT_ITEM(ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET), onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x);
EDIT_ITEM(ICON_ProbeOffsetY, GET_TEXT_F(MSG_ZPROBE_YOFFSET), onDrawPFloatMenu, SetProbeOffsetY, &probe.offset.y);
EDIT_ITEM(ICON_ProbeOffsetZ, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetProbeOffsetZ, &probe.offset.z);
#if HAS_HEATED_BED && ENABLED(PREHEAT_BEFORE_LEVELING)
#if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING)
EDIT_ITEM(ICON_Temperature, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawPIntMenu, SetBedLevT, &HMI_data.BedLevT);
#endif
#ifdef BLTOUCH_HS_MODE
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void DWIN_Draw_Value(uint8_t bShow, bool signedMode, bool zeroFill, uint8_t zero
DWIN_Word(i, y);
// Write a big-endian 64 bit integer
const size_t p = i + 1;
for (char count = 8; count--;) { // 7..0
for (size_t count = 8; count--;) { // 7..0
++i;
DWIN_SendBuf[p + count] = value;
value >>= 8;
Expand Down
14 changes: 7 additions & 7 deletions Marlin/src/lcd/e3v2/proui/dwinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ void (*DWINUI::onTitleDraw)(TitleClass* title)=nullptr;
void (*DWINUI::onMenuDraw)(MenuClass* menu)=nullptr;

void DWINUI::init() {
TERN_(DEBUG_DWIN, DEBUG_ECHOPGM("\r\nDWIN handshake ");)
TERN_(DEBUG_DWIN, SERIAL_ECHOPGM("\r\nDWIN handshake "));
delay(750); // Delay for wait to wakeup screen
TERN(DEBUG_DWIN, if (DWIN_Handshake()) DEBUG_ECHOLNPGM("ok."); else DEBUG_ECHOLNPGM("error."), DWIN_Handshake());
const bool hs = DWIN_Handshake();
TERN_(DEBUG_DWIN, SERIAL_ECHOLNF(hs ? F("ok.") : F("error.")));
DWIN_Frame_SetDir(1);
cursor.x = 0;
cursor.y = 0;
cursor.reset();
pencolor = Color_White;
textcolor = Def_Text_Color;
backcolor = Def_Background_Color;
Expand Down Expand Up @@ -259,9 +259,9 @@ void DWINUI::Draw_FillCircle(uint16_t bcolor, uint16_t x,uint16_t y,uint8_t r) {
uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2) {
uint8_t B, G, R;
const float n = (float)(val - minv) / (maxv - minv);
R = (1-n) * GetRColor(color1) + n * GetRColor(color2);
G = (1-n) * GetGColor(color1) + n * GetGColor(color2);
B = (1-n) * GetBColor(color1) + n * GetBColor(color2);
R = (1 - n) * GetRColor(color1) + n * GetRColor(color2);
G = (1 - n) * GetGColor(color1) + n * GetGColor(color2);
B = (1 - n) * GetBColor(color1) + n * GetBColor(color2);
return RGB(R, G, B);
}

Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/e3v2/proui/dwinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ namespace DWINUI {
frame_rect_t t;
t.x = frame.x - v;
t.y = frame.y - v;
t.w = frame.w + 2*v;
t.h = frame.h + 2*v;
t.w = frame.w + 2 * v;
t.h = frame.h + 2 * v;
return t;
};
}

// Draw an Icon with transparent background from the library ICON
// icon: Icon ID
Expand Down

0 comments on commit d74deda

Please sign in to comment.