Skip to content

Commit c762b7c

Browse files
Fix various errors, warnings in example config builds (#19686)
Co-authored-by: Scott Lahteine <[email protected]>
1 parent 45731bd commit c762b7c

11 files changed

Lines changed: 133 additions & 157 deletions

File tree

Marlin/src/gcode/bedlevel/G26.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,9 @@ void GcodeSuite::G26() {
511511
g26_keep_heaters_on = parser.boolval('K');
512512

513513
// Accept 'I' if temperature presets are defined
514-
const uint8_t preset_index = (0
515-
#if PREHEAT_COUNT
516-
+ (parser.seenval('I') ? _MIN(parser.value_byte(), PREHEAT_COUNT - 1) + 1 : 0)
517-
#endif
518-
);
514+
#if PREHEAT_COUNT
515+
const uint8_t preset_index = parser.seenval('I') ? _MIN(parser.value_byte(), PREHEAT_COUNT - 1) + 1 : 0;
516+
#endif
519517

520518
#if HAS_HEATED_BED
521519

Marlin/src/gcode/motion/M290.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void GcodeSuite::M290() {
127127
#else
128128
PSTR("Babystep Z")
129129
#endif
130-
, babystep.axis_total[BS_AXIS_IND(Z_AXIS)]
130+
, babystep.axis_total[BS_TOTAL_IND(Z_AXIS)]
131131
);
132132
}
133133
#endif

Marlin/src/lcd/dogm/dogm_Statusscreen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@
13411341
#undef STATUS_LOGO_WIDTH
13421342
#endif
13431343

1344-
#if (HAS_MULTI_HOTEND && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN)
1344+
#if !defined(STATUS_HEATERS_X) && ((HAS_MULTI_HOTEND && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN))
13451345
#define _STATUS_HEATERS_X(H,S,N) ((LCD_PIXEL_WIDTH - (H * (S + N)) - (_EXTRA_WIDTH) + (STATUS_LOGO_WIDTH)) / 2)
13461346
#if STATUS_HOTEND1_WIDTH
13471347
#if HOTENDS > 2

Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646

4747
extern lv_group_t * g;
4848
static lv_obj_t * scr;
49-
static lv_obj_t *labelExt1, * labelExt2, * labelFan, * labelZpos, * labelTime;
49+
static lv_obj_t *labelExt1, * labelFan, * labelZpos, * labelTime;
50+
TERN_(HAS_MULTI_EXTRUDER, static lv_obj_t *labelExt2;)
5051
static lv_obj_t *labelPause, * labelStop, * labelOperat;
5152
static lv_obj_t * bar1, *bar1ValueText;
5253
static lv_obj_t * buttonPause, *buttonOperat, *buttonStop;
@@ -137,9 +138,6 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
137138
}
138139

139140
void lv_draw_printing(void) {
140-
lv_obj_t *buttonExt1, *buttonExt2, *buttonFanstate, *buttonZpos, *buttonTime;
141-
TERN_(HAS_HEATED_BED, lv_obj_t * buttonBedstate);
142-
143141
disp_state_stack._disp_index = 0;
144142
ZERO(disp_state_stack._disp_state);
145143
disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINTING_UI;
@@ -162,16 +160,16 @@ void lv_draw_printing(void) {
162160
lv_refr_now(lv_refr_get_disp_refreshing());
163161

164162
// Create image buttons
165-
buttonExt1 = lv_img_create(scr, NULL);
163+
lv_obj_t *buttonExt1 = lv_img_create(scr, NULL);
166164
#if HAS_MULTI_EXTRUDER
167-
buttonExt2 = lv_img_create(scr, NULL);
165+
lv_obj_t *buttonExt2 = lv_img_create(scr, NULL);
168166
#endif
169167
#if HAS_HEATED_BED
170-
buttonBedstate = lv_img_create(scr, NULL);
168+
lv_obj_t *buttonBedstate = lv_img_create(scr, NULL);
171169
#endif
172-
buttonFanstate = lv_img_create(scr, NULL);
173-
buttonTime = lv_img_create(scr, NULL);
174-
buttonZpos = lv_img_create(scr, NULL);
170+
lv_obj_t *buttonFanstate = lv_img_create(scr, NULL);
171+
lv_obj_t *buttonTime = lv_img_create(scr, NULL);
172+
lv_obj_t *buttonZpos = lv_img_create(scr, NULL);
175173
buttonPause = lv_imgbtn_create(scr, NULL);
176174
buttonStop = lv_imgbtn_create(scr, NULL);
177175
buttonOperat = lv_imgbtn_create(scr, NULL);

Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -799,39 +799,39 @@ void lv_encoder_pin_init() {
799799
//static const int8_t encoderDirection = 1;
800800
//static int16_t enc_Direction;
801801
void lv_update_encoder() {
802-
static uint8_t buttons;
803802
static uint32_t encoder_time1;
804803
uint32_t tmpTime, diffTime = 0;
805804
tmpTime = millis();
806805
diffTime = getTickDiff(tmpTime, encoder_time1);
807806
if (diffTime > 50) {
808807

809-
#if ANY_BUTTON(EN1, EN2, ENC, BACK)
808+
#if HAS_ENCODER_WHEEL
810809

811-
uint8_t newbutton = 0;
810+
#if ANY_BUTTON(EN1, EN2, ENC, BACK)
812811

813-
#if BUTTON_EXISTS(EN1)
814-
if (BUTTON_PRESSED(EN1)) newbutton |= EN_A;
815-
#endif
816-
#if BUTTON_EXISTS(EN2)
817-
if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
818-
#endif
819-
#if BUTTON_EXISTS(ENC)
820-
if (BUTTON_PRESSED(ENC)) newbutton |= EN_C;
821-
#endif
822-
#if BUTTON_EXISTS(BACK)
823-
if (BUTTON_PRESSED(BACK)) newbutton |= EN_D;
824-
#endif
812+
uint8_t newbutton = 0;
825813

826-
#else
814+
#if BUTTON_EXISTS(EN1)
815+
if (BUTTON_PRESSED(EN1)) newbutton |= EN_A;
816+
#endif
817+
#if BUTTON_EXISTS(EN2)
818+
if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
819+
#endif
820+
#if BUTTON_EXISTS(ENC)
821+
if (BUTTON_PRESSED(ENC)) newbutton |= EN_C;
822+
#endif
823+
#if BUTTON_EXISTS(BACK)
824+
if (BUTTON_PRESSED(BACK)) newbutton |= EN_D;
825+
#endif
827826

828-
constexpr uint8_t newbutton = 0;
827+
#else
829828

830-
#endif
829+
constexpr uint8_t newbutton = 0;
831830

832-
buttons = newbutton;
831+
#endif
833832

834-
#if HAS_ENCODER_WHEEL
833+
834+
static uint8_t buttons = newbutton;
835835
static uint8_t lastEncoderBits;
836836

837837
#define encrot0 0

0 commit comments

Comments
 (0)