Skip to content

Commit 4941a7f

Browse files
committed
misc cleanup
1 parent 8d4c022 commit 4941a7f

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

Marlin/src/lcd/e3v2/proui/dwin.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,9 +1511,7 @@ void DWIN_HandleScreen() {
15111511
break;
15121512
case Locked: HMI_LockScreen(); break;
15131513
case PrintDone:
1514-
#if HAS_ESDIAG
1515-
case ESDiagProcess:
1516-
#endif
1514+
TERN_(HAS_ESDIAG, case ESDiagProcess:)
15171515
case WaitResponse: HMI_WaitForUser(); break;
15181516
case Homing:
15191517
case PidProcess:
@@ -2150,7 +2148,7 @@ void SetPID(celsius_t t, heater_id_t h) {
21502148
}
21512149
#endif
21522150

2153-
#if HAS_HEATED_BED && ENABLED(PREHEAT_BEFORE_LEVELING)
2151+
#if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING)
21542152
void SetBedLevT() { SetPIntOnClick(BED_MINTEMP, BED_MAX_TARGET); }
21552153
#endif
21562154

@@ -3149,7 +3147,7 @@ void Draw_Move_Menu() {
31493147
EDIT_ITEM(ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET), onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x);
31503148
EDIT_ITEM(ICON_ProbeOffsetY, GET_TEXT_F(MSG_ZPROBE_YOFFSET), onDrawPFloatMenu, SetProbeOffsetY, &probe.offset.y);
31513149
EDIT_ITEM(ICON_ProbeOffsetZ, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetProbeOffsetZ, &probe.offset.z);
3152-
#if HAS_HEATED_BED && ENABLED(PREHEAT_BEFORE_LEVELING)
3150+
#if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING)
31533151
EDIT_ITEM(ICON_Temperature, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawPIntMenu, SetBedLevT, &HMI_data.BedLevT);
31543152
#endif
31553153
#ifdef BLTOUCH_HS_MODE

Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void DWIN_Draw_Value(uint8_t bShow, bool signedMode, bool zeroFill, uint8_t zero
6767
DWIN_Word(i, y);
6868
// Write a big-endian 64 bit integer
6969
const size_t p = i + 1;
70-
for (char count = 8; count--;) { // 7..0
70+
for (size_t count = 8; count--;) { // 7..0
7171
++i;
7272
DWIN_SendBuf[p + count] = value;
7373
value >>= 8;

Marlin/src/lcd/e3v2/proui/dwinui.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ void (*DWINUI::onTitleDraw)(TitleClass* title)=nullptr;
5959
void (*DWINUI::onMenuDraw)(MenuClass* menu)=nullptr;
6060

6161
void DWINUI::init() {
62-
TERN_(DEBUG_DWIN, DEBUG_ECHOPGM("\r\nDWIN handshake ");)
62+
TERN_(DEBUG_DWIN, SERIAL_ECHOPGM("\r\nDWIN handshake "));
6363
delay(750); // Delay for wait to wakeup screen
64-
TERN(DEBUG_DWIN, if (DWIN_Handshake()) DEBUG_ECHOLNPGM("ok."); else DEBUG_ECHOLNPGM("error."), DWIN_Handshake());
64+
const bool hs = DWIN_Handshake();
65+
TERN(DEBUG_DWIN, SERIAL_ECHOLNF(hs ? F("ok.") : F("error.")), UNUSED(hs));
6566
DWIN_Frame_SetDir(1);
66-
cursor.x = 0;
67-
cursor.y = 0;
67+
cursor.reset();
6868
pencolor = Color_White;
6969
textcolor = Def_Text_Color;
7070
backcolor = Def_Background_Color;
@@ -259,9 +259,9 @@ void DWINUI::Draw_FillCircle(uint16_t bcolor, uint16_t x,uint16_t y,uint8_t r) {
259259
uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2) {
260260
uint8_t B, G, R;
261261
const float n = (float)(val - minv) / (maxv - minv);
262-
R = (1-n) * GetRColor(color1) + n * GetRColor(color2);
263-
G = (1-n) * GetGColor(color1) + n * GetGColor(color2);
264-
B = (1-n) * GetBColor(color1) + n * GetBColor(color2);
262+
R = (1 - n) * GetRColor(color1) + n * GetRColor(color2);
263+
G = (1 - n) * GetGColor(color1) + n * GetGColor(color2);
264+
B = (1 - n) * GetBColor(color1) + n * GetBColor(color2);
265265
return RGB(R, G, B);
266266
}
267267

Marlin/src/lcd/e3v2/proui/dwinui.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ namespace DWINUI {
285285
frame_rect_t t;
286286
t.x = frame.x - v;
287287
t.y = frame.y - v;
288-
t.w = frame.w + 2*v;
289-
t.h = frame.h + 2*v;
288+
t.w = frame.w + 2 * v;
289+
t.h = frame.h + 2 * v;
290290
return t;
291-
};
291+
}
292292

293293
// Draw an Icon with transparent background from the library ICON
294294
// icon: Icon ID

0 commit comments

Comments
 (0)