🐛 Fix misc. build issues
Some checks are pending
CI - Build Tests / Build Test (push) Waiting to run
CI - Unit Tests / Unit Test (push) Waiting to run

This commit is contained in:
Scott Lahteine 2025-06-23 13:18:34 -05:00
parent 0459407a8e
commit a6377e5215
12 changed files with 99 additions and 53 deletions

View file

@ -21,6 +21,7 @@ on:
branches:
- bugfix-2.1.x
- 2.1.x
- release-*
paths-ignore:
- config/**
- data/**

View file

@ -87,7 +87,13 @@ void DigipotI2C::init() {
Wire.begin();
#endif
// Set up initial currents as defined in Configuration_adv.h
static const float digipot_motor_current[] PROGMEM = TERN(DIGIPOT_USE_RAW_VALUES, DIGIPOT_MOTOR_CURRENT, DIGIPOT_I2C_MOTOR_CURRENTS);
static const float digipot_motor_current[] PROGMEM =
#if ENABLED(DIGIPOT_USE_RAW_VALUES)
DIGIPOT_MOTOR_CURRENT
#else
DIGIPOT_I2C_MOTOR_CURRENTS
#endif
;
for (uint8_t i = 0; i < COUNT(digipot_motor_current); ++i)
set_current(i, pgm_read_float(&digipot_motor_current[i]));
}

View file

@ -420,8 +420,11 @@ void PrintJobRecovery::resume() {
#endif
// Interpret the saved Z according to flags
const float z_print = resume_pos.z,
z_raised = z_print + info.zraise;
const float z_print = resume_pos.z;
#if ANY(Z_HOME_TO_MAX, POWER_LOSS_RECOVER_ZHOME) || DISABLED(BELTPRINTER)
const float z_raised = z_print + info.zraise;
#endif
//
// Home the axes that can safely be homed, and

View file

@ -290,12 +290,13 @@
SString<50>(F(" driver overtemperature warning! ("), st.getMilliamps(), F("mA)")).echoln();
}
template<typename TMC>
void report_polled_driver_data(TMC &st, const TMC_driver_data &data) {
const uint32_t pwm_scale = get_pwm_scale(st);
st.printLabel();
SString<60> report(':', pwm_scale);
#if ENABLED(TMC_DEBUG)
#if ENABLED(TMC_DEBUG)
template<typename TMC>
void report_polled_driver_data(TMC &st, const TMC_driver_data &data) {
const uint32_t pwm_scale = get_pwm_scale(st);
st.printLabel();
SString<60> report(':', pwm_scale);
#if HAS_TMCX1X0_OR_2240 || HAS_TMC220x
report.append('/', data.cs_actual);
#endif
@ -306,22 +307,21 @@
else
report += '-';
#endif
#endif
report += '|';
if (st.error_count) report += 'E'; // Error
if (data.is_ot) report += 'O'; // Over-temperature
if (data.is_otpw) report += 'W'; // over-temperature pre-Warning
#if ENABLED(TMC_DEBUG)
report += '|';
if (st.error_count) report += 'E'; // Error
if (data.is_ot) report += 'O'; // Over-temperature
if (data.is_otpw) report += 'W'; // over-temperature pre-Warning
if (data.is_stall) report += 'G'; // stallGuard
if (data.is_stealth) report += 'T'; // stealthChop
if (data.is_standstill) report += 'I'; // standstIll
#endif
if (st.flag_otpw) report += 'F'; // otpw Flag
report += '|';
if (st.otpw_count > 0) report += st.otpw_count;
report += '\t';
report.echo();
}
if (st.flag_otpw) report += 'F'; // otpw Flag
report += '|';
if (st.otpw_count > 0) report += st.otpw_count;
report += '\t';
report.echo();
}
#endif // TMC_DEBUG
#if CURRENT_STEP_DOWN > 0

View file

@ -853,9 +853,18 @@ void MarlinUI::draw_status_message(const bool blink) {
if (printJobOngoing()) {
char buffer[8];
const duration_t remaint = get_remaining_time();
const uint8_t timepos = TPOFFSET - remaint.toDigital(buffer);
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'R');
#if LCD_INFO_SCREEN_STYLE == 0
const uint8_t timepos = TPOFFSET - remaint.toDigital(buffer);
lcd_put_lchar(timepos - 1, 2, ' ');
#endif
lcd_put_lchar(
#if LCD_INFO_SCREEN_STYLE == 0
timepos
#else
11
#endif
, 2, 'R'
);
lcd_put_u8str(buffer);
}
}
@ -866,9 +875,18 @@ void MarlinUI::draw_status_message(const bool blink) {
const duration_t interactt = interaction_time;
if (printingIsActive() && interactt.value) {
char buffer[8];
const uint8_t timepos = TPOFFSET - interactt.toDigital(buffer);
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'C');
#if LCD_INFO_SCREEN_STYLE == 0
const uint8_t timepos = TPOFFSET - interactt.toDigital(buffer);
lcd_put_lchar(timepos - 1, 2, ' ');
#endif
lcd_put_lchar(
#if LCD_INFO_SCREEN_STYLE == 0
timepos
#else
11
#endif
, 2, 'C'
);
lcd_put_u8str(buffer);
}
}
@ -879,9 +897,18 @@ void MarlinUI::draw_status_message(const bool blink) {
if (printJobOngoing()) {
char buffer[8];
const duration_t elapsedt = print_job_timer.duration();
const uint8_t timepos = TPOFFSET - elapsedt.toDigital(buffer);
IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20));
lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'E');
#if LCD_INFO_SCREEN_STYLE == 0
const uint8_t timepos = TPOFFSET - elapsedt.toDigital(buffer);
lcd_put_lchar(timepos - 1, 2, ' ');
#endif
lcd_put_lchar(
#if LCD_INFO_SCREEN_STYLE == 0
timepos
#else
11
#endif
, 2, 'E'
);
lcd_put_u8str(buffer);
}
}

View file

@ -74,10 +74,13 @@ void lv_draw_advance_settings() {
scr = lv_screen_create(ADVANCED_UI, machine_menu.AdvancedConfTitle);
int index = 0;
lv_screen_menu_item(scr, machine_menu.PausePosition, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_POS, index++);
lv_screen_menu_item(scr, machine_menu.FilamentConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FILAMENT_SETTINGS, index++);
lv_screen_menu_item(scr, machine_menu.PausePosition, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_POS, index);
index++;
lv_screen_menu_item(scr, machine_menu.FilamentConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FILAMENT_SETTINGS, index);
index++;
#if ENABLED(MKS_WIFI_MODULE)
lv_screen_menu_item(scr, machine_menu.WifiSettings, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_WIFI_PARA, index++);
lv_screen_menu_item(scr, machine_menu.WifiSettings, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_WIFI_PARA, index);
index++;
#endif
#if HAS_ROTARY_ENCODER
lv_screen_menu_item(scr, machine_menu.EncoderSettings, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_ENCODER_SETTINGS, index);

View file

@ -69,17 +69,21 @@ void lv_draw_motor_settings() {
scr = lv_screen_create(MOTOR_SETTINGS_UI, machine_menu.MotorConfTitle);
#if ENABLED(EDITABLE_STEPS_PER_UNIT)
lv_screen_menu_item(scr, machine_menu.StepsConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MOTOR_STEPS, index++);
lv_screen_menu_item(scr, machine_menu.StepsConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MOTOR_STEPS, index);
index++;
#endif
#if USE_SENSORLESS
lv_screen_menu_item(scr, machine_menu.HomingSensitivityConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_HOME_SENSE, index++);
lv_screen_menu_item(scr, machine_menu.HomingSensitivityConf, PARA_UI_POS_X, PARA_UI_POS_Y * (index + 1), event_handler, ID_HOME_SENSE, index);
index++;
#endif
#if HAS_TRINAMIC_CONFIG
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++);
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);
index++;
#if HAS_STEALTHCHOP
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++);
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);
index++;
#endif
#endif
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);

View file

@ -887,8 +887,6 @@ uint8_t exploreDisk(const char * const path, const uint8_t recu_level, const boo
const int16_t fileCnt = card.get_num_items();
MediaFile file;
MediaFile *diveDir;
for (int16_t i = 0; i < fileCnt; i++) {
card.selectFileByIndexSorted(i);
@ -913,7 +911,7 @@ uint8_t exploreDisk(const char * const path, const uint8_t recu_level, const boo
}
static void wifi_gcode_exec(uint8_t * const cmd_line) {
int8_t tempBuf[100] = { 0 };
char tempBuf[100] = { '\0' };
int cmd_value;
volatile int print_rate;
@ -961,7 +959,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
while (mStr[index] == ' ') index++;
if (gCfgItems.wifi_type == ESP_WIFI) {
char * const path = (char *)tempBuf;
char * const path = tempBuf;
if (strlen(&mStr[index]) < 80) {
print_to_wifi(STR_BEGIN_FILE_LIST "\r\n");
@ -1149,7 +1147,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
if (uiCfg.print_state == WORKING || uiCfg.print_state == PAUSED|| uiCfg.print_state == REPRINTING) {
print_rate = uiCfg.totalSend;
ZERO(tempBuf);
sprintf_P((char *)tempBuf, PSTR("M27 %d\r\n"), print_rate);
sprintf_P(tempBuf, PSTR("M27 %d\r\n"), print_rate);
print_to_wifi(tempBuf);
}
break;
@ -1166,11 +1164,11 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
if (gCfgItems.fileSysType == FILE_SYS_SD) {
ZERO(tempBuf);
sprintf_P((char *)tempBuf, PSTR("%s"), file_writer.saveFileName);
sprintf_P(tempBuf, PSTR("%s"), file_writer.saveFileName);
}
else if (gCfgItems.fileSysType == FILE_SYS_USB) {
ZERO(tempBuf);
sprintf_P((char *)tempBuf, PSTR("%s"), (char *)file_writer.saveFileName);
sprintf_P(tempBuf, PSTR("%s"), (char *)file_writer.saveFileName);
}
mount_file_sys(gCfgItems.fileSysType);
@ -1181,7 +1179,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
ZERO(file_writer.saveFileName);
strcpy((char *)file_writer.saveFileName, &mStr[index]);
ZERO(tempBuf);
sprintf_P((char *)tempBuf, PSTR("Writing to file: %s\r\n"), (char *)file_writer.saveFileName);
sprintf_P(tempBuf, PSTR("Writing to file: %s\r\n"), (char *)file_writer.saveFileName);
wifi_ret_ack();
print_to_wifi(tempBuf);
wifi_link_state = WIFI_WAIT_TRANS_START;
@ -1203,7 +1201,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
send_ok_to_wifi();
char *outBuf = (char *)tempBuf;
char *outBuf = tempBuf;
char tbuf[34];
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) {
strcat_P(outBuf, PSTR(" @:0 B@:0\r\n"));
}
else {
sprintf_P((char *)tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
sprintf_P(tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
thermalManager.wholeDegHotend(0), thermalManager.degTargetHotend(0),
TERN0(HAS_HEATED_BED, thermalManager.wholeDegBed()),
TERN0(HAS_HEATED_BED, thermalManager.degTargetBed()),
@ -1254,7 +1252,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
case 992:
if (uiCfg.print_state == WORKING || uiCfg.print_state == PAUSED) {
ZERO(tempBuf);
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);
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);
wifi_ret_ack();
print_to_wifi(tempBuf);
}
@ -1264,7 +1262,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
if (uiCfg.print_state == WORKING || uiCfg.print_state == PAUSED) {
ZERO(tempBuf);
if (strlen((char *)list_file.file_name[sel_id]) > (100 - 1)) return;
sprintf_P((char *)tempBuf, PSTR("M994 %s;%d\n"), list_file.file_name[sel_id], (int)gCfgItems.curFilesize);
sprintf_P(tempBuf, PSTR("M994 %s;%d\n"), list_file.file_name[sel_id], (int)gCfgItems.curFilesize);
wifi_ret_ack();
print_to_wifi(tempBuf);
}

View file

@ -107,6 +107,8 @@ xyz_pos_t Probe::offset; // Initialized by settings.load
#if HAS_PROBE_XY_OFFSET
const xy_pos_t &Probe::offset_xy = Probe::offset;
#else
constexpr xy_pos_t Probe::offset_xy;
#endif
#if ENABLED(SENSORLESS_PROBING)

View file

@ -188,7 +188,7 @@ echo "Building example $CONFIG..."
# If doing many builds get a list of all environment names,
# which also gives us the number of environments.
if ((MANY)); then
ENVLIST=$(mfenvs) # BOARD_NAME_STRING (1234): [ env1 env2 env3 ... ]
ENVLIST=$(mfenvs -n) # BOARD_NAME_STRING (1234): [ env1 env2 env3 ... ]
ENVLIST=${ENVLIST##*: [ }
ENVARRAY=(${ENVLIST% ]})
ENVCOUNT=${#ENVARRAY[*]}
@ -236,7 +236,7 @@ while ((1)); do
fi
# When building many, create sub-folders for each build env name
if [[ -n $MANY && $ENVCOUNT -gt 1 ]]; then
if [[ -n $MANY ]]; then
ENV=${ENVARRAY[BUILDINDEX-1]}
ARCENVSUB="$ARCSUB/$ENV"
else

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
#
# mfenvs Print the current board and environment information
# Use -n to remove "*_xfer" environments from the list.
# Output -> "SHORT_NAME (###): [ env1 env2 env3 ... ]"
#
@ -27,6 +28,7 @@ BLINE=$( grep -E "define\s+BOARD_$MB\b" Marlin/src/core/boards.h )
BNUM=$( sed -E 's/^.+BOARD_[^ ]+ +([0-9]+).+$/\1/' <<<"$BLINE" )
[[ -z $BNUM ]] && { echo "Error - Can't find BOARD_$MB in core/boards.h." ; exit 1 ; }
ENVS=( $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E "#include.+//.+(env|$SYS):[^ ]+" | grep -oE "(env|$SYS):[^ ]+" | sed -E "s/(env|$SYS)://" ) )
[[ "$1" = "-n" ]] && ENVS=( $(printf "%s\n" "${ENVS[@]}" | grep -v "_xfer$") )
[[ -z $ENVS ]] && { errout "Error - Can't find target(s) for $MB ($BNUM)." ; exit 1 ; }
ECOUNT=${#ENVS[*]}
[[ $ECOUNT == 1 ]] && EOUT=$ENVS || EOUT="${ENVS[@]}"

View file

@ -270,7 +270,7 @@ board_build.ldscript = mks_robin_pro.ld
#
[env:trigorilla_pro_maple]
extends = env:mks_robin_maple
build_flags = ${env:mks_robin_maple} -DSTM32_FLASH_SIZE=512
build_flags = ${env:mks_robin_maple.build_flags} -DSTM32_FLASH_SIZE=512
#
# MKS Robin E3D (STM32F103RCT6) and