Skip to content

Commit a6377e5

Browse files
committed
🐛 Fix misc. build issues
1 parent 0459407 commit a6377e5

File tree

12 files changed

+99
-53
lines changed

12 files changed

+99
-53
lines changed

.github/workflows/ci-build-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121
branches:
2222
- bugfix-2.1.x
2323
- 2.1.x
24+
- release-*
2425
paths-ignore:
2526
- config/**
2627
- data/**

Marlin/src/feature/digipot/digipot_mcp4451.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,13 @@ void DigipotI2C::init() {
8787
Wire.begin();
8888
#endif
8989
// Set up initial currents as defined in Configuration_adv.h
90-
static const float digipot_motor_current[] PROGMEM = TERN(DIGIPOT_USE_RAW_VALUES, DIGIPOT_MOTOR_CURRENT, DIGIPOT_I2C_MOTOR_CURRENTS);
90+
static const float digipot_motor_current[] PROGMEM =
91+
#if ENABLED(DIGIPOT_USE_RAW_VALUES)
92+
DIGIPOT_MOTOR_CURRENT
93+
#else
94+
DIGIPOT_I2C_MOTOR_CURRENTS
95+
#endif
96+
;
9197
for (uint8_t i = 0; i < COUNT(digipot_motor_current); ++i)
9298
set_current(i, pgm_read_float(&digipot_motor_current[i]));
9399
}

Marlin/src/feature/powerloss.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,11 @@ void PrintJobRecovery::resume() {
420420
#endif
421421

422422
// Interpret the saved Z according to flags
423-
const float z_print = resume_pos.z,
424-
z_raised = z_print + info.zraise;
423+
const float z_print = resume_pos.z;
424+
425+
#if ANY(Z_HOME_TO_MAX, POWER_LOSS_RECOVER_ZHOME) || DISABLED(BELTPRINTER)
426+
const float z_raised = z_print + info.zraise;
427+
#endif
425428

426429
//
427430
// Home the axes that can safely be homed, and

Marlin/src/feature/tmc_util.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,13 @@
290290
SString<50>(F(" driver overtemperature warning! ("), st.getMilliamps(), F("mA)")).echoln();
291291
}
292292

293-
template<typename TMC>
294-
void report_polled_driver_data(TMC &st, const TMC_driver_data &data) {
295-
const uint32_t pwm_scale = get_pwm_scale(st);
296-
st.printLabel();
297-
SString<60> report(':', pwm_scale);
298-
#if ENABLED(TMC_DEBUG)
293+
#if ENABLED(TMC_DEBUG)
294+
295+
template<typename TMC>
296+
void report_polled_driver_data(TMC &st, const TMC_driver_data &data) {
297+
const uint32_t pwm_scale = get_pwm_scale(st);
298+
st.printLabel();
299+
SString<60> report(':', pwm_scale);
299300
#if HAS_TMCX1X0_OR_2240 || HAS_TMC220x
300301
report.append('/', data.cs_actual);
301302
#endif
@@ -306,22 +307,21 @@
306307
else
307308
report += '-';
308309
#endif
309-
#endif
310-
report += '|';
311-
if (st.error_count) report += 'E'; // Error
312-
if (data.is_ot) report += 'O'; // Over-temperature
313-
if (data.is_otpw) report += 'W'; // over-temperature pre-Warning
314-
#if ENABLED(TMC_DEBUG)
310+
report += '|';
311+
if (st.error_count) report += 'E'; // Error
312+
if (data.is_ot) report += 'O'; // Over-temperature
313+
if (data.is_otpw) report += 'W'; // over-temperature pre-Warning
315314
if (data.is_stall) report += 'G'; // stallGuard
316315
if (data.is_stealth) report += 'T'; // stealthChop
317316
if (data.is_standstill) report += 'I'; // standstIll
318-
#endif
319-
if (st.flag_otpw) report += 'F'; // otpw Flag
320-
report += '|';
321-
if (st.otpw_count > 0) report += st.otpw_count;
322-
report += '\t';
323-
report.echo();
324-
}
317+
if (st.flag_otpw) report += 'F'; // otpw Flag
318+
report += '|';
319+
if (st.otpw_count > 0) report += st.otpw_count;
320+
report += '\t';
321+
report.echo();
322+
}
323+
324+
#endif // TMC_DEBUG
325325

326326
#if CURRENT_STEP_DOWN > 0
327327

Marlin/src/lcd/HD44780/marlinui_HD44780.cpp

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -853,9 +853,18 @@ void MarlinUI::draw_status_message(const bool blink) {
853853
if (printJobOngoing()) {
854854
char buffer[8];
855855
const duration_t remaint = get_remaining_time();
856-
const uint8_t timepos = TPOFFSET - remaint.toDigital(buffer);
857-
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
858-
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'R');
856+
#if LCD_INFO_SCREEN_STYLE == 0
857+
const uint8_t timepos = TPOFFSET - remaint.toDigital(buffer);
858+
lcd_put_lchar(timepos - 1, 2, ' ');
859+
#endif
860+
lcd_put_lchar(
861+
#if LCD_INFO_SCREEN_STYLE == 0
862+
timepos
863+
#else
864+
11
865+
#endif
866+
, 2, 'R'
867+
);
859868
lcd_put_u8str(buffer);
860869
}
861870
}
@@ -866,9 +875,18 @@ void MarlinUI::draw_status_message(const bool blink) {
866875
const duration_t interactt = interaction_time;
867876
if (printingIsActive() && interactt.value) {
868877
char buffer[8];
869-
const uint8_t timepos = TPOFFSET - interactt.toDigital(buffer);
870-
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
871-
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'C');
878+
#if LCD_INFO_SCREEN_STYLE == 0
879+
const uint8_t timepos = TPOFFSET - interactt.toDigital(buffer);
880+
lcd_put_lchar(timepos - 1, 2, ' ');
881+
#endif
882+
lcd_put_lchar(
883+
#if LCD_INFO_SCREEN_STYLE == 0
884+
timepos
885+
#else
886+
11
887+
#endif
888+
, 2, 'C'
889+
);
872890
lcd_put_u8str(buffer);
873891
}
874892
}
@@ -879,9 +897,18 @@ void MarlinUI::draw_status_message(const bool blink) {
879897
if (printJobOngoing()) {
880898
char buffer[8];
881899
const duration_t elapsedt = print_job_timer.duration();
882-
const uint8_t timepos = TPOFFSET - elapsedt.toDigital(buffer);
883-
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
884-
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'E');
900+
#if LCD_INFO_SCREEN_STYLE == 0
901+
const uint8_t timepos = TPOFFSET - elapsedt.toDigital(buffer);
902+
lcd_put_lchar(timepos - 1, 2, ' ');
903+
#endif
904+
lcd_put_lchar(
905+
#if LCD_INFO_SCREEN_STYLE == 0
906+
timepos
907+
#else
908+
11
909+
#endif
910+
, 2, 'E'
911+
);
885912
lcd_put_u8str(buffer);
886913
}
887914
}

Marlin/src/lcd/extui/mks_ui/draw_advance_settings.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ void lv_draw_advance_settings() {
7474
scr = lv_screen_create(ADVANCED_UI, machine_menu.AdvancedConfTitle);
7575

7676
int index = 0;
77-
lv_screen_menu_item(scr, machine_menu.PausePosition, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_POS, index++);
78-
lv_screen_menu_item(scr, machine_menu.FilamentConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FILAMENT_SETTINGS, index++);
77+
lv_screen_menu_item(scr, machine_menu.PausePosition, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_POS, index);
78+
index++;
79+
lv_screen_menu_item(scr, machine_menu.FilamentConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FILAMENT_SETTINGS, index);
80+
index++;
7981
#if ENABLED(MKS_WIFI_MODULE)
80-
lv_screen_menu_item(scr, machine_menu.WifiSettings, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_WIFI_PARA, index++);
82+
lv_screen_menu_item(scr, machine_menu.WifiSettings, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_WIFI_PARA, index);
83+
index++;
8184
#endif
8285
#if HAS_ROTARY_ENCODER
8386
lv_screen_menu_item(scr, machine_menu.EncoderSettings, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_ENCODER_SETTINGS, index);

Marlin/src/lcd/extui/mks_ui/draw_motor_settings.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,21 @@ void lv_draw_motor_settings() {
6969
scr = lv_screen_create(MOTOR_SETTINGS_UI, machine_menu.MotorConfTitle);
7070

7171
#if ENABLED(EDITABLE_STEPS_PER_UNIT)
72-
lv_screen_menu_item(scr, machine_menu.StepsConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MOTOR_STEPS, index++);
72+
lv_screen_menu_item(scr, machine_menu.StepsConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MOTOR_STEPS, index);
73+
index++;
7374
#endif
7475

7576
#if USE_SENSORLESS
76-
lv_screen_menu_item(scr, machine_menu.HomingSensitivityConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_HOME_SENSE, index++);
77+
lv_screen_menu_item(scr, machine_menu.HomingSensitivityConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_HOME_SENSE, index);
78+
index++;
7779
#endif
7880

7981
#if HAS_TRINAMIC_CONFIG
80-
lv_screen_menu_item(scr, machine_menu.TMCcurrentConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_MOTOR_TMC_CURRENT, index++);
82+
lv_screen_menu_item(scr, machine_menu.TMCcurrentConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_MOTOR_TMC_CURRENT, index);
83+
index++;
8184
#if HAS_STEALTHCHOP
82-
lv_screen_menu_item(scr, machine_menu.TMCStepModeConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_MOTOR_STEP_MODE, index++);
85+
lv_screen_menu_item(scr, machine_menu.TMCStepModeConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_MOTOR_STEP_MODE, index);
86+
index++;
8387
#endif
8488
#endif
8589
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_MOTOR_RETURN, true);

Marlin/src/lcd/extui/mks_ui/wifi_module.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,6 @@ uint8_t exploreDisk(const char * const path, const uint8_t recu_level, const boo
887887

888888
const int16_t fileCnt = card.get_num_items();
889889

890-
MediaFile file;
891-
MediaFile *diveDir;
892890
for (int16_t i = 0; i < fileCnt; i++) {
893891
card.selectFileByIndexSorted(i);
894892

@@ -913,7 +911,7 @@ uint8_t exploreDisk(const char * const path, const uint8_t recu_level, const boo
913911
}
914912

915913
static void wifi_gcode_exec(uint8_t * const cmd_line) {
916-
int8_t tempBuf[100] = { 0 };
914+
char tempBuf[100] = { '\0' };
917915
int cmd_value;
918916
volatile int print_rate;
919917

@@ -961,7 +959,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
961959
while (mStr[index] == ' ') index++;
962960

963961
if (gCfgItems.wifi_type == ESP_WIFI) {
964-
char * const path = (char *)tempBuf;
962+
char * const path = tempBuf;
965963
if (strlen(&mStr[index]) < 80) {
966964
print_to_wifi(STR_BEGIN_FILE_LIST "\r\n");
967965

@@ -1149,7 +1147,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
11491147
if (uiCfg.print_state == WORKING || uiCfg.print_state == PAUSED|| uiCfg.print_state == REPRINTING) {
11501148
print_rate = uiCfg.totalSend;
11511149
ZERO(tempBuf);
1152-
sprintf_P((char *)tempBuf, PSTR("M27 %d\r\n"), print_rate);
1150+
sprintf_P(tempBuf, PSTR("M27 %d\r\n"), print_rate);
11531151
print_to_wifi(tempBuf);
11541152
}
11551153
break;
@@ -1166,11 +1164,11 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
11661164

11671165
if (gCfgItems.fileSysType == FILE_SYS_SD) {
11681166
ZERO(tempBuf);
1169-
sprintf_P((char *)tempBuf, PSTR("%s"), file_writer.saveFileName);
1167+
sprintf_P(tempBuf, PSTR("%s"), file_writer.saveFileName);
11701168
}
11711169
else if (gCfgItems.fileSysType == FILE_SYS_USB) {
11721170
ZERO(tempBuf);
1173-
sprintf_P((char *)tempBuf, PSTR("%s"), (char *)file_writer.saveFileName);
1171+
sprintf_P(tempBuf, PSTR("%s"), (char *)file_writer.saveFileName);
11741172
}
11751173
mount_file_sys(gCfgItems.fileSysType);
11761174

@@ -1181,7 +1179,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
11811179
ZERO(file_writer.saveFileName);
11821180
strcpy((char *)file_writer.saveFileName, &mStr[index]);
11831181
ZERO(tempBuf);
1184-
sprintf_P((char *)tempBuf, PSTR("Writing to file: %s\r\n"), (char *)file_writer.saveFileName);
1182+
sprintf_P(tempBuf, PSTR("Writing to file: %s\r\n"), (char *)file_writer.saveFileName);
11851183
wifi_ret_ack();
11861184
print_to_wifi(tempBuf);
11871185
wifi_link_state = WIFI_WAIT_TRANS_START;
@@ -1203,7 +1201,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
12031201

12041202
send_ok_to_wifi();
12051203

1206-
char *outBuf = (char *)tempBuf;
1204+
char *outBuf = tempBuf;
12071205
char tbuf[34];
12081206

12091207
sprintf_P(tbuf, PSTR("%d /%d"), thermalManager.wholeDegHotend(0), thermalManager.degTargetHotend(0));
@@ -1237,7 +1235,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
12371235
strcat_P(outBuf, PSTR(" @:0 B@:0\r\n"));
12381236
}
12391237
else {
1240-
sprintf_P((char *)tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
1238+
sprintf_P(tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
12411239
thermalManager.wholeDegHotend(0), thermalManager.degTargetHotend(0),
12421240
TERN0(HAS_HEATED_BED, thermalManager.wholeDegBed()),
12431241
TERN0(HAS_HEATED_BED, thermalManager.degTargetBed()),
@@ -1254,7 +1252,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
12541252
case 992:
12551253
if (uiCfg.print_state == WORKING || uiCfg.print_state == PAUSED) {
12561254
ZERO(tempBuf);
1257-
sprintf_P((char *)tempBuf, PSTR("M992 %d%d:%d%d:%d%d\r\n"), print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10);
1255+
sprintf_P(tempBuf, PSTR("M992 %d%d:%d%d:%d%d\r\n"), print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10);
12581256
wifi_ret_ack();
12591257
print_to_wifi(tempBuf);
12601258
}
@@ -1264,7 +1262,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
12641262
if (uiCfg.print_state == WORKING || uiCfg.print_state == PAUSED) {
12651263
ZERO(tempBuf);
12661264
if (strlen((char *)list_file.file_name[sel_id]) > (100 - 1)) return;
1267-
sprintf_P((char *)tempBuf, PSTR("M994 %s;%d\n"), list_file.file_name[sel_id], (int)gCfgItems.curFilesize);
1265+
sprintf_P(tempBuf, PSTR("M994 %s;%d\n"), list_file.file_name[sel_id], (int)gCfgItems.curFilesize);
12681266
wifi_ret_ack();
12691267
print_to_wifi(tempBuf);
12701268
}

Marlin/src/module/probe.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ xyz_pos_t Probe::offset; // Initialized by settings.load
107107

108108
#if HAS_PROBE_XY_OFFSET
109109
const xy_pos_t &Probe::offset_xy = Probe::offset;
110+
#else
111+
constexpr xy_pos_t Probe::offset_xy;
110112
#endif
111113

112114
#if ENABLED(SENSORLESS_PROBING)

buildroot/bin/build_example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ echo "Building example $CONFIG..."
188188
# If doing many builds get a list of all environment names,
189189
# which also gives us the number of environments.
190190
if ((MANY)); then
191-
ENVLIST=$(mfenvs) # BOARD_NAME_STRING (1234): [ env1 env2 env3 ... ]
191+
ENVLIST=$(mfenvs -n) # BOARD_NAME_STRING (1234): [ env1 env2 env3 ... ]
192192
ENVLIST=${ENVLIST##*: [ }
193193
ENVARRAY=(${ENVLIST% ]})
194194
ENVCOUNT=${#ENVARRAY[*]}
@@ -236,7 +236,7 @@ while ((1)); do
236236
fi
237237

238238
# When building many, create sub-folders for each build env name
239-
if [[ -n $MANY && $ENVCOUNT -gt 1 ]]; then
239+
if [[ -n $MANY ]]; then
240240
ENV=${ENVARRAY[BUILDINDEX-1]}
241241
ARCENVSUB="$ARCSUB/$ENV"
242242
else

0 commit comments

Comments
 (0)