diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index a9e6d4928f07..7e224ae61c77 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2092,7 +2092,7 @@ //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping #if ENABLED(BABYSTEP_ZPROBE_OFFSET) //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets - //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + //#define BABYSTEP_GFX_OVERLAY // Enable graphical overlay on Z-offset editor #endif #endif diff --git a/Marlin/src/feature/bedlevel/abl/bbl.cpp b/Marlin/src/feature/bedlevel/abl/bbl.cpp index be0e862cc16a..d0044303c791 100644 --- a/Marlin/src/feature/bedlevel/abl/bbl.cpp +++ b/Marlin/src/feature/bedlevel/abl/bbl.cpp @@ -153,7 +153,7 @@ void LevelingBilinear::extrapolate_unprobed_bed_level() { } } -void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values /*= NULL*/) { +void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values/*=nullptr*/) { // print internal grid(s) or just the one passed as a parameter SERIAL_ECHOLNPGM("Bilinear Leveling Grid:"); print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3, _z_values ? *_z_values[0] : z_values[0]); diff --git a/Marlin/src/feature/bedlevel/abl/bbl.h b/Marlin/src/feature/bedlevel/abl/bbl.h index c2be4fee821c..60dde9060f58 100644 --- a/Marlin/src/feature/bedlevel/abl/bbl.h +++ b/Marlin/src/feature/bedlevel/abl/bbl.h @@ -53,7 +53,7 @@ class LevelingBilinear { static void reset(); static void set_grid(const xy_pos_t& _grid_spacing, const xy_pos_t& _grid_start); static void extrapolate_unprobed_bed_level(); - static void print_leveling_grid(const bed_mesh_t* _z_values = NULL); + static void print_leveling_grid(const bed_mesh_t *_z_values=nullptr); static void refresh_bed_level(); static bool has_mesh() { return !!grid_spacing.x; } static bool mesh_is_valid() { return has_mesh(); } diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 85bdba8a8e06..98259755290f 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -670,6 +670,8 @@ #error "MILLISECONDS_PREHEAT_TIME is now PREHEAT_TIME_HOTEND_MS." #elif defined(EXPERIMENTAL_SCURVE) #error "EXPERIMENTAL_SCURVE is no longer needed and should be removed." +#elif defined(BABYSTEP_ZPROBE_GFX_OVERLAY) + #error "BABYSTEP_ZPROBE_GFX_OVERLAY is now BABYSTEP_GFX_OVERLAY." #endif // L64xx stepper drivers have been removed @@ -1042,10 +1044,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination" #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE #error "BABYSTEP_ZPROBE_OFFSET requires a probe." - #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI) - #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD." - #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET) - #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET." + #elif ENABLED(BABYSTEP_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI) + #error "BABYSTEP_GFX_OVERLAY requires a Graphical LCD." + #elif ENABLED(BABYSTEP_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET) + #error "BABYSTEP_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET." #elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET #error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS." #elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE) diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 1a86058b943c..aa32fd403f45 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -628,7 +628,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop #endif // AUTO_BED_LEVELING_UBL - #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) + #if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) // // Draw knob rotation => Z motion key for: @@ -746,7 +746,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } } - #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY + #endif // BABYSTEP_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY #endif // HAS_MARLINUI_MENU diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 560b30be0ad9..12d16887d1e1 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -565,7 +565,7 @@ void MarlinUI::draw_status_message(const bool blink) { #endif // AUTO_BED_LEVELING_UBL - #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) + #if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) void MarlinUI::zoffset_overlay(const int8_t dir) { const int rot_up = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCCW, ICON_RotateCW), @@ -587,7 +587,7 @@ void MarlinUI::draw_status_message(const bool blink) { DWIN_ICON_Show(ICON, rot_up, LCD_PIXEL_WIDTH - 10 - 48, arrow_y); } - #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY + #endif // BABYSTEP_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY #endif // HAS_MARLINUI_MENU diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index ae10f0e84ecc..6be56b0dedd2 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1271,7 +1271,6 @@ void EachMomentUpdate() { if ((Printing() != HMI_flag.printing_flag) && !HMI_flag.home_flag) { HMI_flag.printing_flag = Printing(); - DEBUG_ECHOLNPGM("printing_flag: ", HMI_flag.printing_flag); if (HMI_flag.printing_flag) DWIN_Print_Started(); else if (HMI_flag.abort_flag) @@ -1282,7 +1281,6 @@ void EachMomentUpdate() { if ((printingIsPaused() != HMI_flag.pause_flag) && !HMI_flag.home_flag) { HMI_flag.pause_flag = printingIsPaused(); - DEBUG_ECHOLNPGM("pause_flag: ", HMI_flag.pause_flag); if (HMI_flag.pause_flag) DWIN_Print_Pause(); else if (HMI_flag.abort_flag) @@ -1628,7 +1626,6 @@ void DWIN_LevelingDone() { // Started a Print Job void DWIN_Print_Started() { - DEBUG_ECHOLNPGM("DWIN_Print_Started: ", SD_Printing()); TERN_(HAS_GCODE_PREVIEW, if (Host_Printing()) Preview_Invalidate()); _percent_done = 0; _remain_time = 0; @@ -1642,20 +1639,17 @@ void DWIN_Print_Started() { // Pause a print job void DWIN_Print_Pause() { - DEBUG_ECHOLNPGM("DWIN_Print_Pause"); ICON_ResumeOrPause(); } // Resume print job void DWIN_Print_Resume() { - DEBUG_ECHOLNPGM("DWIN_Print_Resume"); ICON_ResumeOrPause(); LCD_MESSAGE(MSG_RESUME_PRINT); } // Ended print job void DWIN_Print_Finished() { - DEBUG_ECHOLNPGM("DWIN_Print_Finished"); TERN_(POWER_LOSS_RECOVERY, if (card.isPrinting()) recovery.cancel()); HMI_flag.pause_flag = false; wait_for_heatup = false; @@ -1666,7 +1660,6 @@ void DWIN_Print_Finished() { // Print was aborted void DWIN_Print_Aborted() { - DEBUG_ECHOLNPGM("DWIN_Print_Aborted"); DWIN_Print_Finished(); } @@ -1714,7 +1707,6 @@ void DWIN_SetColorDefaults() { } void DWIN_SetDataDefaults() { - DEBUG_ECHOLNPGM("DWIN_SetDataDefaults"); DWIN_SetColorDefaults(); DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); TERN_(PIDTEMP, HMI_data.HotendPidT = DEF_HOTENDPIDT); @@ -1738,13 +1730,10 @@ void DWIN_SetDataDefaults() { } void DWIN_CopySettingsTo(char * const buff) { - DEBUG_ECHOLNPGM("DWIN_CopySettingsTo"); - DEBUG_ECHOLNPGM("HMI_data: ", sizeof(HMI_data_t)); memcpy(buff, &HMI_data, eeprom_data_size); } void DWIN_CopySettingsFrom(const char * const buff) { - DEBUG_ECHOLNPGM("DWIN_CopySettingsFrom"); memcpy(&HMI_data, buff, sizeof(HMI_data_t)); if (HMI_data.Text_Color == HMI_data.Background_Color) DWIN_SetColorDefaults(); DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); @@ -1764,18 +1753,14 @@ void DWIN_CopySettingsFrom(const char * const buff) { // Initialize or re-initialize the LCD void MarlinUI::init_lcd() { - DEBUG_ECHOLNPGM("MarlinUI::init_lcd"); delay(750); // wait to wakeup screen const bool hs = DWIN_Handshake(); UNUSED(hs); - DEBUG_ECHOPGM("DWIN_Handshake "); - DEBUG_ECHOLNF(hs ? F("ok.") : F("error.")); DWIN_Frame_SetDir(1); DWIN_JPG_CacheTo1(Language_English); Encoder_Configuration(); } void DWIN_InitScreen() { - DEBUG_ECHOLNPGM("DWIN_InitScreen"); DWIN_SetColorDefaults(); HMI_Init(); // draws boot screen DWINUI::init(); @@ -2034,7 +2019,6 @@ void AutoHome() { queue.inject_P(G28_STR); } #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) const_float_t step_zoffset = round((MenuData.Value / 100.0f) * planner.settings.axis_steps_per_mm[Z_AXIS]) - babystep.accum; if (BABYSTEP_ALLOWED()) babystep.add_steps(Z_AXIS, step_zoffset); - //DEBUG_ECHOLNF(F("BB Steps: "), step_zoffset); #endif } void SetZOffset() { diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index bc489dd1fa8f..f8bcda83530a 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -135,7 +135,7 @@ bool Has_Preview() { Get_Value(buf, ";MAXZ:", fileprop.height); fileprop.height -= tmp; posptr = strstr(buf, tbstart); - if (posptr != NULL) { + if (posptr != nullptr) { fileprop.thumbstart = indx + (posptr - &buf[0]); } else { diff --git a/Marlin/src/lcd/extui/anycubic_chiron/FileNavigator.cpp b/Marlin/src/lcd/extui/anycubic_chiron/FileNavigator.cpp index 0ef818666837..90e332125265 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/FileNavigator.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/FileNavigator.cpp @@ -70,7 +70,6 @@ char FileNavigator::currentfoldername[MAX_PATH_LEN + 1]; // Current folde FileNavigator::FileNavigator() { reset(); } void FileNavigator::reset() { - DEBUG_ECHOLNPGM("reset()"); currentfoldername[0] = '\0'; currentfolderdepth = 0; currentindex = 0; @@ -86,7 +85,6 @@ void FileNavigator::refresh() { filelist.refresh(); } void FileNavigator::changeDIR(const char *folder) { if (currentfolderdepth >= MAX_FOLDER_DEPTH) return; // limit the folder depth - DEBUG_ECHOLNPGM("FD:" , folderdepth, " FP:",currentindex, " currentfolder:", currentfoldername, " enter:", folder); currentfolderindex[currentfolderdepth] = currentindex; strcat(currentfoldername, folder); strcat(currentfoldername, "/"); @@ -96,7 +94,6 @@ void FileNavigator::changeDIR(const char *folder) { } void FileNavigator::upDIR() { - DEBUG_ECHOLNPGM("upDIR() from D:", currentfolderdepth, " N:", currentfoldername); if (!filelist.isAtRootDir()) { filelist.upDir(); currentfolderdepth--; @@ -117,7 +114,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) { if (skip == 0) return; while (skip > 0) { if (filelist.seek(currentindex)) { - DEBUG_ECHOLNPGM("CI:", currentindex, " FD:", currentfolderdepth, " N:", skip, " ", filelist.longFilename()); if (!filelist.isDir()) { skip--; currentindex++; @@ -151,8 +147,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) { } lastpanelindex = index; - DEBUG_ECHOLNPGM("index=", index, " currentindex=", currentindex); - if (currentindex == 0 && currentfolderdepth > 0) { // Add a link to go up a folder // The new panel ignores entries that don't end in .GCO or .gcode so add and pad them. if (paneltype <= AC_panel_new) { @@ -166,12 +160,8 @@ void FileNavigator::skiptofileindex(uint16_t skip) { filesneeded--; } - for (uint16_t seek = currentindex; seek < currentindex + filesneeded; seek++) { - if (filelist.seek(seek)) { - sendFile(paneltype); - DEBUG_ECHOLNPGM("-", seek, " '", filelist.longFilename(), "' '", currentfoldername, "", filelist.shortFilename(), "'"); - } - } + for (uint16_t seek = currentindex; seek < currentindex + filesneeded; seek++) + if (filelist.seek(seek)) sendFile(paneltype); } void FileNavigator::sendFile(panel_type_t paneltype) { @@ -212,7 +202,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) { #else // Flat file list void FileNavigator::getFiles(uint16_t index, panel_type_t paneltype, uint8_t filesneeded) { - DEBUG_ECHOLNPGM("getFiles() I:", index," L:", lastpanelindex); // if we're searching backwards, jump back to start and search forward if (index < lastpanelindex) { reset(); @@ -248,7 +237,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) { TFTSer.println(filelist.shortFilename()); if (currentfolderdepth > 0) TFTSer.print(currentfoldername); TFTSer.println(filelist.longFilename()); - DEBUG_ECHOLNPGM("/", currentfoldername, "", filelist.shortFilename(), " ", filelist.longFilename()); } #endif // Flat file list diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp index 03997fa95bea..774ba55e43a5 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -704,7 +704,7 @@ void AnycubicTFTClass::GetCommandFromTFT() { break; case 16: { // A16 set hotend temp - unsigned int tempvalue; + uint16_t tempvalue; if (CodeSeen('S')) { tempvalue = constrain(CodeValue(), 0, 275); setTargetTemp_celsius(tempvalue, (extruder_t)E0); @@ -719,7 +719,7 @@ void AnycubicTFTClass::GetCommandFromTFT() { break; case 17: { // A17 set heated bed temp - unsigned int tempbed; + uint16_t tempbed; if (CodeSeen('S')) { tempbed = constrain(CodeValue(), 0, 100); setTargetTemp_celsius(tempbed, (heater_t)BED); @@ -777,7 +777,7 @@ void AnycubicTFTClass::GetCommandFromTFT() { case 22: // A22 move X/Y/Z or extrude if (!isPrinting()) { float coorvalue; - unsigned int movespeed = 0; + uint16_t movespeed = 0; char commandStr[30]; char fullCommandStr[38]; diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp index 0eb95bb041ba..2a7d635c6d78 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp @@ -141,7 +141,6 @@ void DGUSDisplay::ProcessRx() { if (!LCD_SERIAL.available() && LCD_SERIAL.buffer_overruns()) { // Overrun, but reset the flag only when the buffer is empty // We want to extract as many as valid datagrams possible... - DEBUG_ECHOPGM("OVFL"); rx_datagram_state = DGUS_IDLE; //LCD_SERIAL.reset_rx_overun(); LCD_SERIAL.flush(); @@ -205,17 +204,11 @@ void DGUSDisplay::ProcessRx() { | Command DataLen (in Words) */ if (command == DGUS_CMD_READVAR) { const uint16_t vp = tmp[0] << 8 | tmp[1]; - //const uint8_t dlen = tmp[2] << 1; // Convert to Bytes. (Display works with words) - //DEBUG_ECHOPGM(" vp=", vp, " dlen=", dlen); DGUS_VP_Variable ramcopy; if (populate_VPVar(vp, &ramcopy)) { if (ramcopy.set_by_display_handler) ramcopy.set_by_display_handler(ramcopy, &tmp[3]); - else - DEBUG_ECHOLNPGM(" VPVar found, no handler."); } - else - DEBUG_ECHOLNPGM(" VPVar not found:", vp); rx_datagram_state = DGUS_IDLE; break; @@ -260,9 +253,7 @@ bool DGUSDisplay::Initialized = false, #define sw_barrier() asm volatile("": : :"memory"); bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy) { - //DEBUG_ECHOPGM("populate_VPVar ", VP); const DGUS_VP_Variable *pvp = DGUSLCD_FindVPVar(VP); - //DEBUG_ECHOLNPGM(" pvp ", (uint16_t )pvp); if (!pvp) return false; memcpy_P(ramcopy, pvp, sizeof(DGUS_VP_Variable)); return true; diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index 82dbeee4112b..b2363c4ee9ab 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -112,8 +112,6 @@ void DGUSScreenHandler::setstatusmessagePGM(PGM_P const msg) { // Send an 8 bit or 16 bit value to the display. void DGUSScreenHandler::DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { - //DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP); - //DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr); if (var.size > 1) dgusdisplay.WriteVariable(var.VP, *(int16_t*)var.memadr); else @@ -124,8 +122,6 @@ void DGUSScreenHandler::DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var) { // Send an uint8_t between 0 and 255 to the display, but scale to a percentage (0..100) void DGUSScreenHandler::DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { - //DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP); - //DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr); uint16_t tmp = *(uint8_t *) var.memadr + 1; // +1 -> avoid rounding issues for the display. tmp = map(tmp, 0, 255, 0, 100); dgusdisplay.WriteVariable(var.VP, tmp); @@ -134,9 +130,7 @@ void DGUSScreenHandler::DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var) { // Send the current print progress to the display. void DGUSScreenHandler::DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var) { - //DEBUG_ECHOPGM(" DGUSLCD_SendPrintProgressToDisplay ", var.VP); uint16_t tmp = ExtUI::getProgress_percent(); - //DEBUG_ECHOLNPGM(" data ", tmp); dgusdisplay.WriteVariable(var.VP, tmp); } @@ -153,9 +147,7 @@ void DGUSScreenHandler::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var) { void DGUSScreenHandler::DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr) { if (var.memadr) { const uint16_t value = BE16_P(val_ptr); - DEBUG_ECHOLNPGM("Got percent:", value); *(uint8_t*)var.memadr = map(constrain(value, 0, 100), 0, 100, 0, 255); - DEBUG_ECHOLNPGM("Set uint8:", *(uint8_t*)var.memadr); } } @@ -236,8 +228,6 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) { void DGUSScreenHandler::DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { - DEBUG_ECHOPGM(" DGUSLCD_SendFanStatusToDisplay ", var.VP); - DEBUG_ECHOLNPGM(" data ", *(uint8_t *)var.memadr); uint16_t data_to_send = 0; if (*(uint8_t *) var.memadr) data_to_send = 1; dgusdisplay.WriteVariable(var.VP, data_to_send); @@ -249,8 +239,6 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) { // Send heater status value to the display. void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { - DEBUG_ECHOPGM(" DGUSLCD_SendHeaterStatusToDisplay ", var.VP); - DEBUG_ECHOLNPGM(" data ", *(int16_t *)var.memadr); uint16_t data_to_send = 0; if (*(int16_t *) var.memadr) data_to_send = 1; dgusdisplay.WriteVariable(var.VP, data_to_send); @@ -263,11 +251,8 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) // In FYSETC UI design there are 10 statuses to loop static uint16_t period = 0; static uint16_t index = 0; - //DEBUG_ECHOPGM(" DGUSLCD_SendWaitingStatusToDisplay ", var.VP); - //DEBUG_ECHOLNPGM(" data ", BE16_P(&index)); if (period++ > DGUS_UI_WAITING_STATUS_PERIOD) { dgusdisplay.WriteVariable(var.VP, index); - //DEBUG_ECHOLNPGM(" data ", BE16_P(&index)); if (++index >= DGUS_UI_WAITING_STATUS) index = 0; period = 0; } @@ -309,17 +294,14 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) const int16_t scroll = (int16_t)BE16_P(val_ptr); if (scroll) { top_file += scroll; - DEBUG_ECHOPGM("new topfile calculated:", top_file); if (top_file < 0) { top_file = 0; - DEBUG_ECHOLNPGM("Top of filelist reached"); } else { int16_t max_top = filelist.count() - DGUS_SD_FILESPERSCREEN; NOLESS(max_top, 0); NOMORE(top_file, max_top); } - DEBUG_ECHOPGM("new topfile adjusted:", top_file); } else if (!filelist.isAtRootDir()) { IF_DISABLED(DGUS_LCD_UI_MKS, filelist.upDir()); @@ -374,7 +356,6 @@ const DGUS_VP_Variable* DGUSLCD_FindVPVar(const uint16_t vp) { ++ret; } while (1); - DEBUG_ECHOLNPGM("FindVPVar NOT FOUND ", vp); return nullptr; } @@ -444,8 +425,6 @@ void DGUSScreenHandler::HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_p } void DGUSScreenHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleManualExtrude"); - const int16_t movevalue = BE16_P(val_ptr); float target = movevalue * 0.01f; ExtUI::extruder_t target_extruder; @@ -467,19 +446,16 @@ void DGUSScreenHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) void DGUSScreenHandler::HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleManualMoveOption"); *(uint16_t*)var.memadr = BE16_P(val_ptr); } #endif void DGUSScreenHandler::HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleMotorLockUnlock"); const int16_t lock = BE16_P(val_ptr); queue.enqueue_one_now(lock ? F("M18") : F("M17")); } void DGUSScreenHandler::HandleSettings(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleSettings"); const uint16_t value = BE16_P(val_ptr); switch (value) { default: break; @@ -495,7 +471,6 @@ void DGUSScreenHandler::HandleSettings(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandler::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t value_raw = BE16_P(val_ptr); - DEBUG_ECHOLNPGM("HandleStepPerMMChanged:", value_raw); const float value = (float)value_raw / 10; ExtUI::axis_t axis; switch (var.VP) { @@ -504,15 +479,12 @@ void DGUSScreenHandler::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break; default: return; } - DEBUG_ECHOLNPGM("value:", value); ExtUI::setAxisSteps_per_mm(value, axis); - DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(axis)); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t value_raw = BE16_P(val_ptr); - DEBUG_ECHOLNPGM("HandleStepPerMMExtruderChanged:", value_raw); const float value = (float)value_raw / 10; ExtUI::extruder_t extruder; switch (var.VP) { @@ -524,16 +496,12 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo #endif #endif } - DEBUG_ECHOLNPGM("value:", value); ExtUI::setAxisSteps_per_mm(value, extruder); - DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } #if HAS_PID_HEATING void DGUSScreenHandler::HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandlePIDAutotune"); - char buf[32] = {0}; switch (var.VP) { @@ -568,8 +536,6 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo #if HAS_BED_PROBE void DGUSScreenHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleProbeOffsetZChanged"); - const float offset = float(int16_t(BE16_P(val_ptr))) / 100.0f; ExtUI::setZOffset_mm(offset); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel @@ -579,14 +545,11 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo #if HAS_FAN void DGUSScreenHandler::HandleFanControl(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleFanControl"); *(uint8_t*)var.memadr = *(uint8_t*)var.memadr > 0 ? 0 : 255; } #endif void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleHeaterControl"); - uint8_t preheat_temp = 0; switch (var.VP) { #if HAS_HOTEND @@ -614,8 +577,6 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr #if ENABLED(DGUS_PREHEAT_UI) void DGUSScreenHandler::HandlePreheat(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandlePreheat"); - const uint16_t preheat_option = BE16_P(val_ptr); switch (preheat_option) { default: @@ -654,7 +615,6 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr #endif void DGUSScreenHandler::UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup) { - DEBUG_ECHOLNPGM("SetNewScreen: ", newscreen); if (!popup) { memmove(&past_screens[1], &past_screens[0], sizeof(past_screens) - 1); past_screens[0] = current_screen; @@ -665,18 +625,14 @@ void DGUSScreenHandler::UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup) { } void DGUSScreenHandler::PopToOldScreen() { - DEBUG_ECHOLNPGM("PopToOldScreen s=", past_screens[0]); GotoScreen(past_screens[0], true); memmove(&past_screens[0], &past_screens[1], sizeof(past_screens) - 1); past_screens[sizeof(past_screens) - 1] = DGUSLCD_SCREEN_MAIN; } void DGUSScreenHandler::UpdateScreenVPData() { - DEBUG_ECHOPGM(" UpdateScreenVPData Screen: ", current_screen); - const uint16_t *VPList = DGUSLCD_FindScreenVPMapList(current_screen); if (!VPList) { - DEBUG_ECHOLNPGM(" NO SCREEN FOR: ", current_screen); ScreenComplete = true; return; // nothing to do, likely a bug or boring screen. } @@ -687,10 +643,8 @@ void DGUSScreenHandler::UpdateScreenVPData() { bool sent_one = false; do { uint16_t VP = pgm_read_word(VPList); - DEBUG_ECHOPGM(" VP: ", VP); if (!VP) { update_ptr = 0; - DEBUG_ECHOLNPGM(" UpdateScreenVPData done"); ScreenComplete = true; return; // Screen completed. } @@ -703,14 +657,10 @@ void DGUSScreenHandler::UpdateScreenVPData() { // Send the VP to the display, but try to avoid overrunning the Tx Buffer. // But send at least one VP, to avoid getting stalled. if (rcpy.send_to_display_handler && (!sent_one || expected_tx <= dgusdisplay.GetFreeTxBuffer())) { - //DEBUG_ECHOPGM(" calling handler for ", rcpy.VP); sent_one = true; rcpy.send_to_display_handler(rcpy); } else { - // auto x=dgusdisplay.GetFreeTxBuffer(); - //DEBUG_ECHOLNPGM(" tx almost full: ", x); - //DEBUG_ECHOPGM(" update_ptr ", update_ptr); ScreenComplete = false; return; // please call again! } @@ -725,7 +675,6 @@ void DGUSScreenHandler::GotoScreen(DGUSLCD_Screens screen, bool ispopup) { } void DGUSDisplay::RequestScreen(DGUSLCD_Screens screen) { - DEBUG_ECHOLNPGM("GotoScreen ", screen); const unsigned char gotoscreen[] = { 0x5A, 0x01, (unsigned char) (screen >> 8U), (unsigned char) (screen & 0xFFU) }; WriteVariable(0x84, gotoscreen, sizeof(gotoscreen)); } diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h index 340938c9790d..7ff9ac673fd1 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h @@ -191,7 +191,7 @@ class DGUSScreenHandler { // Send a float value to the display. // Display will get a 4-byte integer scaled to the number of digits: // Tell the display the number of digits and it cheats by displaying a dot between... - template + template static void DGUSLCD_SendFloatAsLongValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; @@ -203,7 +203,7 @@ class DGUSScreenHandler { // Send a float value to the display. // Display will get a 2-byte integer scaled to the number of digits: // Tell the display the number of digits and it cheats by displaying a dot between... - template + template static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.h index 2543d20b7688..5deedc045079 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.h @@ -258,7 +258,7 @@ constexpr uint16_t VP_BED_STATUS = 0x331C; constexpr uint16_t VP_MOVE_OPTION = 0x3400; // Step per mm -constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , 2 byte unsigned int , 0~1638.4 +constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , uint16_t , 0~1638.4 //constexpr uint16_t VP_X2_STEP_PER_MM = 0x3602; constexpr uint16_t VP_Y_STEP_PER_MM = 0x3604; //constexpr uint16_t VP_Y2_STEP_PER_MM = 0x3606; @@ -272,10 +272,10 @@ constexpr uint16_t VP_E1_STEP_PER_MM = 0x3612; //constexpr uint16_t VP_E5_STEP_PER_MM = 0x361A; // PIDs -constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4 +constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4 constexpr uint16_t VP_E0_PID_I = 0x3702; constexpr uint16_t VP_E0_PID_D = 0x3704; -constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , 2 byte unsigned int , 0~1638.4 +constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , uint16_t , 0~1638.4 constexpr uint16_t VP_E1_PID_I = 0x3708; constexpr uint16_t VP_E1_PID_D = 0x370A; constexpr uint16_t VP_BED_PID_P = 0x3710; diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp index b68f72a1fb51..c6e000eecae8 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp @@ -134,8 +134,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { // meaning "return to previous screen" DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1]; - DEBUG_ECHOLNPGM("\n DEBUG target", target); - if (target == DGUSLCD_SCREEN_POPUP) { // Special handling for popup is to return to previous menu if (current_screen == DGUSLCD_SCREEN_POPUP && confirm_action_cb) confirm_action_cb(); @@ -151,8 +149,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { } void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleManualMove"); - int16_t movevalue = swap16(*(uint16_t*)val_ptr); #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) if (movevalue) { @@ -161,7 +157,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { } #endif char axiscode; - unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode. + uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves switch (var.VP) { default: return; @@ -171,16 +167,21 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove; break; - case VP_MOVE_Y: - axiscode = 'Y'; - if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove; - break; + #if HAS_Y_AXIS + case VP_MOVE_Y: + axiscode = 'Y'; + speed = _mf[Y_AXIS]; + if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove; + break; + #endif - case VP_MOVE_Z: - axiscode = 'Z'; - speed = 300; // default to 5mm/s - if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove; - break; + #if HAS_Z_AXIS + case VP_MOVE_Z: + axiscode = 'Z'; + speed = _mf[Z_AXIS]; + if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove; + break; + #endif case VP_HOME_ALL: // only used for homing axiscode = '\0'; @@ -190,63 +191,42 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { if (!movevalue) { // homing - DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode)); char buf[6] = "G28 X"; buf[4] = axiscode; - //DEBUG_ECHOPGM(" ", buf); queue.enqueue_one_now(buf); - //DEBUG_ECHOLNPGM(" ✓"); ForceCompleteUpdate(); return; } else { // movement - DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode)); bool old_relative_mode = relative_mode; - if (!relative_mode) { - //DEBUG_ECHOPGM(" G91"); - queue.enqueue_now(F("G91")); - //DEBUG_ECHOPGM(" ✓ "); - } + if (!relative_mode) queue.enqueue_now(F("G91")); char buf[32]; // G1 X9999.99 F12345 - unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s); + const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s); char sign[] = "\0"; int16_t value = movevalue / 100; if (movevalue < 0) { value = -value; sign[0] = '-'; } int16_t fraction = ABS(movevalue) % 100; snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed); - //DEBUG_ECHOPGM(" ", buf); queue.enqueue_one_now(buf); - //DEBUG_ECHOLNPGM(" ✓ "); if (backup_speed != speed) { snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed); queue.enqueue_one_now(buf); - //DEBUG_ECHOPGM(" ", buf); - } - // while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLNPGM(" ✓ "); - if (!old_relative_mode) { - //DEBUG_ECHOPGM("G90"); - queue.enqueue_now(F("G90")); - //DEBUG_ECHOPGM(" ✓ "); } + //while (!enqueue_and_echo_command(buf)) idle(); + if (!old_relative_mode) queue.enqueue_now(F("G90")); } ForceCompleteUpdate(); - DEBUG_ECHOLNPGM("manmv done."); - return; cannotmove: - DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode)); return; } #if HAS_PID_HEATING void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) { uint16_t rawvalue = swap16(*(uint16_t*)val_ptr); - DEBUG_ECHOLNPGM("V1:", rawvalue); float value = (float)rawvalue / 10; - DEBUG_ECHOLNPGM("V2:", value); float newvalue = 0; switch (var.VP) { @@ -268,7 +248,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #endif } - DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel @@ -277,7 +256,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #if ENABLED(BABYSTEPPING) void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleLiveAdjustZ"); int16_t flag = swap16(*(uint16_t*)val_ptr), steps = flag ? -20 : 20; ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true); @@ -288,8 +266,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleFilamentOption"); - uint8_t e_temp = 0; filament_data.heated = false; uint16_t preheat_option = swap16(*(uint16_t*)val_ptr); @@ -360,7 +336,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { } void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) { - DEBUG_ECHOLNPGM("HandleFilamentLoadUnload"); if (filament_data.action <= 0) return; // If we close to the target temperature, we can start load or unload the filament diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.h index e9581553817b..3b7199f07eb8 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.h @@ -257,7 +257,7 @@ constexpr uint16_t VP_BED_STATUS = 0x331C; constexpr uint16_t VP_MOVE_OPTION = 0x3400; // Step per mm -constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , 2 byte unsigned int , 0~1638.4 +constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , uint16_t , 0~1638.4 //constexpr uint16_t VP_X2_STEP_PER_MM = 0x3602; constexpr uint16_t VP_Y_STEP_PER_MM = 0x3604; //constexpr uint16_t VP_Y2_STEP_PER_MM = 0x3606; @@ -271,7 +271,7 @@ constexpr uint16_t VP_E0_STEP_PER_MM = 0x3610; //constexpr uint16_t VP_E5_STEP_PER_MM = 0x361A; // PIDs -constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4 +constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4 constexpr uint16_t VP_E0_PID_I = 0x3702; constexpr uint16_t VP_E0_PID_D = 0x3704; constexpr uint16_t VP_BED_PID_P = 0x3710; diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp index 475a03307eeb..ca1a64123a70 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp @@ -134,8 +134,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { // meaning "return to previous screen" DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1]; - DEBUG_ECHOLNPGM("\n DEBUG target", target); - if (target == DGUSLCD_SCREEN_POPUP) { // Special handling for popup is to return to previous menu if (current_screen == DGUSLCD_SCREEN_POPUP && confirm_action_cb) confirm_action_cb(); @@ -151,8 +149,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { } void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleManualMove"); - int16_t movevalue = swap16(*(uint16_t*)val_ptr); #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) if (movevalue) { @@ -161,7 +157,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { } #endif char axiscode; - unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode. + uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves switch (var.VP) { default: return; @@ -171,16 +167,21 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove; break; - case VP_MOVE_Y: - axiscode = 'Y'; - if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove; - break; + #if HAS_Y_AXIS + case VP_MOVE_Y: + axiscode = 'Y'; + speed = _mf[Y_AXIS]; + if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove; + break; + #endif - case VP_MOVE_Z: - axiscode = 'Z'; - speed = 300; // default to 5mm/s - if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove; - break; + #if HAS_Z_AXIS + case VP_MOVE_Z: + axiscode = 'Z'; + speed = _mf[Z_AXIS]; + if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove; + break; + #endif case VP_HOME_ALL: // only used for homing axiscode = '\0'; @@ -190,63 +191,42 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { if (!movevalue) { // homing - DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode)); char buf[6] = "G28 X"; buf[4] = axiscode; - //DEBUG_ECHOPGM(" ", buf); queue.enqueue_one_now(buf); - //DEBUG_ECHOLNPGM(" ✓"); ForceCompleteUpdate(); return; } else { // movement - DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode)); - bool old_relative_mode = relative_mode; - if (!relative_mode) { - //DEBUG_ECHOPGM(" G91"); - queue.enqueue_now(F("G91")); - //DEBUG_ECHOPGM(" ✓ "); - } + const bool old_relative_mode = relative_mode; + if (!relative_mode) queue.enqueue_now(F("G91")); char buf[32]; // G1 X9999.99 F12345 - unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s); + const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s); char sign[] = "\0"; int16_t value = movevalue / 100; if (movevalue < 0) { value = -value; sign[0] = '-'; } int16_t fraction = ABS(movevalue) % 100; snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed); - //DEBUG_ECHOPGM(" ", buf); queue.enqueue_one_now(buf); - //DEBUG_ECHOLNPGM(" ✓ "); if (backup_speed != speed) { snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed); queue.enqueue_one_now(buf); - //DEBUG_ECHOPGM(" ", buf); - } - // while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLNPGM(" ✓ "); - if (!old_relative_mode) { - //DEBUG_ECHOPGM("G90"); - queue.enqueue_now(F("G90")); - //DEBUG_ECHOPGM(" ✓ "); } + //while (!enqueue_and_echo_command(buf)) idle(); + if (!old_relative_mode) queue.enqueue_now(F("G90")); } ForceCompleteUpdate(); - DEBUG_ECHOLNPGM("manmv done."); - return; cannotmove: - DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode)); return; } #if HAS_PID_HEATING void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) { uint16_t rawvalue = swap16(*(uint16_t*)val_ptr); - DEBUG_ECHOLNPGM("V1:", rawvalue); float value = (float)rawvalue / 10; - DEBUG_ECHOLNPGM("V2:", value); float newvalue = 0; switch (var.VP) { @@ -268,7 +248,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #endif } - DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel @@ -277,7 +256,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #if ENABLED(BABYSTEPPING) void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleLiveAdjustZ"); int16_t flag = swap16(*(uint16_t*)val_ptr), steps = flag ? -20 : 20; ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true); @@ -288,8 +266,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleFilamentOption"); - uint8_t e_temp = 0; filament_data.heated = false; uint16_t preheat_option = swap16(*(uint16_t*)val_ptr); @@ -360,7 +336,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { } void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) { - DEBUG_ECHOLNPGM("HandleFilamentLoadUnload"); if (filament_data.action <= 0) return; // If we close to the target temperature, we can start load or unload the filament diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h index bdcd248dd6cd..63586e7fe517 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h @@ -256,10 +256,10 @@ constexpr uint16_t VP_E1_STATUS = 0x3412; constexpr uint16_t VP_MOVE_OPTION = 0x3500; // // PIDs -// constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4 +// constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4 // constexpr uint16_t VP_E0_PID_I = 0x3702; // constexpr uint16_t VP_E0_PID_D = 0x3704; -// constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , 2 byte unsigned int , 0~1638.4 +// constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , uint16_t , 0~1638.4 // constexpr uint16_t VP_E1_PID_I = 0x3708; // constexpr uint16_t VP_E1_PID_D = 0x370A; // constexpr uint16_t VP_BED_PID_P = 0x3710; @@ -414,7 +414,7 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040; constexpr uint16_t VP_FAN3_STATUS = 0x2716; // Step per mm - constexpr uint16_t VP_X_STEP_PER_MM = 0x2900; // at the moment , 2 byte unsigned int , 0~1638.4 + constexpr uint16_t VP_X_STEP_PER_MM = 0x2900; // at the moment , uint16_t , 0~1638.4 constexpr uint16_t VP_Y_STEP_PER_MM = 0x2904; constexpr uint16_t VP_Z_STEP_PER_MM = 0x2908; constexpr uint16_t VP_E0_STEP_PER_MM = 0x2910; @@ -521,10 +521,10 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040; constexpr uint16_t VP_PrintTime_S = 0x3504; // PIDs - constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4 + constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4 constexpr uint16_t VP_E0_PID_I = 0x3702; constexpr uint16_t VP_E0_PID_D = 0x3704; - constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , 2 byte unsigned int , 0~1638.4 + constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , uint16_t , 0~1638.4 constexpr uint16_t VP_E1_PID_I = 0x3708; constexpr uint16_t VP_E1_PID_D = 0x370A; constexpr uint16_t VP_BED_PID_P = 0x3710; diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 882cfadcd2ac..3cf0c3264865 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -80,8 +80,6 @@ void DGUSScreenHandlerMKS::sendinfoscreen(const void *line1, const void *line2, void DGUSScreenHandlerMKS::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { - //DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP); - //DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr); uint16_t tmp = *(uint8_t *) var.memadr; // +1 -> avoid rounding issues for the display. // tmp = map(tmp, 0, 255, 0, 100); dgusdisplay.WriteVariable(var.VP, tmp); @@ -90,7 +88,6 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) { void DGUSScreenHandlerMKS::DGUSLCD_SendBabyStepToDisplay(DGUS_VP_Variable &var) { float value = current_position.z; - DEBUG_ECHOLNPAIR_F(" >> ", value, 6); value *= cpow(10, 2); dgusdisplay.WriteVariable(VP_SD_Print_Baby, (uint16_t)value); } @@ -106,14 +103,11 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var) void DGUSScreenHandlerMKS::DGUSLCD_SetUint8(DGUS_VP_Variable &var, void *val_ptr) { if (var.memadr) { const uint16_t value = BE16_P(val_ptr); - DEBUG_ECHOLNPGM("Got uint8:", value); *(uint8_t*)var.memadr = map(constrain(value, 0, 255), 0, 255, 0, 255); - DEBUG_ECHOLNPGM("Set uint8:", *(uint8_t*)var.memadr); } } void DGUSScreenHandlerMKS::DGUSLCD_SendGbkToDisplay(DGUS_VP_Variable &var) { - DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr); uint16_t *tmp = (uint16_t*) var.memadr; dgusdisplay.WriteVariable(var.VP, tmp, var.size, true); } @@ -278,8 +272,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { // meaning "return to previous screen" DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1]; - DEBUG_ECHOLNPGM("\n DEBUG target", target); - // when the dgus had reboot, it will enter the DGUSLCD_SCREEN_MAIN page, // so user can change any page to use this function, an it will check // if robin nano is printing. when it is, dgus will enter the printing @@ -313,7 +305,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandlerMKS::ScreenBackChange(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t target = BE16_P(val_ptr); - DEBUG_ECHOLNPGM(" back = 0x%x", target); switch (target) { } } @@ -327,7 +318,6 @@ void DGUSScreenHandlerMKS::ZoffsetConfirm(DGUS_VP_Variable &var, void *val_ptr) } void DGUSScreenHandlerMKS::GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("GetTurnOffCtrl\n"); const uint16_t value = BE16_P(val_ptr); switch (value) { case 0 ... 1: DGUSAutoTurnOff = (bool)value; break; @@ -336,7 +326,6 @@ void DGUSScreenHandlerMKS::GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr) } void DGUSScreenHandlerMKS::GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("GetMinExtrudeTemp"); const uint16_t value = BE16_P(val_ptr); TERN_(PREVENT_COLD_EXTRUSION, thermalManager.extrude_min_temp = value); mks_min_extrusion_temp = value; @@ -344,7 +333,6 @@ void DGUSScreenHandlerMKS::GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_pt } void DGUSScreenHandlerMKS::GetZoffsetDistance(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("GetZoffsetDistance"); const uint16_t value = BE16_P(val_ptr); float val_distance = 0; switch (value) { @@ -358,7 +346,6 @@ void DGUSScreenHandlerMKS::GetZoffsetDistance(DGUS_VP_Variable &var, void *val_p } void DGUSScreenHandlerMKS::GetManualMovestep(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("\nGetManualMovestep"); *(uint16_t *)var.memadr = BE16_P(val_ptr); } @@ -395,7 +382,6 @@ void DGUSScreenHandlerMKS::GetOffsetValue(DGUS_VP_Variable &var, void *val_ptr) #if HAS_BED_PROBE const int32_t value = BE32_P(val_ptr); const float Offset = value / 100.0f; - DEBUG_ECHOLNPGM("\nget int6 offset >> ", value, 6); switch (var.VP) { default: break; @@ -743,8 +729,6 @@ void DGUSScreenHandlerMKS::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr } void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleManualMove"); - int16_t movevalue = BE16_P(val_ptr); // Choose Move distance @@ -752,69 +736,64 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { else if (manualMoveStep == 0x02) manualMoveStep = 100; else if (manualMoveStep == 0x03) manualMoveStep = 1000; - DEBUG_ECHOLNPGM("QUEUE LEN:", queue.ring_buffer.length); - if (!print_job_timer.isPaused() && !queue.ring_buffer.empty()) return; char axiscode; - unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode. + uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves switch (var.VP) { // switch X Y Z or Home default: return; case VP_MOVE_X: - DEBUG_ECHOLNPGM("X Move"); axiscode = 'X'; if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove; break; - case VP_MOVE_Y: - DEBUG_ECHOLNPGM("Y Move"); - axiscode = 'Y'; - if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove; - break; + #if HAS_Y_AXIS + case VP_MOVE_Y: + axiscode = 'Y'; + speed = _mf[Y_AXIS]; + if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove; + break; + #endif - case VP_MOVE_Z: - DEBUG_ECHOLNPGM("Z Move"); - axiscode = 'Z'; - speed = 300; // default to 5mm/s - if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove; - break; + #if HAS_Z_AXIS + case VP_MOVE_Z: + axiscode = 'Z'; + speed = _mf[Z_AXIS]; + if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove; + break; + #endif case VP_MOTOR_LOCK_UNLOK: - DEBUG_ECHOLNPGM("Motor Unlock"); movevalue = 5; - axiscode = '\0'; - // return ; break; case VP_HOME_ALL: // only used for homing - DEBUG_ECHOLNPGM("Home all"); - axiscode = '\0'; + axiscode = '\0'; movevalue = 0; // ignore value sent from display, this VP is _ONLY_ for homing. - //return; break; case VP_X_HOME: - DEBUG_ECHOLNPGM("X Home"); - axiscode = 'X'; + axiscode = 'X'; movevalue = 0; break; - case VP_Y_HOME: - DEBUG_ECHOLNPGM("Y Home"); - axiscode = 'Y'; - movevalue = 0; - break; + #if HAS_Y_AXIS + case VP_Y_HOME: + axiscode = 'Y'; + movevalue = 0; + break; + #endif - case VP_Z_HOME: - DEBUG_ECHOLNPGM("Z Home"); - axiscode = 'Z'; - movevalue = 0; - break; + #if HAS_Z_AXIS + case VP_Z_HOME: + axiscode = 'Z'; + movevalue = 0; + break; + #endif } - DEBUG_ECHOPGM("movevalue = ", movevalue); if (movevalue != 0 && movevalue != 5) { // get move distance switch (movevalue) { case 0x0001: movevalue = manualMoveStep; break; @@ -824,21 +803,16 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { } if (!movevalue) { - // homing - DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode)); // char buf[6] = "G28 X"; // buf[4] = axiscode; char buf[6]; sprintf(buf, "G28 %c", axiscode); - //DEBUG_ECHOPGM(" ", buf); queue.enqueue_one_now(buf); - //DEBUG_ECHOLNPGM(" ✓"); ForceCompleteUpdate(); return; } else if (movevalue == 5) { - DEBUG_ECHOPGM("send M84"); char buf[6]; snprintf_P(buf,6,PSTR("M84 %c"), axiscode); queue.enqueue_one_now(buf); @@ -847,45 +821,30 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { } else { // movement - DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode)); - bool old_relative_mode = relative_mode; - - if (!relative_mode) { - //DEBUG_ECHOPGM(" G91"); - queue.enqueue_now(F("G91")); - //DEBUG_ECHOPGM(" ✓ "); - } + const bool old_relative_mode = relative_mode; + if (!relative_mode) queue.enqueue_now(F("G91")); char buf[32]; // G1 X9999.99 F12345 - // unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s); + //const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s); char sign[] = "\0"; int16_t value = movevalue / 100; if (movevalue < 0) { value = -value; sign[0] = '-'; } - int16_t fraction = ABS(movevalue) % 100; + const int16_t fraction = ABS(movevalue) % 100; snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed); queue.enqueue_one_now(buf); //if (backup_speed != speed) { // snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed); // queue.enqueue_one_now(buf); - // //DEBUG_ECHOPGM(" ", buf); //} //while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLNPGM(" ✓ "); - if (!old_relative_mode) { - //DEBUG_ECHOPGM("G90"); - //queue.enqueue_now(F("G90")); - queue.enqueue_now(F("G90")); - //DEBUG_ECHOPGM(" ✓ "); - } + + if (!old_relative_mode) queue.enqueue_now(F("G90")); } ForceCompleteUpdate(); - DEBUG_ECHOLNPGM("manmv done."); - return; cannotmove: - DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode)); return; } @@ -902,10 +861,7 @@ void DGUSScreenHandlerMKS::GetParkPos(DGUS_VP_Variable &var, void *val_ptr) { } void DGUSScreenHandlerMKS::HandleChangeLevelPoint(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleChangeLevelPoint"); - const int16_t value_raw = BE16_P(val_ptr); - DEBUG_ECHOLNPGM("value_raw:", value_raw); *(int16_t*)var.memadr = value_raw; @@ -914,14 +870,9 @@ void DGUSScreenHandlerMKS::HandleChangeLevelPoint(DGUS_VP_Variable &var, void *v } void DGUSScreenHandlerMKS::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleStepPerMMChanged"); - const uint16_t value_raw = BE16_P(val_ptr); const float value = (float)value_raw; - DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPGM("value:", value); - ExtUI::axis_t axis; switch (var.VP) { default: return; @@ -930,20 +881,14 @@ void DGUSScreenHandlerMKS::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *v case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break; } ExtUI::setAxisSteps_per_mm(value, axis); - DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(axis)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } void DGUSScreenHandlerMKS::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleStepPerMMExtruderChanged"); - const uint16_t value_raw = BE16_P(val_ptr); const float value = (float)value_raw; - DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPGM("value:", value); - ExtUI::extruder_t extruder; switch (var.VP) { default: return; @@ -955,20 +900,14 @@ void DGUSScreenHandlerMKS::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, #endif } ExtUI::setAxisSteps_per_mm(value, extruder); - DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } void DGUSScreenHandlerMKS::HandleMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleMaxSpeedChange"); - const uint16_t value_raw = BE16_P(val_ptr); const float value = (float)value_raw; - DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPGM("value:", value); - ExtUI::axis_t axis; switch (var.VP) { case VP_X_MAX_SPEED: axis = ExtUI::axis_t::X; break; @@ -977,20 +916,14 @@ void DGUSScreenHandlerMKS::HandleMaxSpeedChange(DGUS_VP_Variable &var, void *val default: return; } ExtUI::setAxisMaxFeedrate_mm_s(value, axis); - DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(axis)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } void DGUSScreenHandlerMKS::HandleExtruderMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleExtruderMaxSpeedChange"); - const uint16_t value_raw = BE16_P(val_ptr); const float value = (float)value_raw; - DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPGM("value:", value); - ExtUI::extruder_t extruder; switch (var.VP) { default: return; @@ -1002,20 +935,14 @@ void DGUSScreenHandlerMKS::HandleExtruderMaxSpeedChange(DGUS_VP_Variable &var, v case VP_E1_MAX_SPEED: extruder = ExtUI::extruder_t::E1; break; } ExtUI::setAxisMaxFeedrate_mm_s(value, extruder); - DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(extruder)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } void DGUSScreenHandlerMKS::HandleMaxAccChange(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleMaxAccChange"); - const uint16_t value_raw = BE16_P(val_ptr); const float value = (float)value_raw; - DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPGM("value:", value); - ExtUI::axis_t axis; switch (var.VP) { default: return; @@ -1024,16 +951,12 @@ void DGUSScreenHandlerMKS::HandleMaxAccChange(DGUS_VP_Variable &var, void *val_p case VP_Z_ACC_MAX_SPEED: axis = ExtUI::axis_t::Z; break; } ExtUI::setAxisMaxAcceleration_mm_s2(value, axis); - DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(axis)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } void DGUSScreenHandlerMKS::HandleExtruderAccChange(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleExtruderAccChange"); - uint16_t value_raw = BE16_P(val_ptr); - DEBUG_ECHOLNPGM("value_raw:", value_raw); float value = (float)value_raw; ExtUI::extruder_t extruder; switch (var.VP) { @@ -1045,9 +968,7 @@ void DGUSScreenHandlerMKS::HandleExtruderAccChange(DGUS_VP_Variable &var, void * case VP_E1_ACC_MAX_SPEED: extruder = ExtUI::extruder_t::E1; settings.load(); break; #endif } - DEBUG_ECHOLNPGM("value:", value); ExtUI::setAxisMaxAcceleration_mm_s2(value, extruder); - DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(extruder)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -1087,9 +1008,7 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr) #if HAS_PID_HEATING void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t rawvalue = BE16_P(val_ptr); - DEBUG_ECHOLNPGM("V1:", rawvalue); - const float value = 1.0f * rawvalue; - DEBUG_ECHOLNPGM("V2:", value); + const float value = float(rawvalue); float newvalue = 0; switch (var.VP) { @@ -1111,7 +1030,6 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr) #endif } - DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; settings.save(); @@ -1121,7 +1039,6 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr) #if ENABLED(BABYSTEPPING) void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleLiveAdjustZ"); const float step = ZOffset_distance; const uint16_t flag = BE16_P(val_ptr); @@ -1166,7 +1083,6 @@ void DGUSScreenHandlerMKS::GetManualFilament(DGUS_VP_Variable &var, void *val_pt const uint16_t value_len = BE16_P(val_ptr); const float value = (float)value_len; - DEBUG_ECHOLNPGM("GetManualFilament:", value); distanceFilament = value; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel @@ -1175,7 +1091,6 @@ void DGUSScreenHandlerMKS::GetManualFilament(DGUS_VP_Variable &var, void *val_pt void DGUSScreenHandlerMKS::GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t value_len = BE16_P(val_ptr); filamentSpeed_mm_s = value_len; - DEBUG_ECHOLNPGM("GetManualFilamentSpeed:", value_len); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -1264,20 +1179,16 @@ void GcodeSuite::M1002() { } void DGUSScreenHandlerMKS::FilamentLoad(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("FilamentLoad"); FilamentLoadUnload(var, val_ptr, 1); } void DGUSScreenHandlerMKS::FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("FilamentUnLoad"); FilamentLoadUnload(var, val_ptr, -1); } #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleFilamentOption"); - uint8_t e_temp = 0; filament_data.heated = false; uint16_t preheat_option = BE16_P(val_ptr); @@ -1345,7 +1256,6 @@ void DGUSScreenHandlerMKS::FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr) } void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) { - DEBUG_ECHOLNPGM("HandleFilamentLoadUnload"); if (filament_data.action <= 0) return; // If we close to the target temperature, we can start load or unload the filament diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h index f5fb986bde51..d529b0adfe60 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h @@ -247,7 +247,7 @@ constexpr uint16_t VP_BED_STATUS = 0x331C; constexpr uint16_t VP_MOVE_OPTION = 0x3400; // Step per mm -constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , 2 byte unsigned int , 0~1638.4 +constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , uint16_t , 0~1638.4 //constexpr uint16_t VP_X2_STEP_PER_MM = 0x3602; constexpr uint16_t VP_Y_STEP_PER_MM = 0x3604; //constexpr uint16_t VP_Y2_STEP_PER_MM = 0x3606; @@ -261,7 +261,7 @@ constexpr uint16_t VP_E0_STEP_PER_MM = 0x3610; //constexpr uint16_t VP_E5_STEP_PER_MM = 0x361A; // PIDs -constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4 +constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4 constexpr uint16_t VP_E0_PID_I = 0x3702; constexpr uint16_t VP_E0_PID_D = 0x3704; constexpr uint16_t VP_BED_PID_P = 0x3710; diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp index 55be3777e108..22fdd80fc9a1 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp @@ -134,8 +134,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { // meaning "return to previous screen" DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1]; - DEBUG_ECHOLNPGM("\n DEBUG target", target); - if (target == DGUSLCD_SCREEN_POPUP) { // Special handling for popup is to return to previous menu if (current_screen == DGUSLCD_SCREEN_POPUP && confirm_action_cb) confirm_action_cb(); @@ -151,8 +149,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { } void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleManualMove"); - int16_t movevalue = swap16(*(uint16_t*)val_ptr); #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) if (movevalue) { @@ -161,7 +157,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { } #endif char axiscode; - unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode. + uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves switch (var.VP) { default: return; @@ -171,16 +167,21 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove; break; - case VP_MOVE_Y: - axiscode = 'Y'; - if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove; - break; + #if HAS_Y_AXIS + case VP_MOVE_Y: + axiscode = 'Y'; + speed = _mf[Y_AXIS]; + if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove; + break; + #endif - case VP_MOVE_Z: - axiscode = 'Z'; - speed = 300; // default to 5mm/s - if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove; - break; + #if HAS_Z_AXIS + case VP_MOVE_Z: + axiscode = 'Z'; + speed = _mf[Z_AXIS]; + if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove; + break; + #endif case VP_HOME_ALL: // only used for homing axiscode = '\0'; @@ -190,63 +191,42 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { if (!movevalue) { // homing - DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode)); char buf[6] = "G28 X"; buf[4] = axiscode; - //DEBUG_ECHOPGM(" ", buf); queue.enqueue_one_now(buf); - //DEBUG_ECHOLNPGM(" ✓"); ForceCompleteUpdate(); return; } else { // movement - DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode)); - bool old_relative_mode = relative_mode; - if (!relative_mode) { - //DEBUG_ECHOPGM(" G91"); - queue.enqueue_now(F("G91")); - //DEBUG_ECHOPGM(" ✓ "); - } + const bool old_relative_mode = relative_mode; + if (!relative_mode) queue.enqueue_now(F("G91")); char buf[32]; // G1 X9999.99 F12345 - unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s); + const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s); char sign[] = "\0"; int16_t value = movevalue / 100; if (movevalue < 0) { value = -value; sign[0] = '-'; } int16_t fraction = ABS(movevalue) % 100; snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed); - //DEBUG_ECHOPGM(" ", buf); queue.enqueue_one_now(buf); - //DEBUG_ECHOLNPGM(" ✓ "); if (backup_speed != speed) { snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed); queue.enqueue_one_now(buf); - //DEBUG_ECHOPGM(" ", buf); - } - // while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLNPGM(" ✓ "); - if (!old_relative_mode) { - //DEBUG_ECHOPGM("G90"); - queue.enqueue_now(F("G90")); - //DEBUG_ECHOPGM(" ✓ "); } + //while (!enqueue_and_echo_command(buf)) idle(); + if (!old_relative_mode) queue.enqueue_now(F("G90")); } ForceCompleteUpdate(); - DEBUG_ECHOLNPGM("manmv done."); - return; cannotmove: - DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode)); return; } #if HAS_PID_HEATING void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) { uint16_t rawvalue = swap16(*(uint16_t*)val_ptr); - DEBUG_ECHOLNPGM("V1:", rawvalue); float value = (float)rawvalue / 10; - DEBUG_ECHOLNPGM("V2:", value); float newvalue = 0; switch (var.VP) { @@ -268,7 +248,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #endif } - DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel @@ -277,7 +256,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #if ENABLED(BABYSTEPPING) void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleLiveAdjustZ"); int16_t flag = swap16(*(uint16_t*)val_ptr), steps = flag ? -20 : 20; ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true); @@ -288,8 +266,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleFilamentOption"); - uint8_t e_temp = 0; filament_data.heated = false; uint16_t preheat_option = swap16(*(uint16_t*)val_ptr); @@ -360,7 +336,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { } void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) { - DEBUG_ECHOLNPGM("HandleFilamentLoadUnload"); if (filament_data.action <= 0) return; // If we close to the target temperature, we can start load or unload the filament diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp index df22407c0f41..5bbeb0d7cc67 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp @@ -164,7 +164,6 @@ void DGUSDisplay::ReadVersions() { } void DGUSDisplay::SwitchScreen(DGUS_Screen screen) { - DEBUG_ECHOLNPGM("SwitchScreen ", (uint8_t)screen); const uint8_t command[] = { 0x5A, 0x01, 0x00, (uint8_t)screen }; Write(0x84, command, sizeof(command)); } @@ -172,14 +171,11 @@ void DGUSDisplay::SwitchScreen(DGUS_Screen screen) { void DGUSDisplay::PlaySound(uint8_t start, uint8_t len, uint8_t volume) { if (volume == 0) volume = DGUSDisplay::volume; if (volume == 0) return; - DEBUG_ECHOLNPGM("PlaySound ", start, ":", len, "\nVolume ", volume); const uint8_t command[] = { start, len, volume, 0x00 }; Write(0xA0, command, sizeof(command)); } void DGUSDisplay::EnableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_Control control) { - DEBUG_ECHOLNPGM("EnableControl ", (uint8_t)control, "\nScreen ", (uint8_t)screen, "\nType ", (uint8_t)type); - const uint8_t command[] = { 0x5A, 0xA5, 0x00, (uint8_t)screen, (uint8_t)control, type, 0x00, 0x01 }; Write(0xB0, command, sizeof(command)); @@ -188,8 +184,6 @@ void DGUSDisplay::EnableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_ } void DGUSDisplay::DisableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_Control control) { - DEBUG_ECHOLNPGM("DisableControl ", (uint8_t)control, "\nScreen ", (uint8_t)screen, "\nType ", (uint8_t)type); - const uint8_t command[] = { 0x5A, 0xA5, 0x00, (uint8_t)screen, (uint8_t)control, type, 0x00, 0x00 }; Write(0xB0, command, sizeof(command)); @@ -208,14 +202,12 @@ uint8_t DGUSDisplay::GetVolume() { void DGUSDisplay::SetBrightness(uint8_t new_brightness) { brightness = constrain(new_brightness, 0, 100); new_brightness = map_precise(brightness, 0, 100, 5, 100); - DEBUG_ECHOLNPGM("SetBrightness ", new_brightness); const uint8_t command[] = { new_brightness, new_brightness }; Write(0x82, command, sizeof(command)); } void DGUSDisplay::SetVolume(uint8_t new_volume) { volume = map_precise(constrain(new_volume, 0, 100), 0, 100, 0, 255); - DEBUG_ECHOLNPGM("SetVolume ", volume); const uint8_t command[] = { volume, 0x00 }; Write(0xA1, command, sizeof(command)); } @@ -226,7 +218,6 @@ void DGUSDisplay::ProcessRx() { if (!LCD_SERIAL.available() && LCD_SERIAL.buffer_overruns()) { // Overrun, but reset the flag only when the buffer is empty // We want to extract as many as valid datagrams possible... - DEBUG_ECHOPGM("OVFL"); rx_datagram_state = DGUS_IDLE; //LCD_SERIAL.reset_rx_overun(); LCD_SERIAL.flush(); @@ -239,20 +230,16 @@ void DGUSDisplay::ProcessRx() { case DGUS_IDLE: // Waiting for the first header byte receivedbyte = LCD_SERIAL.read(); - DEBUG_ECHOPGM("< ", receivedbyte); if (DGUS_HEADER1 == receivedbyte) rx_datagram_state = DGUS_HEADER1_SEEN; break; case DGUS_HEADER1_SEEN: // Waiting for the second header byte receivedbyte = LCD_SERIAL.read(); - DEBUG_ECHOPGM(" ", receivedbyte); rx_datagram_state = (DGUS_HEADER2 == receivedbyte) ? DGUS_HEADER2_SEEN : DGUS_IDLE; break; case DGUS_HEADER2_SEEN: // Waiting for the length byte rx_datagram_len = LCD_SERIAL.read(); - DEBUG_ECHOPGM(" (", rx_datagram_len, ") "); - // Telegram min len is 3 (command and one word of payload) rx_datagram_state = WITHIN(rx_datagram_len, 3, DGUS_RX_BUFFER_SIZE) ? DGUS_WAIT_TELEGRAM : DGUS_IDLE; break; @@ -262,22 +249,16 @@ void DGUSDisplay::ProcessRx() { initialized = true; // We've talked to it, so we defined it as initialized. uint8_t command = LCD_SERIAL.read(); - - DEBUG_ECHOPGM("# ", command); - uint8_t readlen = rx_datagram_len - 1; // command is part of len. unsigned char tmp[rx_datagram_len - 1]; unsigned char *ptmp = tmp; while (readlen--) { receivedbyte = LCD_SERIAL.read(); - DEBUG_ECHOPGM(" ", receivedbyte); *ptmp++ = receivedbyte; } - DEBUG_ECHOPGM(" # "); // mostly we'll get this: 5A A5 03 82 4F 4B -- ACK on 0x82, so discard it. if (command == DGUS_WRITEVAR && 'O' == tmp[0] && 'K' == tmp[1]) { - DEBUG_ECHOLNPGM(">"); rx_datagram_state = DGUS_IDLE; break; } @@ -292,10 +273,7 @@ void DGUSDisplay::ProcessRx() { if (command == DGUS_READVAR) { const uint16_t addr = tmp[0] << 8 | tmp[1]; const uint8_t dlen = tmp[2] << 1; // Convert to Bytes. (Display works with words) - DEBUG_ECHOPGM("addr=", addr, " dlen=", dlen, "> "); - if (addr == DGUS_VERSION && dlen == 2) { - DEBUG_ECHOLNPGM("VERSIONS"); gui_version = tmp[3]; os_version = tmp[4]; rx_datagram_state = DGUS_IDLE; @@ -304,13 +282,11 @@ void DGUSDisplay::ProcessRx() { DGUS_VP vp; if (!DGUS_PopulateVP((DGUS_Addr)addr, &vp)) { - DEBUG_ECHOLNPGM("VP not found"); rx_datagram_state = DGUS_IDLE; break; } if (!vp.rx_handler) { - DEBUG_ECHOLNPGM("VP found, no handler."); rx_datagram_state = DGUS_IDLE; break; } @@ -346,7 +322,6 @@ void DGUSDisplay::ProcessRx() { } if (dlen != vp.size) { - DEBUG_ECHOLNPGM("VP found, size mismatch."); rx_datagram_state = DGUS_IDLE; break; } @@ -358,7 +333,6 @@ void DGUSDisplay::ProcessRx() { break; } - DEBUG_ECHOLNPGM(">"); rx_datagram_state = DGUS_IDLE; break; } @@ -402,7 +376,6 @@ bool DGUS_PopulateVP(const DGUS_Addr addr, DGUS_VP * const buffer) { return true; } } while (++ret); - DEBUG_ECHOLNPGM("VP not found: ", (uint16_t)addr); return false; } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index 3d0896a67cf6..a7295f90fec4 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -473,19 +473,14 @@ void DGUSScreenHandler::MoveToScreen(DGUS_Screen screen, bool abort_wait) { if (!CallScreenSetup(screen)) return; - if (!SendScreenVPData(screen, true)) { - DEBUG_ECHOLNPGM("SendScreenVPData failed"); - return; - } + if (!SendScreenVPData(screen, true)) return; current_screen = screen; dgus_display.SwitchScreen(current_screen); } bool DGUSScreenHandler::SendScreenVPData(DGUS_Screen screen, bool complete_update) { - if (complete_update) { - full_update = false; - } + if (complete_update) full_update = false; const DGUS_Addr *list = FindScreenAddrList(screen); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp index 47603052e966..39b3f57e96ca 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp @@ -37,7 +37,7 @@ #endif #if ENABLED(SDSUPPORT) - void DGUSTxHandler::SetFileControlState(int file, bool state) { + void DGUSTxHandler::SetFileControlState(int16_t file, bool state) { DGUS_Control control; switch (file) { @@ -75,17 +75,17 @@ // Batch send uint16_t data[DGUS_FILE_COUNT]; - for (int i = 0; i < DGUS_FILE_COUNT; i++) { + for (int16_t i = 0; i < DGUS_FILE_COUNT; i++) { if (!dgus_screen_handler.filelist.seek(dgus_screen_handler.filelist_offset + i)) { - data[i] = Swap16((uint16_t)DGUS_Data::SDType::NONE); + data[i] = Swap16(DGUS_Data::SDType::NONE); SetFileControlState(i, false); continue; } data[i] = dgus_screen_handler.filelist.isDir() ? - Swap16((uint16_t)DGUS_Data::SDType::DIRECTORY) - : Swap16((uint16_t)DGUS_Data::SDType::FILE); + Swap16(DGUS_Data::SDType::DIRECTORY) + : Swap16(DGUS_Data::SDType::FILE); SetFileControlState(i, true); } @@ -287,7 +287,7 @@ void DGUSTxHandler::TempMax(DGUS_VP &vp) { void DGUSTxHandler::StepperStatus(DGUS_VP &vp) { const bool motor_on = stepper.axis_enabled.bits & (_BV(NUM_AXES) - 1); - dgus_display.Write((uint16_t)vp.addr, Swap16(uint16_t(motor_on ? DGUS_Data::Status::ENABLED : DGUS_Data::Status::DISABLED))); + dgus_display.Write((uint16_t)vp.addr, Swap16(motor_on ? DGUS_Data::Status::ENABLED : DGUS_Data::Status::DISABLED)); } void DGUSTxHandler::StepIcons(DGUS_VP &vp) { @@ -340,7 +340,7 @@ void DGUSTxHandler::ABLGrid(DGUS_VP &vp) { xy_uint8_t point; int16_t fixed; - for (int i = 0; i < DGUS_LEVEL_GRID_SIZE; i++) { + for (int16_t i = 0; i < DGUS_LEVEL_GRID_SIZE; i++) { point.x = i % (GRID_MAX_POINTS_X); point.y = i / (GRID_MAX_POINTS_X); fixed = dgus_display.ToFixedPoint(ExtUI::getMeshPoint(point)); @@ -385,13 +385,13 @@ void DGUSTxHandler::BLTouch(DGUS_VP &vp) { DGUSDisplay::RETURN_KEY_CODE, DGUS_Control::EXTRA2); - dgus_display.Write((uint16_t)vp.addr, Swap16((uint16_t)DGUS_Data::Status::ENABLED)); + dgus_display.Write((uint16_t)vp.addr, Swap16(DGUS_Data::Status::ENABLED)); #else dgus_display.DisableControl(DGUS_Screen::SETTINGS_MENU2, DGUSDisplay::RETURN_KEY_CODE, DGUS_Control::EXTRA2); - dgus_display.Write((uint16_t)vp.addr, Swap16((uint16_t)DGUS_Data::Status::DISABLED)); + dgus_display.Write((uint16_t)vp.addr, Swap16(DGUS_Data::Status::DISABLED)); #endif } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h index 7d1b46773b25..aad73dd5d606 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h @@ -24,12 +24,12 @@ #include "DGUSDisplay.h" #include "definition/DGUS_VP.h" -#define Swap16(val) ((uint16_t)(((uint16_t)(val) >> 8) | ((uint16_t)(val) << 8))) +#define Swap16(val) (uint16_t((uint16_t(val) >> 8) | (uint16_t(val) << 8))) namespace DGUSTxHandler { #if ENABLED(SDSUPPORT) - void SetFileControlState(int, bool); + void SetFileControlState(int16_t, bool); void FileType(DGUS_VP &); void FileName(DGUS_VP &); void ScrollIcons(DGUS_VP &); @@ -85,18 +85,18 @@ namespace DGUSTxHandler { switch (vp.size) { default: return; case 1: { - const uint8_t data = (uint8_t)(*(T*)vp.extra); - dgus_display.Write((uint16_t)vp.addr, data); + const uint8_t data = uint8_t(*(T*)vp.extra); + dgus_display.Write(uint16_t(vp.addr), data); break; } case 2: { - const uint16_t data = (uint16_t)(*(T*)vp.extra); - dgus_display.Write((uint16_t)vp.addr, Swap16(data)); + const uint16_t data = uint16_t(*(T*)vp.extra); + dgus_display.Write(uint16_t(vp.addr), Swap16(data)); break; } case 4: { - const uint32_t data = (uint32_t)(*(T*)vp.extra); - dgus_display.Write((uint16_t)vp.addr, dgus_display.SwapBytes(data)); + const uint32_t data = uint32_t(*(T*)vp.extra); + dgus_display.Write(uint16_t(vp.addr), dgus_display.SwapBytes(data)); break; } } @@ -109,17 +109,17 @@ namespace DGUSTxHandler { default: return; case 1: { const uint8_t data = dgus_display.ToFixedPoint(*(T*)vp.extra); - dgus_display.Write((uint16_t)vp.addr, data); + dgus_display.Write(uint16_t(vp.addr), data); break; } case 2: { const uint16_t data = dgus_display.ToFixedPoint(*(T*)vp.extra); - dgus_display.Write((uint16_t)vp.addr, Swap16(data)); + dgus_display.Write(uint16_t(vp.addr), Swap16(data)); break; } case 4: { const uint32_t data = dgus_display.ToFixedPoint(*(T*)vp.extra); - dgus_display.Write((uint16_t)vp.addr, dgus_display.SwapBytes(data)); + dgus_display.Write(uint16_t(vp.addr), dgus_display.SwapBytes(data)); break; } } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h index 39e97156d083..3fd6d16f5bbd 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h @@ -21,153 +21,153 @@ */ #pragma once -constexpr uint8_t DGUS_LINE_LEN = 32; -constexpr uint8_t DGUS_STATUS_LEN = 32; -constexpr uint8_t DGUS_FILE_COUNT = 5; -constexpr uint8_t DGUS_FILENAME_LEN = 32; -constexpr uint8_t DGUS_ELLAPSED_LEN = 15; -constexpr uint8_t DGUS_LEVEL_GRID_SIZE = 25; -constexpr uint8_t DGUS_MACHINE_LEN = 24; -constexpr uint8_t DGUS_BUILDVOLUME_LEN = 24; -constexpr uint8_t DGUS_VERSION_LEN = 16; -constexpr uint8_t DGUS_PRINTTIME_LEN = 24; -constexpr uint8_t DGUS_LONGESTPRINT_LEN = 24; -constexpr uint8_t DGUS_FILAMENTUSED_LEN = 24; -constexpr uint8_t DGUS_GCODE_LEN = 32; +#define DGUS_LINE_LEN 32 +#define DGUS_STATUS_LEN 32 +#define DGUS_FILE_COUNT 5 +#define DGUS_FILENAME_LEN 32 +#define DGUS_ELAPSED_LEN 15 +#define DGUS_LEVEL_GRID_SIZE 25 +#define DGUS_MACHINE_LEN 24 +#define DGUS_BUILDVOLUME_LEN 24 +#define DGUS_VERSION_LEN 16 +#define DGUS_PRINTTIME_LEN 24 +#define DGUS_LONGESTPRINT_LEN 24 +#define DGUS_FILAMENTUSED_LEN 24 +#define DGUS_GCODE_LEN 32 enum class DGUS_Addr : uint16_t { - MESSAGE_Line1 = 0x1100, // 0x1100 - 0x111F - MESSAGE_Line2 = 0x1120, // 0x1120 - 0x113F - MESSAGE_Line3 = 0x1140, // 0x1140 - 0x115F - MESSAGE_Line4 = 0x1160, // 0x1160 - 0x117F + MESSAGE_Line1 = 0x1100, // 0x1100 - 0x111F + MESSAGE_Line2 = 0x1120, // 0x1120 - 0x113F + MESSAGE_Line3 = 0x1140, // 0x1140 - 0x115F + MESSAGE_Line4 = 0x1160, // 0x1160 - 0x117F // READ-ONLY VARIABLES - SCREENCHANGE = 0x2000, // Screen change request. Data contains target screen in low byte. - SCREENCHANGE_SD = 0x2001, // Only change if SD card present. - SCREENCHANGE_Idle = 0x2002, // Only change if not printing. - SCREENCHANGE_Printing = 0x2003, // Only change if printing. - SD_SelectFile = 0x2004, // Data: file index (0-4) - SD_Scroll = 0x2005, // Data: DGUS_Data::Scroll - SD_Print = 0x2006, - STATUS_Abort = 0x2007, // Popup / Data: DGUS_Data::Popup - STATUS_Pause = 0x2008, // Popup / Data: DGUS_Data::Popup - STATUS_Resume = 0x2009, // Popup / Data: DGUS_Data::Popup - ADJUST_SetFeedrate = 0x200A, // Type: Integer (16 bits signed) - ADJUST_SetFlowrate_CUR = 0x200B, // Type: Integer (16 bits signed) + SCREENCHANGE = 0x2000, // Screen change request. Data contains target screen in low byte. + SCREENCHANGE_SD = 0x2001, // Only change if SD card present. + SCREENCHANGE_Idle = 0x2002, // Only change if not printing. + SCREENCHANGE_Printing = 0x2003, // Only change if printing. + SD_SelectFile = 0x2004, // Data: file index (0-4) + SD_Scroll = 0x2005, // Data: DGUS_Data::Scroll + SD_Print = 0x2006, + STATUS_Abort = 0x2007, // Popup / Data: DGUS_Data::Popup + STATUS_Pause = 0x2008, // Popup / Data: DGUS_Data::Popup + STATUS_Resume = 0x2009, // Popup / Data: DGUS_Data::Popup + ADJUST_SetFeedrate = 0x200A, // Type: Integer (16 bits signed) + ADJUST_SetFlowrate_CUR = 0x200B, // Type: Integer (16 bits signed) #if HAS_MULTI_EXTRUDER - ADJUST_SetFlowrate_E0 = 0x200C, // Type: Integer (16 bits signed) - ADJUST_SetFlowrate_E1 = 0x200D, // Type: Integer (16 bits signed) + ADJUST_SetFlowrate_E0 = 0x200C, // Type: Integer (16 bits signed) + ADJUST_SetFlowrate_E1 = 0x200D, // Type: Integer (16 bits signed) #endif - ADJUST_SetBabystep = 0x200E, // Type: Fixed point, 2 decimals (16 bits signed) - ADJUST_Babystep = 0x200F, // Data: DGUS_Data::Adjust - TEMP_Preset = 0x2010, // Popup / Data: DGUS_Data::TempPreset - TEMP_SetTarget_Bed = 0x2011, // Type: Integer (16 bits signed) - TEMP_SetTarget_H0 = 0x2012, // Type: Integer (16 bits signed) + ADJUST_SetBabystep = 0x200E, // Type: Fixed point, 2 decimals (16 bits signed) + ADJUST_Babystep = 0x200F, // Data: DGUS_Data::Adjust + TEMP_Preset = 0x2010, // Popup / Data: DGUS_Data::TempPreset + TEMP_SetTarget_Bed = 0x2011, // Type: Integer (16 bits signed) + TEMP_SetTarget_H0 = 0x2012, // Type: Integer (16 bits signed) #if HAS_MULTI_HOTEND - TEMP_SetTarget_H1 = 0x2013, // Type: Integer (16 bits signed) + TEMP_SetTarget_H1 = 0x2013, // Type: Integer (16 bits signed) #endif - TEMP_Cool = 0x2014, // Data: DGUS_Data::Heater - STEPPER_Control = 0x2015, // Popup / Data: DGUS_Data::Control - LEVEL_OFFSET_Set = 0x2016, // Type: Fixed point, 2 decimals (16 bits signed) - LEVEL_OFFSET_Step = 0x2017, // Data: DGUS_Data::Adjust - LEVEL_OFFSET_SetStep = 0x2018, // Data: DGUS_Data::StepSize - LEVEL_MANUAL_Point = 0x2019, // Data: point index (1-5) - LEVEL_AUTO_Probe = 0x201A, - LEVEL_AUTO_Disable = 0x201B, - FILAMENT_Select = 0x201C, // Data: DGUS_Data::Extruder - FILAMENT_SetLength = 0x201D, // Type: Integer (16 bits unsigned) - FILAMENT_Move = 0x201E, // Data: DGUS_Data::FilamentMove - MOVE_Home = 0x201F, // Data: DGUS_Data::Axis - MOVE_SetX = 0x2020, // Type: Fixed point, 1 decimal (16 bits signed) - MOVE_SetY = 0x2021, // Type: Fixed point, 1 decimal (16 bits signed) - MOVE_SetZ = 0x2022, // Type: Fixed point, 1 decimal (16 bits signed) - MOVE_Step = 0x2023, // Data: DGUS_Data::MoveDirection - MOVE_SetStep = 0x2024, // Data: DGUS_Data::StepSize - GCODE_Clear = 0x2025, - GCODE_Execute = 0x2026, - EEPROM_Reset = 0x2027, // Popup / Data: DGUS_Data::Popup - SETTINGS2_Extra = 0x2028, // Data: DGUS_Data::Extra - PID_Select = 0x2029, // Data: DGUS_Data::Heater - PID_SetTemp = 0x202A, // Type: Integer (16 bits unsigned) - PID_Run = 0x202B, - POWERLOSS_Abort = 0x202C, // Popup / Data: DGUS_Data::Popup - POWERLOSS_Resume = 0x202D, // Popup / Data: DGUS_Data::Popup - WAIT_Abort = 0x202E, // Popup / Data: DGUS_Data::Popup - WAIT_Continue = 0x202F, + TEMP_Cool = 0x2014, // Data: DGUS_Data::Heater + STEPPER_Control = 0x2015, // Popup / Data: DGUS_Data::Control + LEVEL_OFFSET_Set = 0x2016, // Type: Fixed point, 2 decimals (16 bits signed) + LEVEL_OFFSET_Step = 0x2017, // Data: DGUS_Data::Adjust + LEVEL_OFFSET_SetStep = 0x2018, // Data: DGUS_Data::StepSize + LEVEL_MANUAL_Point = 0x2019, // Data: point index (1-5) + LEVEL_AUTO_Probe = 0x201A, + LEVEL_AUTO_Disable = 0x201B, + FILAMENT_Select = 0x201C, // Data: DGUS_Data::Extruder + FILAMENT_SetLength = 0x201D, // Type: Integer (16 bits unsigned) + FILAMENT_Move = 0x201E, // Data: DGUS_Data::FilamentMove + MOVE_Home = 0x201F, // Data: DGUS_Data::Axis + MOVE_SetX = 0x2020, // Type: Fixed point, 1 decimal (16 bits signed) + MOVE_SetY = 0x2021, // Type: Fixed point, 1 decimal (16 bits signed) + MOVE_SetZ = 0x2022, // Type: Fixed point, 1 decimal (16 bits signed) + MOVE_Step = 0x2023, // Data: DGUS_Data::MoveDirection + MOVE_SetStep = 0x2024, // Data: DGUS_Data::StepSize + GCODE_Clear = 0x2025, + GCODE_Execute = 0x2026, + EEPROM_Reset = 0x2027, // Popup / Data: DGUS_Data::Popup + SETTINGS2_Extra = 0x2028, // Data: DGUS_Data::Extra + PID_Select = 0x2029, // Data: DGUS_Data::Heater + PID_SetTemp = 0x202A, // Type: Integer (16 bits unsigned) + PID_Run = 0x202B, + POWERLOSS_Abort = 0x202C, // Popup / Data: DGUS_Data::Popup + POWERLOSS_Resume = 0x202D, // Popup / Data: DGUS_Data::Popup + WAIT_Abort = 0x202E, // Popup / Data: DGUS_Data::Popup + WAIT_Continue = 0x202F, // WRITE-ONLY VARIABLES - MESSAGE_Status = 0x3000, // 0x3000 - 0x301F - SD_Type = 0x3020, // 0x3020 - 0x3024 / Data: DGUS_Data::SDType - SD_FileName0 = 0x3025, // 0x3025 - 0x3044 - SD_FileName1 = 0x3045, // 0x3045 - 0x3064 - SD_FileName2 = 0x3065, // 0x3065 - 0x3084 - SD_FileName3 = 0x3085, // 0x3085 - 0x30A4 - SD_FileName4 = 0x30A5, // 0x30A5 - 0x30C4 - SD_ScrollIcons = 0x30C5, // Bits: DGUS_Data::ScrollIcon - SD_SelectedFileName = 0x30C6, // 0x30C6 - 0x30E5 - STATUS_PositionZ = 0x30E6, // Type: Fixed point, 1 decimal (16 bits signed) - STATUS_Ellapsed = 0x30E7, // 0x30E7 - 0x30F5 - STATUS_Percent = 0x30F6, // Type: Integer (16 bits unsigned) - STATUS_Icons = 0x30F7, // Bits: DGUS_Data::StatusIcon - ADJUST_Feedrate = 0x30F8, // Type: Integer (16 bits signed) - ADJUST_Flowrate_CUR = 0x30F9, // Type: Integer (16 bits signed) + MESSAGE_Status = 0x3000, // 0x3000 - 0x301F + SD_Type = 0x3020, // 0x3020 - 0x3024 / Data: DGUS_Data::SDType + SD_FileName0 = 0x3025, // 0x3025 - 0x3044 + SD_FileName1 = 0x3045, // 0x3045 - 0x3064 + SD_FileName2 = 0x3065, // 0x3065 - 0x3084 + SD_FileName3 = 0x3085, // 0x3085 - 0x30A4 + SD_FileName4 = 0x30A5, // 0x30A5 - 0x30C4 + SD_ScrollIcons = 0x30C5, // Bits: DGUS_Data::ScrollIcon + SD_SelectedFileName = 0x30C6, // 0x30C6 - 0x30E5 + STATUS_PositionZ = 0x30E6, // Type: Fixed point, 1 decimal (16 bits signed) + STATUS_Ellapsed = 0x30E7, // 0x30E7 - 0x30F5 + STATUS_Percent = 0x30F6, // Type: Integer (16 bits unsigned) + STATUS_Icons = 0x30F7, // Bits: DGUS_Data::StatusIcon + ADJUST_Feedrate = 0x30F8, // Type: Integer (16 bits signed) + ADJUST_Flowrate_CUR = 0x30F9, // Type: Integer (16 bits signed) #if HAS_MULTI_EXTRUDER - ADJUST_Flowrate_E0 = 0x30FA, // Type: Integer (16 bits signed) - ADJUST_Flowrate_E1 = 0x30FB, // Type: Integer (16 bits signed) + ADJUST_Flowrate_E0 = 0x30FA, // Type: Integer (16 bits signed) + ADJUST_Flowrate_E1 = 0x30FB, // Type: Integer (16 bits signed) #endif - TEMP_Current_Bed = 0x30FC, // Type: Integer (16 bits signed) - TEMP_Target_Bed = 0x30FD, // Type: Integer (16 bits signed) - TEMP_Max_Bed = 0x30FE, // Type: Integer (16 bits unsigned) - TEMP_Current_H0 = 0x30FF, // Type: Integer (16 bits signed) - TEMP_Target_H0 = 0x3100, // Type: Integer (16 bits signed) - TEMP_Max_H0 = 0x3101, // Type: Integer (16 bits unsigned) + TEMP_Current_Bed = 0x30FC, // Type: Integer (16 bits signed) + TEMP_Target_Bed = 0x30FD, // Type: Integer (16 bits signed) + TEMP_Max_Bed = 0x30FE, // Type: Integer (16 bits unsigned) + TEMP_Current_H0 = 0x30FF, // Type: Integer (16 bits signed) + TEMP_Target_H0 = 0x3100, // Type: Integer (16 bits signed) + TEMP_Max_H0 = 0x3101, // Type: Integer (16 bits unsigned) #if HAS_MULTI_HOTEND - TEMP_Current_H1 = 0x3102, // Type: Integer (16 bits signed) - TEMP_Target_H1 = 0x3103, // Type: Integer (16 bits signed) - TEMP_Max_H1 = 0x3104, // Type: Integer (16 bits unsigned) + TEMP_Current_H1 = 0x3102, // Type: Integer (16 bits signed) + TEMP_Target_H1 = 0x3103, // Type: Integer (16 bits signed) + TEMP_Max_H1 = 0x3104, // Type: Integer (16 bits unsigned) #endif - STEPPER_Status = 0x3105, // Data: DGUS_Data::Status - LEVEL_OFFSET_Current = 0x3106, // Type: Fixed point, 2 decimals (16 bits signed) - LEVEL_OFFSET_StepIcons = 0x3107, // Bits: DGUS_Data::StepIcon - LEVEL_AUTO_DisableIcon = 0x3108, // Data: DGUS_Data::Status - LEVEL_AUTO_Grid = 0x3109, // 0x3109 - 0x3121 / Type: Fixed point, 3 decimals (16 bits signed) - LEVEL_PROBING_Icons1 = 0x3122, // Type: Integer (16 bits unsigned) / Each bit represents a grid point - LEVEL_PROBING_Icons2 = 0x3123, // Type: Integer (16 bits unsigned) / Each bit represents a grid point - FILAMENT_ExtruderIcons = 0x3124, // Data: DGUS_Data::ExtruderIcon - FILAMENT_Length = 0x3125, // Type: Integer (16 bits unsigned) - MOVE_CurrentX = 0x3126, // Type: Fixed point, 1 decimal (16 bits signed) - MOVE_CurrentY = 0x3127, // Type: Fixed point, 1 decimal (16 bits signed) - MOVE_CurrentZ = 0x3128, // Type: Fixed point, 1 decimal (16 bits signed) - MOVE_StepIcons = 0x3129, // Bits: DGUS_Data::StepIcon - SETTINGS2_BLTouch = 0x312A, // Data: DGUS_Data::Status - PID_HeaterIcons = 0x312B, // Data: DGUS_Data::HeaterIcon - PID_Temp = 0x312C, // Type: Integer (16 bits unsigned) - PID_Kp = 0x312D, // Type: Fixed point, 2 decimals (32 bits signed) - PID_Ki = 0x312F, // Type: Fixed point, 2 decimals (32 bits signed) - PID_Kd = 0x3131, // Type: Fixed point, 2 decimals (32 bits signed) - INFOS_Machine = 0x3133, // 0x3133 - 0x314A - INFOS_BuildVolume = 0x314B, // 0x314B - 0x3162 - INFOS_Version = 0x3163, // 0x3163 - 0x3172 - INFOS_TotalPrints = 0x3173, // Type: Integer (16 bits unsigned) - INFOS_FinishedPrints = 0x3174, // Type: Integer (16 bits unsigned) - INFOS_PrintTime = 0x3175, // 0x3175 - 0x318C - INFOS_LongestPrint = 0x318D, // 0x318D - 0x31A4 - INFOS_FilamentUsed = 0x31A5, // 0x31A5 - 0x31BC - WAIT_Icons = 0x31BD, // Bits: DGUS_Data::WaitIcon + STEPPER_Status = 0x3105, // Data: DGUS_Data::Status + LEVEL_OFFSET_Current = 0x3106, // Type: Fixed point, 2 decimals (16 bits signed) + LEVEL_OFFSET_StepIcons = 0x3107, // Bits: DGUS_Data::StepIcon + LEVEL_AUTO_DisableIcon = 0x3108, // Data: DGUS_Data::Status + LEVEL_AUTO_Grid = 0x3109, // 0x3109 - 0x3121 / Type: Fixed point, 3 decimals (16 bits signed) + LEVEL_PROBING_Icons1 = 0x3122, // Type: Integer (16 bits unsigned) / Each bit represents a grid point + LEVEL_PROBING_Icons2 = 0x3123, // Type: Integer (16 bits unsigned) / Each bit represents a grid point + FILAMENT_ExtruderIcons = 0x3124, // Data: DGUS_Data::ExtruderIcon + FILAMENT_Length = 0x3125, // Type: Integer (16 bits unsigned) + MOVE_CurrentX = 0x3126, // Type: Fixed point, 1 decimal (16 bits signed) + MOVE_CurrentY = 0x3127, // Type: Fixed point, 1 decimal (16 bits signed) + MOVE_CurrentZ = 0x3128, // Type: Fixed point, 1 decimal (16 bits signed) + MOVE_StepIcons = 0x3129, // Bits: DGUS_Data::StepIcon + SETTINGS2_BLTouch = 0x312A, // Data: DGUS_Data::Status + PID_HeaterIcons = 0x312B, // Data: DGUS_Data::HeaterIcon + PID_Temp = 0x312C, // Type: Integer (16 bits unsigned) + PID_Kp = 0x312D, // Type: Fixed point, 2 decimals (32 bits signed) + PID_Ki = 0x312F, // Type: Fixed point, 2 decimals (32 bits signed) + PID_Kd = 0x3131, // Type: Fixed point, 2 decimals (32 bits signed) + INFOS_Machine = 0x3133, // 0x3133 - 0x314A + INFOS_BuildVolume = 0x314B, // 0x314B - 0x3162 + INFOS_Version = 0x3163, // 0x3163 - 0x3172 + INFOS_TotalPrints = 0x3173, // Type: Integer (16 bits unsigned) + INFOS_FinishedPrints = 0x3174, // Type: Integer (16 bits unsigned) + INFOS_PrintTime = 0x3175, // 0x3175 - 0x318C + INFOS_LongestPrint = 0x318D, // 0x318D - 0x31A4 + INFOS_FilamentUsed = 0x31A5, // 0x31A5 - 0x31BC + WAIT_Icons = 0x31BD, // Bits: DGUS_Data::WaitIcon // READ-WRITE VARIABLES - FAN0_Speed = 0x4000, // Type: Integer (16 bits unsigned) / Data: fan speed as percent (0-100) - GCODE_Data = 0x4001, // 0x4001 - 0x4020 - PID_Cycles = 0x4021, // Type: Integer (16 bits unsigned) - VOLUME_Level = 0x4022, // Type: Integer (16 bits unsigned) / Data: volume as percent (0-100) - BRIGHTNESS_Level = 0x4023, // Type: Integer (16 bits unsigned) / Data: brightness as percent (0-100) + FAN0_Speed = 0x4000, // Type: Integer (16 bits unsigned) / Data: fan speed as percent (0-100) + GCODE_Data = 0x4001, // 0x4001 - 0x4020 + PID_Cycles = 0x4021, // Type: Integer (16 bits unsigned) + VOLUME_Level = 0x4022, // Type: Integer (16 bits unsigned) / Data: volume as percent (0-100) + BRIGHTNESS_Level = 0x4023, // Type: Integer (16 bits unsigned) / Data: brightness as percent (0-100) // SPECIAL CASES - STATUS_Percent_Complete = 0x5000, // Same as STATUS_Percent, but always 100% - INFOS_Debug = 0x5001, + STATUS_Percent_Complete = 0x5000, // Same as STATUS_Percent, but always 100% + INFOS_Debug = 0x5001, }; diff --git a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h index 846fd1594216..dda3c888fe18 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h @@ -25,7 +25,9 @@ #include "DGUS_Addr.h" -static_assert((DGUS_LEVEL_GRID_SIZE == GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y), "DGUS_LEVEL_GRID_SIZE incompatible with current mesh."); +#if DGUS_LEVEL_GRID_SIZE != GRID_MAX_POINTS + #error "DGUS_LEVEL_GRID_SIZE is incompatible with current mesh." +#endif #ifndef DGUS_DEFAULT_VOLUME #define DGUS_DEFAULT_VOLUME 50 diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp index faa6a0d23556..4370a06d046e 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp @@ -178,7 +178,7 @@ const struct DGUS_VP vp_list[] PROGMEM = { nullptr, &DGUSTxHandler::PositionZ), VP_HELPER(DGUS_Addr::STATUS_Ellapsed, - DGUS_ELLAPSED_LEN, + DGUS_ELAPSED_LEN, VPFLAG_AUTOUPLOAD, nullptr, nullptr, diff --git a/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp b/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp index cdde3c4f6b51..448d078cc41d 100644 --- a/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp +++ b/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp @@ -111,8 +111,6 @@ void FileNavigator::getFiles(uint16_t index) { rtscheck.RTS_SndData(10, FilenameIcon1 + j); } - DEBUG_ECHOLNPGM("index=", index, " currentindex=", currentindex, "folderdepth=", folderdepth); - if (currentindex == 0 && folderdepth > 0) { // Add a link to go up a folder files--; rtscheck.RTS_SndData("Up Directory", SDFILE_ADDR); @@ -149,7 +147,6 @@ void FileNavigator::getFiles(uint16_t index) { } void FileNavigator::changeDIR(char *folder) { - DEBUG_ECHOLNPGM("currentfolder: ", currentfoldername, " New: ", folder); if (folderdepth >= MAX_FOLDER_DEPTH) return; // limit the folder depth strcat(currentfoldername, folder); strcat(currentfoldername, "/"); @@ -175,7 +172,6 @@ void FileNavigator::upDIR() { pos = strchr(currentfoldername, '/'); pos[1] = '\0'; } - DEBUG_ECHOLNPGM("depth: ", folderdepth, " currentfoldername: ", currentfoldername); } char* FileNavigator::getCurrentFolderName() { return currentfoldername; } diff --git a/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp b/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp index 6742c2c01019..02759025576d 100644 --- a/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp +++ b/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp @@ -53,8 +53,7 @@ namespace ExtUI { uint8_t startprogress = 0; char waitway = 0; - int recnum = 0; - unsigned char Percentrecord = 0; + int16_t recnum = 0; float ChangeMaterialbuf[2] = {0}; char NozzleTempStatus[3] = {0}; @@ -62,11 +61,11 @@ namespace ExtUI { char PrinterStatusKey[2] = {0}; // PrinterStatusKey[1] value: 0 represents to keep temperature, 1 represents to heating , 2 stands for cooling , 3 stands for printing // PrinterStatusKey[0] value: 0 reprensents 3D printer ready - unsigned char AxisPagenum = 0; // 0 for 10mm, 1 for 1mm, 2 for 0.1mm + uint8_t AxisPagenum = 0; // 0 for 10mm, 1 for 1mm, 2 for 0.1mm bool InforShowStatus = true; bool TPShowStatus = false; // true for only opening time and percentage, false for closing time and percentage. bool AutohomeKey = false; - unsigned char AutoHomeIconNum; + uint8_t AutoHomeIconNum; int16_t userConfValidation = 0; uint8_t lastPauseMsgState = 0; @@ -117,7 +116,7 @@ namespace ExtUI { rtscheck.RTS_SndData(getActualFan_percent((fan_t)getActiveTool()), FanKeyIcon); /***************transmit Printer information to screen*****************/ - for (int j = 0; j < 20; j++) // clean filename + for (int16_t j = 0; j < 20; j++) // clean filename rtscheck.RTS_SndData(0, MacVersion + j); char sizebuf[20] = {0}; sprintf(sizebuf, "%d X %d X %d", Y_BED_SIZE, X_BED_SIZE, Z_MAX_POS); @@ -131,20 +130,18 @@ namespace ExtUI { rtscheck.RTS_SndData(0, PrintscheduleIcon + 1); /************************clean screen*******************************/ - for (int i = 0; i < MaxFileNumber; i++) - for (int j = 0; j < 10; j++) rtscheck.RTS_SndData(0, SDFILE_ADDR + i * 10 + j); + for (int16_t i = 0; i < MaxFileNumber; i++) + for (int16_t j = 0; j < 10; j++) rtscheck.RTS_SndData(0, SDFILE_ADDR + i * 10 + j); - for (int j = 0; j < 10; j++) { + for (int16_t j = 0; j < 10; j++) { rtscheck.RTS_SndData(0, Printfilename + j); // clean screen. rtscheck.RTS_SndData(0, Choosefilename + j); // clean filename } - for (int j = 0; j < 8; j++) rtscheck.RTS_SndData(0, FilenameCount + j); - for (int j = 1; j <= MaxFileNumber; j++) { + for (int16_t j = 0; j < 8; j++) rtscheck.RTS_SndData(0, FilenameCount + j); + for (int16_t j = 1; j <= MaxFileNumber; j++) { rtscheck.RTS_SndData(10, FilenameIcon + j); rtscheck.RTS_SndData(10, FilenameIcon1 + j); } - - DEBUG_ECHOLNPGM("==Dwin Init Complete=="); } void onIdle() { @@ -181,7 +178,7 @@ namespace ExtUI { case PAUSE_MESSAGE_HEAT: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); break; case PAUSE_MESSAGE_HEATING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; case PAUSE_MESSAGE_OPTION: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_OPTION_HEADER)); break; - case PAUSE_MESSAGE_STATUS: DEBUG_ECHOLNPGM("PauseStatus"); break; + case PAUSE_MESSAGE_STATUS: break; default: onUserConfirmRequired(PSTR("Confirm Continue")); break; } userConfValidation = 0; @@ -216,7 +213,6 @@ namespace ExtUI { case 1: if (isPositionKnown()) { InforShowStatus = true; - DEBUG_ECHOLNPGM("==waitway 1=="); rtscheck.RTS_SndData(ExchangePageBase + 54, ExchangepageAddr); waitway = 0; } @@ -227,7 +223,6 @@ namespace ExtUI { break; case 3: - DEBUG_ECHOLNPGM("==waitway 3=="); //if(isPositionKnown() && (getActualTemp_celsius(BED) >= (getTargetTemp_celsius(BED)-1))) { rtscheck.RTS_SndData(ExchangePageBase + 64, ExchangepageAddr); waitway = 7; @@ -237,8 +232,7 @@ namespace ExtUI { case 4: if (AutohomeKey && isPositionKnown() && !commandsInQueue()) { // Manual Move Home Done - DEBUG_ECHOLNPGM("==waitway 4=="); - // rtscheck.RTS_SndData(ExchangePageBase + 71 + AxisPagenum, ExchangepageAddr); + //rtscheck.RTS_SndData(ExchangePageBase + 71 + AxisPagenum, ExchangepageAddr); AutohomeKey = false; waitway = 0; } @@ -247,7 +241,6 @@ namespace ExtUI { if (isPositionKnown() && !commandsInQueue()) { InforShowStatus = true; waitway = 0; - DEBUG_ECHOLNPGM("==waitway 5=="); rtscheck.RTS_SndData(ExchangePageBase + 78, ExchangepageAddr); // exchange to 78 page } break; @@ -277,7 +270,6 @@ namespace ExtUI { else injectCommands(F("M22\nM21")); startprogress = 254; - DEBUG_ECHOLNPGM(" startprogress "); InforShowStatus = true; TPShowStatus = false; rtscheck.RTS_SndData(ExchangePageBase + 45, ExchangepageAddr); @@ -289,28 +281,28 @@ namespace ExtUI { else rtscheck.RTS_SndData(startprogress - 100, StartIcon + 1); - // rtscheck.RTS_SndData((startprogress++) % 5, ExchFlmntIcon); + //rtscheck.RTS_SndData((startprogress++) % 5, ExchFlmntIcon); if (isPrinting()) { rtscheck.RTS_SndData(getActualFan_percent((fan_t)getActiveTool()), FanKeyIcon); rtscheck.RTS_SndData(getProgress_seconds_elapsed() / 3600, Timehour); rtscheck.RTS_SndData((getProgress_seconds_elapsed() % 3600) / 60, Timemin); if (getProgress_percent() > 0) { - Percentrecord = getProgress_percent() + 1; - if (Percentrecord <= 50) { - rtscheck.RTS_SndData((unsigned int)Percentrecord * 2, PrintscheduleIcon); + const uint16_t perc = getProgress_percent() + 1; + if (perc <= 50) { + rtscheck.RTS_SndData(uint16_t(perc) * 2, PrintscheduleIcon); rtscheck.RTS_SndData(0, PrintscheduleIcon + 1); } else { rtscheck.RTS_SndData(100, PrintscheduleIcon); - rtscheck.RTS_SndData((unsigned int)Percentrecord * 2 - 100, PrintscheduleIcon + 1); + rtscheck.RTS_SndData(uint16_t(perc) * 2 - 100, PrintscheduleIcon + 1); } } else { rtscheck.RTS_SndData(0, PrintscheduleIcon); rtscheck.RTS_SndData(0, PrintscheduleIcon + 1); } - rtscheck.RTS_SndData((unsigned int)getProgress_percent(), Percentage); + rtscheck.RTS_SndData(uint16_t(getProgress_percent()), Percentage); } else { // Not printing settings rtscheck.RTS_SndData(map(constrain(Settings.display_volume, 0, 255), 0, 255, 0, 100), VolumeDisplay); @@ -322,31 +314,31 @@ namespace ExtUI { else rtscheck.RTS_SndData(2, DisplayStandbyEnableIndicator); - rtscheck.RTS_SndData((unsigned int)(getAxisSteps_per_mm(X) * 10), StepMM_X); - rtscheck.RTS_SndData((unsigned int)(getAxisSteps_per_mm(Y) * 10), StepMM_Y); - rtscheck.RTS_SndData((unsigned int)(getAxisSteps_per_mm(Z) * 10), StepMM_Z); - rtscheck.RTS_SndData((unsigned int)(getAxisSteps_per_mm(E0) * 10), StepMM_E); + rtscheck.RTS_SndData(uint16_t(getAxisSteps_per_mm(X)) * 10, StepMM_X); + rtscheck.RTS_SndData(uint16_t(getAxisSteps_per_mm(Y)) * 10, StepMM_Y); + rtscheck.RTS_SndData(uint16_t(getAxisSteps_per_mm(Z)) * 10, StepMM_Z); + rtscheck.RTS_SndData(uint16_t(getAxisSteps_per_mm(E0)) * 10, StepMM_E); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxAcceleration_mm_s2(X) / 100), Accel_X); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxAcceleration_mm_s2(Y) / 100), Accel_Y); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxAcceleration_mm_s2(Z) / 10), Accel_Z); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxAcceleration_mm_s2(E0)), Accel_E); + rtscheck.RTS_SndData(uint16_t(getAxisMaxAcceleration_mm_s2(X)) / 100, Accel_X); + rtscheck.RTS_SndData(uint16_t(getAxisMaxAcceleration_mm_s2(Y)) / 100, Accel_Y); + rtscheck.RTS_SndData(uint16_t(getAxisMaxAcceleration_mm_s2(Z)) / 10, Accel_Z); + rtscheck.RTS_SndData(uint16_t(getAxisMaxAcceleration_mm_s2(E0)), Accel_E); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxFeedrate_mm_s(X)), Feed_X); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxFeedrate_mm_s(Y)), Feed_Y); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxFeedrate_mm_s(Z)), Feed_Z); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxFeedrate_mm_s(E0)), Feed_E); + rtscheck.RTS_SndData(uint16_t(getAxisMaxFeedrate_mm_s(X)), Feed_X); + rtscheck.RTS_SndData(uint16_t(getAxisMaxFeedrate_mm_s(Y)), Feed_Y); + rtscheck.RTS_SndData(uint16_t(getAxisMaxFeedrate_mm_s(Z)), Feed_Z); + rtscheck.RTS_SndData(uint16_t(getAxisMaxFeedrate_mm_s(E0)), Feed_E); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxJerk_mm_s(X) * 100), Jerk_X); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxJerk_mm_s(Y) * 100), Jerk_Y); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxJerk_mm_s(Z) * 100), Jerk_Z); - rtscheck.RTS_SndData(((unsigned int)getAxisMaxJerk_mm_s(E0) * 100), Jerk_E); + rtscheck.RTS_SndData(uint16_t(getAxisMaxJerk_mm_s(X)) * 100, Jerk_X); + rtscheck.RTS_SndData(uint16_t(getAxisMaxJerk_mm_s(Y)) * 100, Jerk_Y); + rtscheck.RTS_SndData(uint16_t(getAxisMaxJerk_mm_s(Z)) * 100, Jerk_Z); + rtscheck.RTS_SndData(uint16_t(getAxisMaxJerk_mm_s(E0)) * 100, Jerk_E); #if HAS_HOTEND_OFFSET - rtscheck.RTS_SndData(((unsigned int)getNozzleOffset_mm(X, E1) * 10), T2Offset_X); - rtscheck.RTS_SndData(((unsigned int)getNozzleOffset_mm(Y, E1) * 10), T2Offset_Y); - rtscheck.RTS_SndData(((unsigned int)getNozzleOffset_mm(Z, E1) * 10), T2Offset_Z); - rtscheck.RTS_SndData((unsigned int)(getAxisSteps_per_mm(E1) * 10), T2StepMM_E); + rtscheck.RTS_SndData(uint16_t(getNozzleOffset_mm(X, E1)) * 10, T2Offset_X); + rtscheck.RTS_SndData(uint16_t(getNozzleOffset_mm(Y, E1)) * 10, T2Offset_Y); + rtscheck.RTS_SndData(uint16_t(getNozzleOffset_mm(Z, E1)) * 10, T2Offset_Z); + rtscheck.RTS_SndData(uint16_t(getAxisSteps_per_mm(E1)) * 10, T2StepMM_E); #endif #if HAS_BED_PROBE @@ -357,42 +349,38 @@ namespace ExtUI { #if HAS_PID_HEATING rtscheck.RTS_SndData(pid_hotendAutoTemp, HotendPID_AutoTmp); rtscheck.RTS_SndData(pid_bedAutoTemp, BedPID_AutoTmp); - rtscheck.RTS_SndData((unsigned int)(getPID_Kp(E0) * 10), HotendPID_P); - rtscheck.RTS_SndData((unsigned int)(getPID_Ki(E0) * 10), HotendPID_I); - rtscheck.RTS_SndData((unsigned int)(getPID_Kd(E0) * 10), HotendPID_D); + rtscheck.RTS_SndData(uint16_t(getPID_Kp(E0)) * 10, HotendPID_P); + rtscheck.RTS_SndData(uint16_t(getPID_Ki(E0)) * 10, HotendPID_I); + rtscheck.RTS_SndData(uint16_t(getPID_Kd(E0)) * 10, HotendPID_D); #if ENABLED(PIDTEMPBED) - rtscheck.RTS_SndData((unsigned int)(getBedPID_Kp() * 10), BedPID_P); - rtscheck.RTS_SndData((unsigned int)(getBedPID_Ki() * 10), BedPID_I); - rtscheck.RTS_SndData((unsigned int)(getBedPID_Kd() * 10), BedPID_D); + rtscheck.RTS_SndData(uint16_t(getBedPID_Kp()) * 10, BedPID_P); + rtscheck.RTS_SndData(uint16_t(getBedPID_Ki()) * 10, BedPID_I); + rtscheck.RTS_SndData(uint16_t(getBedPID_Kd()) * 10, BedPID_D); #endif #endif } rtscheck.RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z); - rtscheck.RTS_SndData((unsigned int)(getFlow_percent(E0)), Flowrate); - - if (NozzleTempStatus[0] || NozzleTempStatus[2]) { // statuse of loadfilement and unloadfinement when temperature is less than - unsigned int IconTemp; + rtscheck.RTS_SndData(uint16_t(getFlow_percent(E0)), Flowrate); - IconTemp = getActualTemp_celsius(getActiveTool()) * 100 / getTargetTemp_celsius(getActiveTool()); - NOMORE(IconTemp, 100); + if (NozzleTempStatus[0] || NozzleTempStatus[2]) { // statuse of loadfilament and unloadfinement when temperature is less than + uint16_t IconTemp = getActualTemp_celsius(getActiveTool()) * 100 / getTargetTemp_celsius(getActiveTool()); + NOMORE(IconTemp, 100U); rtscheck.RTS_SndData(IconTemp, HeatPercentIcon); if (getActualTemp_celsius(getActiveTool()) > EXTRUDE_MINTEMP && NozzleTempStatus[0] != 0) { NozzleTempStatus[0] = 0; rtscheck.RTS_SndData(10 * ChangeMaterialbuf[0], FilamentUnit1); rtscheck.RTS_SndData(10 * ChangeMaterialbuf[1], FilamentUnit2); - DEBUG_ECHOLNPGM("==Heating Done Change Filament=="); rtscheck.RTS_SndData(ExchangePageBase + 65, ExchangepageAddr); } else if (getActualTemp_celsius(getActiveTool()) >= getTargetTemp_celsius(getActiveTool()) && NozzleTempStatus[2]) { - DEBUG_ECHOLNPGM("***NozzleTempStatus[2] =", (int)NozzleTempStatus[2]); NozzleTempStatus[2] = 0; - TPShowStatus = true; + TPShowStatus = true; rtscheck.RTS_SndData(4, ExchFlmntIcon); rtscheck.RTS_SndData(ExchangePageBase + 83, ExchangepageAddr); } else if (NozzleTempStatus[2]) { - // rtscheck.RTS_SndData((startprogress++) % 5, ExchFlmntIcon); + //rtscheck.RTS_SndData((startprogress++) % 5, ExchFlmntIcon); } } @@ -431,20 +419,18 @@ namespace ExtUI { memset(databuf, 0, sizeof(databuf)); } - int RTSSHOW::RTS_RecData() { + int16_t RTSSHOW::RTS_RecData() { uint8_t receivedbyte; while (DWIN_SERIAL.available()) switch (rx_datagram_state) { case DGUS_IDLE: // Waiting for the first header byte receivedbyte = DWIN_SERIAL.read(); - //DEBUG_ECHOLNPGM("< ",receivedbyte); if (FHONE == receivedbyte) rx_datagram_state = DGUS_HEADER1_SEEN; break; case DGUS_HEADER1_SEEN: // Waiting for the second header byte receivedbyte = DWIN_SERIAL.read(); - //DEBUG_ECHOLNPGM(" ", receivedbyte); rx_datagram_state = (FHTWO == receivedbyte) ? DGUS_HEADER2_SEEN : DGUS_IDLE; break; @@ -462,20 +448,19 @@ namespace ExtUI { Initialized = true; // We've talked to it, so we defined it as initialized. uint8_t command = DWIN_SERIAL.read(); - // DEBUGLCDCOMM_ECHOPAIR("# ", command); + //DEBUGLCDCOMM_ECHOPAIR("# ", command); uint8_t readlen = rx_datagram_len - 1; // command is part of len. - unsigned char tmp[rx_datagram_len - 1]; - unsigned char *ptmp = tmp; + uint8_t tmp[rx_datagram_len - 1]; + uint8_t *ptmp = tmp; while (readlen--) { receivedbyte = DWIN_SERIAL.read(); - // DEBUGLCDCOMM_ECHOPAIR(" ", receivedbyte); + //DEBUGLCDCOMM_ECHOPAIR(" ", receivedbyte); *ptmp++ = receivedbyte; } - // DEBUGLCDCOMM_ECHOPGM(" # "); + //DEBUGLCDCOMM_ECHOPGM(" # "); // mostly we'll get this: 5A A5 03 82 4F 4B -- ACK on 0x82, so discard it. if (command == VarAddr_W && 'O' == tmp[0] && 'K' == tmp[1]) { - // DEBUG_ECHOLNPGM(">"); rx_datagram_state = DGUS_IDLE; break; } @@ -491,19 +476,13 @@ namespace ExtUI { const uint16_t vp = tmp[0] << 8 | tmp[1]; const uint8_t dlen = tmp[2] << 1; // Convert to Bytes. (Display works with words) - //DEBUG_ECHOLNPGM(" vp=", vp, " dlen=", dlen); recdat.addr = vp; recdat.len = tmp[2]; - for (unsigned int i = 0; i < dlen; i += 2) { + for (uint16_t i = 0; i < dlen; i += 2) { recdat.data[i / 2] = tmp[3 + i]; recdat.data[i / 2] = (recdat.data[i / 2] << 8 ) | tmp[4 + i]; } - DEBUG_ECHOLNPGM("VP received: ", vp, " - len ", tmp[2]); - - DEBUG_ECHOLNPGM("d1: ", tmp[3], " - d2 ", tmp[4]); - DEBUG_ECHOLNPGM("d3: ", tmp[5], " - d4 ", tmp[6]); - rx_datagram_state = DGUS_IDLE; return 2; break; @@ -523,7 +502,7 @@ namespace ExtUI { databuf[3] = snddat.command; if (snddat.command == 0x80) { // to write data to the register databuf[4] = snddat.addr; - for (int i = 0; i < (snddat.len - 2); i++) databuf[5 + i] = snddat.data[i]; + for (int16_t i = 0; i < (snddat.len - 2); i++) databuf[5 + i] = snddat.data[i]; } else if (snddat.len == 3 && (snddat.command == 0x81)) { // to read data from the register databuf[4] = snddat.addr; @@ -532,7 +511,7 @@ namespace ExtUI { else if (snddat.command == 0x82) { // to write data to the variate databuf[4] = snddat.addr >> 8; databuf[5] = snddat.addr & 0xFF; - for (int i = 0; i < (snddat.len - 3); i += 2) { + for (int16_t i = 0; i < (snddat.len - 3); i += 2) { databuf[6 + i] = snddat.data[i / 2] >> 8; databuf[7 + i] = snddat.data[i / 2] & 0xFF; } @@ -542,7 +521,7 @@ namespace ExtUI { databuf[5] = snddat.addr & 0xFF; databuf[6] = snddat.bytelen; } - for (int i = 0; i < (snddat.len + 3); i++) { + for (int16_t i = 0; i < (snddat.len + 3); i++) { DWIN_SERIAL.write(databuf[i]); delay_us(1); } @@ -554,15 +533,15 @@ namespace ExtUI { } } - void RTSSHOW::RTS_SndData(const String &s, unsigned long addr, unsigned char cmd /*= VarAddr_W*/) { + void RTSSHOW::RTS_SndData(const String &s, uint32_t addr, uint8_t cmd/*=VarAddr_W*/) { if (s.length() < 1) return; RTS_SndData(s.c_str(), addr, cmd); } - void RTSSHOW::RTS_SndData(const char *str, unsigned long addr, unsigned char cmd /*= VarAddr_W*/) { + void RTSSHOW::RTS_SndData(const char *str, uint32_t addr, uint8_t cmd/*=VarAddr_W*/) { - int len = strlen(str); - constexpr int maxlen = SizeofDatabuf - 6; + int16_t len = strlen(str); + constexpr int16_t maxlen = SizeofDatabuf - 6; if (len > 0) { if (len > maxlen) len = maxlen; databuf[0] = FHONE; @@ -571,9 +550,9 @@ namespace ExtUI { databuf[3] = cmd; databuf[4] = addr >> 8; databuf[5] = addr & 0x00FF; - for (int i = 0; i < len; i++) databuf[6 + i] = str[i]; + for (int16_t i = 0; i < len; i++) databuf[6 + i] = str[i]; - for (int i = 0; i < (len + 6); i++) { + for (int16_t i = 0; i < (len + 6); i++) { DWIN_SERIAL.write(databuf[i]); delay_us(1); } @@ -581,58 +560,50 @@ namespace ExtUI { } } - void RTSSHOW::RTS_SndData(char c, unsigned long addr, unsigned char cmd /*= VarAddr_W*/) { + void RTSSHOW::RTS_SndData(char c, uint32_t addr, uint8_t cmd/*=VarAddr_W*/) { snddat.command = cmd; snddat.addr = addr; - snddat.data[0] = (unsigned long)c; + snddat.data[0] = uint32_t(c); snddat.data[0] = snddat.data[0] << 8; snddat.len = 5; RTS_SndData(); } - void RTSSHOW::RTS_SndData(unsigned char *str, unsigned long addr, unsigned char cmd) { RTS_SndData((char *)str, addr, cmd); } + void RTSSHOW::RTS_SndData(uint8_t *str, uint32_t addr, uint8_t cmd) { RTS_SndData((char *)str, addr, cmd); } - void RTSSHOW::RTS_SndData(int n, unsigned long addr, unsigned char cmd /*= VarAddr_W*/) { + void RTSSHOW::RTS_SndData(int16_t n, uint32_t addr, uint8_t cmd/*=VarAddr_W*/) { if (cmd == VarAddr_W) { - if ((uint8_t)n > 0xFFFF) { - snddat.data[0] = n >> 16; - snddat.data[1] = n & 0xFFFF; - snddat.len = 7; - } - else { - snddat.data[0] = n; - snddat.len = 5; - } + snddat.data[0] = n; + snddat.len = 5; } else if (cmd == RegAddr_W) { snddat.data[0] = n; - snddat.len = 3; + snddat.len = 3; } else if (cmd == VarAddr_R) { snddat.bytelen = n; - snddat.len = 4; + snddat.len = 4; } snddat.command = cmd; - snddat.addr = addr; + snddat.addr = addr; RTS_SndData(); } - void RTSSHOW::RTS_SndData(unsigned int n, unsigned long addr, unsigned char cmd) { RTS_SndData((int)n, addr, cmd); } + void RTSSHOW::RTS_SndData(uint16_t n, uint32_t addr, uint8_t cmd) { RTS_SndData(int16_t(n), addr, cmd); } - void RTSSHOW::RTS_SndData(float n, unsigned long addr, unsigned char cmd) { RTS_SndData((int)n, addr, cmd); } + void RTSSHOW::RTS_SndData(float n, uint32_t addr, uint8_t cmd) { RTS_SndData(int16_t(n), addr, cmd); } - void RTSSHOW::RTS_SndData(long n, unsigned long addr, unsigned char cmd) { RTS_SndData((unsigned long)n, addr, cmd); } + void RTSSHOW::RTS_SndData(int32_t n, uint32_t addr, uint8_t cmd) { RTS_SndData(uint32_t(n), addr, cmd); } - void RTSSHOW::RTS_SndData(unsigned long n, unsigned long addr, unsigned char cmd /*= VarAddr_W*/) { + void RTSSHOW::RTS_SndData(uint32_t n, uint32_t addr, uint8_t cmd/*=VarAddr_W*/) { if (cmd == VarAddr_W) { if (n > 0xFFFF) { snddat.data[0] = n >> 16; snddat.data[1] = n & 0xFFFF; - - // snddat.data[0] = n >> 24; - // snddat.data[1] = n >> 16; - // snddat.data[2] = n >> 8; - // snddat.data[3] = n; + //snddat.data[0] = n >> 24; + //snddat.data[1] = n >> 16; + //snddat.data[2] = n >> 8; + //snddat.data[3] = n; snddat.len = 7; } else { @@ -650,17 +621,14 @@ namespace ExtUI { } void RTSSHOW::RTS_HandleData() { - int Checkkey = -1; - DEBUG_ECHOLNPGM(" *******RTS_HandleData******** "); + int16_t Checkkey = -1; if (waitway > 0) { // for waiting - DEBUG_ECHOLNPGM("waitway ==", (int)waitway); memset(&recdat, 0, sizeof(recdat)); recdat.head[0] = FHONE; recdat.head[1] = FHTWO; return; } - DEBUG_ECHOLNPGM("recdat.data[0] ==", recdat.data[0], " recdat.addr ==", recdat.addr); - for (int i = 0; Addrbuf[i] != 0; i++) + for (int16_t i = 0; Addrbuf[i] != 0; i++) if (recdat.addr == Addrbuf[i]) { if (Addrbuf[i] == NzBdSet || Addrbuf[i] == NozzlePreheat || Addrbuf[i] == BedPreheat || Addrbuf[i] == Flowrate) Checkkey = ManualSetTemp; @@ -697,16 +665,13 @@ namespace ExtUI { case DisplayStandbyBrightness: Checkkey = DisplayStandbyBrightness; break; case DisplayStandbySeconds: Checkkey = DisplayStandbySeconds; break; default: - if (WITHIN(recdat.addr, AutolevelVal, 4400)) // ((int)AutolevelVal+(GRID_MAX_POINTS_X*GRID_MAX_POINTS_Y*2)) = 4400 with 5x5 mesh + if (WITHIN(recdat.addr, AutolevelVal, 4400)) // (int16_t(AutolevelVal) + GRID_MAX_POINTS * 2) = 4400 with 5x5 mesh Checkkey = AutolevelVal; else if (WITHIN(recdat.addr, SDFILE_ADDR, SDFILE_ADDR + 10 * (FileNum + 1))) Checkkey = Filename; break; } - DEBUG_ECHOLNPGM("== Checkkey=="); - DEBUG_ECHOLN(Checkkey); - if (Checkkey < 0) { memset(&recdat, 0, sizeof(recdat)); recdat.head[0] = FHONE; @@ -715,17 +680,14 @@ namespace ExtUI { } constexpr float lfrb[4] = BED_TRAMMING_INSET_LFRB; - DEBUG_ECHOLNPGM("BeginSwitch"); switch (Checkkey) { case Printfile: if (recdat.data[0] == 1) { // card InforShowStatus = false; - DEBUG_ECHOLNPGM("Handle Data PrintFile Pre"); filenavigator.getFiles(0); fileIndex = 0; recordcount = 0; - DEBUG_ECHOLNPGM("Handle Data PrintFile Post"); RTS_SndData(ExchangePageBase + 46, ExchangepageAddr); } else if (recdat.data[0] == 2) { // return after printing result. @@ -741,13 +703,11 @@ namespace ExtUI { RTS_SndData(0, Timehour); RTS_SndData(0, Timemin); - DEBUG_ECHOLNPGM("Handle Data PrintFile 2 Setting Screen "); RTS_SndData(ExchangePageBase + 45, ExchangepageAddr); // exchange to 45 page } else if (recdat.data[0] == 3) { // Temperature control InforShowStatus = true; TPShowStatus = false; - DEBUG_ECHOLNPGM("Handle Data PrintFile 3 Setting Screen "); if (getTargetFan_percent((fan_t)getActiveTool()) == 0) RTS_SndData(ExchangePageBase + 58, ExchangepageAddr); // exchange to 58 page, the fans off else @@ -763,7 +723,6 @@ namespace ExtUI { InforShowStatus = false; } else if (recdat.data[0] == 2) { - DEBUG_ECHOLNPGM("Handle Data Adjust 2 Setting Screen "); InforShowStatus = true; if (PrinterStatusKey[1] == 3) // during heating RTS_SndData(ExchangePageBase + 53, ExchangepageAddr); @@ -783,16 +742,13 @@ namespace ExtUI { case PrintChoice: if (recdat.addr == Stopprint) { - DEBUG_ECHOLNPGM("StopPrint"); if (recdat.data[0] == 240) { // no RTS_SndData(ExchangePageBase + 53, ExchangepageAddr); - DEBUG_ECHOLNPGM("Stop No", recdat.data[0] ); } else { RTS_SndData(ExchangePageBase + 45, ExchangepageAddr); RTS_SndData(0, Timehour); RTS_SndData(0, Timemin); - DEBUG_ECHOLNPGM("Stop Triggered", recdat.data[0] ); stopPrint(); } } @@ -823,17 +779,13 @@ namespace ExtUI { case Zoffset: float tmp_zprobe_offset; if (recdat.data[0] >= 32768) - tmp_zprobe_offset = ((float)recdat.data[0] - 65536) / 100; + tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100; else - tmp_zprobe_offset = ((float)recdat.data[0]) / 100; - DEBUG_ECHOLNPGM("Requested Offset ", tmp_zprobe_offset); + tmp_zprobe_offset = float(recdat.data[0]) / 100; if (WITHIN((tmp_zprobe_offset), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, axis_t(Z)); - if (tmpSteps == 0) { - DEBUG_ECHOLNPGM("Rounding to step"); - tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1; - } - smartAdjustAxis_steps(tmpSteps * -1, axis_t(Z), false); + if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1; + smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false); char zOffs[20], tmp1[11]; sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); onStatusChanged(zOffs); @@ -883,7 +835,7 @@ namespace ExtUI { RTS_SndData(PREHEAT_2_TEMP_BED, BedPreheat); } else if (recdat.data[0] == 0xF1) { - // InforShowStatus = true; + //InforShowStatus = true; #if FAN_COUNT > 0 for (uint8_t i = 0; i < FAN_COUNT; i++) setTargetFan_percent(0, (fan_t)i); #endif @@ -898,7 +850,6 @@ namespace ExtUI { break; case ManualSetTemp: - DEBUG_ECHOLNPGM("ManualSetTemp"); if (recdat.addr == NzBdSet) { if (recdat.data[0] == 0) { if (getTargetFan_percent((fan_t)getActiveTool()) == 0) @@ -916,65 +867,65 @@ namespace ExtUI { } } else if (recdat.addr == NozzlePreheat) { - setTargetTemp_celsius((float)recdat.data[0], H0); + setTargetTemp_celsius(float(recdat.data[0]), H0); } #if HAS_MULTI_HOTEND else if (recdat.addr == e2Preheat) { - setTargetTemp_celsius((float)recdat.data[0], H1); + setTargetTemp_celsius(float(recdat.data[0]), H1); } #endif else if (recdat.addr == BedPreheat) { - setTargetTemp_celsius((float)recdat.data[0], BED); + setTargetTemp_celsius(float(recdat.data[0]), BED); } else if (recdat.addr == Flowrate) { - setFlow_percent((int16_t)recdat.data[0], getActiveTool()); + setFlow_percent(int16_t(recdat.data[0]), getActiveTool()); } #if HAS_PID_HEATING else if (recdat.addr == HotendPID_AutoTmp) { - pid_hotendAutoTemp = (uint16_t)recdat.data[0]; + pid_hotendAutoTemp = uint16_t(recdat.data[0]); } else if (recdat.addr == BedPID_AutoTmp) { - pid_bedAutoTemp = (uint16_t)recdat.data[0]; + pid_bedAutoTemp = uint16_t(recdat.data[0]); } #endif else if (recdat.addr == Accel_X) { - setAxisMaxAcceleration_mm_s2((uint16_t)recdat.data[0] * 100, X); + setAxisMaxAcceleration_mm_s2(uint16_t(recdat.data[0]) * 100, X); } else if (recdat.addr == Accel_Y) { - setAxisMaxAcceleration_mm_s2((uint16_t)recdat.data[0] * 100, Y); + setAxisMaxAcceleration_mm_s2(uint16_t(recdat.data[0]) * 100, Y); } else if (recdat.addr == Accel_Z) { - setAxisMaxAcceleration_mm_s2((uint16_t)recdat.data[0] * 10, Z); + setAxisMaxAcceleration_mm_s2(uint16_t(recdat.data[0]) * 10, Z); } else if (recdat.addr == Accel_E) { - setAxisMaxAcceleration_mm_s2((uint16_t)recdat.data[0], E0); - setAxisMaxAcceleration_mm_s2((uint16_t)recdat.data[0], E1); + setAxisMaxAcceleration_mm_s2(uint16_t(recdat.data[0]), E0); + setAxisMaxAcceleration_mm_s2(uint16_t(recdat.data[0]), E1); } else if (recdat.addr == Feed_X) { - setAxisMaxFeedrate_mm_s((uint16_t)recdat.data[0], X); + setAxisMaxFeedrate_mm_s(uint16_t(recdat.data[0]), X); } else if (recdat.addr == Feed_Y) { - setAxisMaxFeedrate_mm_s((uint16_t)recdat.data[0], Y); + setAxisMaxFeedrate_mm_s(uint16_t(recdat.data[0]), Y); } else if (recdat.addr == Feed_Z) { - setAxisMaxFeedrate_mm_s((uint16_t)recdat.data[0], Z); + setAxisMaxFeedrate_mm_s(uint16_t(recdat.data[0]), Z); } else if (recdat.addr == Feed_E) { - setAxisMaxFeedrate_mm_s((uint16_t)recdat.data[0], E0); - setAxisMaxFeedrate_mm_s((uint16_t)recdat.data[0], E1); + setAxisMaxFeedrate_mm_s(uint16_t(recdat.data[0]), E0); + setAxisMaxFeedrate_mm_s(uint16_t(recdat.data[0]), E1); } else if (recdat.addr == FanKeyIcon) { - setTargetFan_percent((uint16_t)recdat.data[0], (fan_t)getActiveTool()); + setTargetFan_percent(uint16_t(recdat.data[0]), (fan_t)getActiveTool()); } else { float tmp_float_handling; if (recdat.data[0] >= 32768) - tmp_float_handling = ((float)recdat.data[0] - 65536) / 100; + tmp_float_handling = (float(recdat.data[0]) - 65536) / 100; else - tmp_float_handling = ((float)recdat.data[0]) / 100; + tmp_float_handling = float(recdat.data[0]) / 100; if (recdat.addr == StepMM_X) { setAxisSteps_per_mm(tmp_float_handling * 10, X); } @@ -1089,7 +1040,7 @@ namespace ExtUI { for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { const bool zig = outer & 1; - const xy_uint8_t point = { zig ? (GRID_MAX_POINTS_X - 1) - inner : inner, outer }; + const xy_uint8_t point = { uint8_t(zig ? (GRID_MAX_POINTS_X - 1) - inner : inner), outer }; rtscheck.RTS_SndData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + abl_probe_index * 2); ++abl_probe_index; } @@ -1100,7 +1051,7 @@ namespace ExtUI { waitway = 2; RTS_SndData(ExchangePageBase + 64, ExchangepageAddr); } - else if (recdat.data[0] == 2) { // Exchange filement + else if (recdat.data[0] == 2) { // Exchange filament InforShowStatus = true; TPShowStatus = false; memset(ChangeMaterialbuf, 0, sizeof(ChangeMaterialbuf)); @@ -1131,7 +1082,6 @@ namespace ExtUI { break; case ReturnBack: - DEBUG_ECHOPGM("Return : ", recdat.data[0]); if (recdat.data[0] == 1) { // return to the tool page InforShowStatus = false; RTS_SndData(ExchangePageBase + 63, ExchangepageAddr); @@ -1141,7 +1091,6 @@ namespace ExtUI { break; case Bedlevel: - DEBUG_ECHOLNPGM("Bed Level Option ", recdat.data[0]); switch (recdat.data[0]) { case 1: { // Z-axis to home // Disallow Z homing if X or Y are unknown @@ -1152,7 +1101,6 @@ namespace ExtUI { case 2: { // Z-axis to Up if (WITHIN((getZOffset_mm() + 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { smartAdjustAxis_steps(getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); - //DEBUG_ECHOLNPGM("Babystep Pos Steps : ", (int)(getAxisSteps_per_mm(Z) / 10)); //setZOffset_mm(getZOffset_mm() + 0.1); RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z); char zOffs[20], tmp1[11]; @@ -1163,10 +1111,9 @@ namespace ExtUI { } case 3: { // Z-axis to Down if (WITHIN((getZOffset_mm() - 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - smartAdjustAxis_steps(((getAxisSteps_per_mm(Z) / 10) * -1), axis_t(Z), false); - // DEBUG_ECHOLNPGM("Babystep Neg Steps : ", (int)((getAxisSteps_per_mm(Z) / 10) * -1)); - // babystepAxis_steps((((int)getAxisSteps_per_mm(Z) / 10) * -1), axis_t(Z)); - // setZOffset_mm(getZOffset_mm() - 0.1); + smartAdjustAxis_steps(-getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); + //babystepAxis_steps(int16_t(-getAxisSteps_per_mm(Z)) / 10, axis_t(Z)); + //setZOffset_mm(getZOffset_mm() - 0.1); RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z); char zOffs[20], tmp1[11]; sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); @@ -1319,10 +1266,7 @@ namespace ExtUI { setActiveTool(getActiveTool() == E0 ? E1 : E0, !isAxisPositionKnown(X)); break; } - default: { - DEBUG_ECHOLNPGM("Unsupported Option Selected", recdat.data[0]); - break; - } + default: break; } RTS_SndData(10, FilenameIcon); @@ -1362,7 +1306,7 @@ namespace ExtUI { break; } - float targetPos = ((float)recdat.data[0]) / 10; + float targetPos = float(recdat.data[0]) / 10; LIMIT(targetPos, min, max); setAxisPosition_mm(targetPos, axis); waitway = 0; @@ -1372,39 +1316,38 @@ namespace ExtUI { case Filament: - unsigned int IconTemp; - if (recdat.addr == Exchfilement) { + uint16_t IconTemp; + if (recdat.addr == Exchfilament) { if (getActualTemp_celsius(getActiveTool()) < EXTRUDE_MINTEMP && recdat.data[0] < 5) { - RTS_SndData((int)EXTRUDE_MINTEMP, 0x1020); + RTS_SndData(int16_t(EXTRUDE_MINTEMP), 0x1020); delay_ms(5); RTS_SndData(ExchangePageBase + 66, ExchangepageAddr); break; } switch (recdat.data[0]) { - case 1: { // Unload filement1 - setAxisPosition_mm((getAxisPosition_mm(E0) - ChangeMaterialbuf[0]), E0); + case 1: { // Unload filament1 + setAxisPosition_mm(getAxisPosition_mm(E0) - ChangeMaterialbuf[0], E0); break; } - case 2: { // Load filement1 - setAxisPosition_mm((getAxisPosition_mm(E0) + ChangeMaterialbuf[0]), E0); + case 2: { // Load filament1 + setAxisPosition_mm(getAxisPosition_mm(E0) + ChangeMaterialbuf[0], E0); break; } - case 3: { // Unload filement2 - setAxisPosition_mm((getAxisPosition_mm(E1) - ChangeMaterialbuf[1]), E1); + case 3: { // Unload filament2 + setAxisPosition_mm(getAxisPosition_mm(E1) - ChangeMaterialbuf[1], E1); break; } - case 4: { // Load filement2 - setAxisPosition_mm((getAxisPosition_mm(E1) + ChangeMaterialbuf[1]), E1); + case 4: { // Load filament2 + setAxisPosition_mm(getAxisPosition_mm(E1) + ChangeMaterialbuf[1], E1); break; } case 5: { // sure to heat NozzleTempStatus[0] = 1; - // InforShowoStatus = true; setTargetTemp_celsius((PREHEAT_1_TEMP_HOTEND + 10), getActiveTool()); IconTemp = getActualTemp_celsius(getActiveTool()) * 100 / getTargetTemp_celsius(getActiveTool()); - NOMORE(IconTemp, 100); + NOMORE(IconTemp, 100U); RTS_SndData(IconTemp, HeatPercentIcon); RTS_SndData(getActualTemp_celsius(H0), NozzleTemp); @@ -1420,7 +1363,6 @@ namespace ExtUI { break; } case 0xF1: { // Sure to cancel heating - // InforShowoStatus = true; NozzleTempStatus[0] = 0; delay_ms(1); RTS_SndData(ExchangePageBase + 65, ExchangepageAddr); @@ -1433,27 +1375,20 @@ namespace ExtUI { RTS_SndData(10 * ChangeMaterialbuf[1], FilamentUnit2); } else if (recdat.addr == FilamentUnit1) { - ChangeMaterialbuf[0] = ((float)recdat.data[0]) / 10; + ChangeMaterialbuf[0] = float(recdat.data[0]) / 10; } else if (recdat.addr == FilamentUnit2) { - ChangeMaterialbuf[1] = ((float)recdat.data[0]) / 10; + ChangeMaterialbuf[1] = float(recdat.data[0]) / 10; } break; case LanguageChoice: - DEBUG_ECHOLNPGM("\n ***recdat.data[0] =", recdat.data[0]); - /*if(recdat.data[0]==1) { - settings.save(); - } - else { - injectCommands(F("M300")); - }*/ + //if (recdat.data[0] == 1) settings.save(); else injectCommands(F("M300")); + // may at some point use language change screens to save eeprom explicitly - DEBUG_ECHOLNPGM("InLangChoice"); switch (recdat.data[0]) { case 0: { - DEBUG_ECHOLNPGM("Store Settings"); injectCommands(F("M500")); break; } @@ -1471,12 +1406,10 @@ namespace ExtUI { #endif case 3: { - DEBUG_ECHOLNPGM("Init EEPROM"); injectCommands(F("M502\nM500")); break; } case 4: { - DEBUG_ECHOLNPGM("BLTouch Reset"); injectCommands(F("M999\nM280P0S160")); break; } @@ -1485,27 +1418,19 @@ namespace ExtUI { #if ENABLED(PIDTEMPBED) onStatusChanged(F("Bed PID Started")); startBedPIDTune(static_cast(pid_bedAutoTemp)); - #else - DEBUG_ECHOLNPGM("Bed PID Disabled"); #endif break; } case 6: { - DEBUG_ECHOLNPGM("Store Settings"); injectCommands(F("M500")); break; } - default: { - DEBUG_ECHOLNPGM("Invalid Option"); - break; - } + default: break; } break; - case No_Filament: - DEBUG_ECHOLNPGM("\n No Filament"); + case No_Filament: if (recdat.data[0] == 1) { // Filament is out, resume / resume selected on screen - DEBUG_ECHOLNPGM("Resume Yes during print"); if (ExtUI::pauseModeStatus != PAUSE_MESSAGE_PURGE && ExtUI::pauseModeStatus != PAUSE_MESSAGE_OPTION) { // setPauseMenuResponse(PAUSE_RESPONSE_RESUME_PRINT); setUserConfirmed(); @@ -1536,7 +1461,6 @@ namespace ExtUI { } } else if (recdat.data[0] == 0) { // Filamet is out, Cancel Selected - DEBUG_ECHOLNPGM(" Filament Response No"); if (ExtUI::pauseModeStatus == PAUSE_MESSAGE_PURGE || ExtUI::pauseModeStatus == PAUSE_MESSAGE_OPTION) { setPauseMenuResponse(PAUSE_RESPONSE_EXTRUDE_MORE); setUserConfirmed(); @@ -1573,14 +1497,11 @@ namespace ExtUI { break; case Filename: - DEBUG_ECHOLNPGM("Filename Selected"); if (isMediaInserted() && recdat.addr == FilenameChs) { - DEBUG_ECHOLNPGM("Has Media"); recordcount = recdat.data[0] - 1; if (filenavigator.currentindex == 0 && filenavigator.folderdepth > 0 && (fileIndex + recordcount) == 0) { filenavigator.upDIR(); - DEBUG_ECHOLNPGM("GoUpDir"); filenavigator.getFiles(0); fileIndex = 0; return; @@ -1589,24 +1510,22 @@ namespace ExtUI { if (filenavigator.currentindex == 0 && filenavigator.folderdepth > 0) recordcount = recordcount - 1; // account for return dir link in file index - for (int j = 1; j <= 4; j++) { // Clear filename BG Color and Frame - RTS_SndData((unsigned long)0xFFFF, FilenameNature + j * 16); // white + for (int16_t j = 1; j <= 4; j++) { // Clear filename BG Color and Frame + RTS_SndData(0xFFFFUL, FilenameNature + j * 16); // white RTS_SndData(10, FilenameIcon1 + j); // clean } - for (int j = 0; j < 10; j++) // clear current filename + for (int16_t j = 0; j < 10; j++) // clear current filename RTS_SndData(0, Choosefilename + j); if (filenavigator.getIndexisDir(fileIndex + recordcount)) { - DEBUG_ECHOLNPGM("Is Dir ", (fileIndex + recordcount)); filenavigator.changeDIR((char *)filenavigator.getIndexName(fileIndex + recordcount)); filenavigator.getFiles(0); fileIndex = 0; return; } else { - DEBUG_ECHOLNPGM("Is File ", (fileIndex + recordcount)); RTS_SndData(filenavigator.getIndexName(fileIndex + recordcount), Choosefilename); - RTS_SndData((unsigned long)0x87F0, FilenameNature + recdat.data[0] * 16); // Change BG of selected line to Light Green + RTS_SndData(0x87F0UL, FilenameNature + recdat.data[0] * 16); // Change BG of selected line to Light Green RTS_SndData(6, FilenameIcon1 + recdat.data[0]); // show frame } } @@ -1614,13 +1533,13 @@ namespace ExtUI { if (recdat.data[0] == 1 && isMediaInserted()) { // for sure printFile(filenavigator.getIndexName(fileIndex + recordcount)); - for (int j = 0; j < 10; j++) // clean screen. + for (int16_t j = 0; j < 10; j++) // clean screen. RTS_SndData(0, Printfilename + j); RTS_SndData(filenavigator.getIndexName(fileIndex + recordcount), Printfilename); - delay_ms(2); - delay_ms(2); + delay_ms(4); + RTS_SndData(ExchangePageBase + 53, ExchangepageAddr); TPShowStatus = InforShowStatus = true; @@ -1630,7 +1549,6 @@ namespace ExtUI { recordcount = 0; } else if (recdat.data[0] == 2) { // Page Down - DEBUG_ECHOLNPGM("PgDown"); if ((fileIndex + DISPLAY_FILES) < (filenavigator.maxFiles() + (filenavigator.folderdepth != 0))) { fileIndex = fileIndex + DISPLAY_FILES; // if(filenavigator.folderdepth!=0 && fileIndex!=0) //Shift to acknowledge Return DIR button on first page @@ -1641,7 +1559,6 @@ namespace ExtUI { } } else if (recdat.data[0] == 3) { // Page Up - DEBUG_ECHOLNPGM("PgUp"); if (fileIndex >= DISPLAY_FILES) { fileIndex = fileIndex - DISPLAY_FILES; // if(filenavigator.folderdepth!=0 && fileIndex!=0) //Shift to acknowledge Return DIR button on first page @@ -1651,7 +1568,6 @@ namespace ExtUI { } } else if (recdat.data[0] == 4) { // Page Up - DEBUG_ECHOLNPGM("Refresh"); injectCommands(F("M22\nM21")); } else if (recdat.data[0] == 0) { // return to main page @@ -1662,7 +1578,6 @@ namespace ExtUI { break; case VolumeDisplay: { - DEBUG_ECHOLNPGM("VolumeDisplay"); if (recdat.data[0] == 0) { Settings.display_volume = 0; Settings.display_sound = false; @@ -1680,20 +1595,17 @@ namespace ExtUI { } case DisplayBrightness: { - DEBUG_ECHOLNPGM("DisplayBrightness LCD: ", recdat.data[0]); if (recdat.data[0] < 10) Settings.screen_brightness = 10; else if (recdat.data[0] > 100) Settings.screen_brightness = 100; else Settings.screen_brightness = (uint8_t)recdat.data[0]; - DEBUG_ECHOLNPGM("DisplayBrightness Set: ", Settings.screen_brightness); SetTouchScreenConfiguration(); break; } case DisplayStandbyBrightness: { - DEBUG_ECHOLNPGM("DisplayStandbyBrightness"); if (recdat.data[0] < 10) Settings.standby_screen_brightness = 10; else if (recdat.data[0] > 100) @@ -1705,7 +1617,6 @@ namespace ExtUI { } case DisplayStandbySeconds: { - DEBUG_ECHOLNPGM("DisplayStandbySeconds"); if (recdat.data[0] < 5) Settings.standby_time_seconds = 5; else if (recdat.data[0] > 100) @@ -1722,22 +1633,16 @@ namespace ExtUI { xPnt = meshPoint - (yPnt * GRID_MAX_POINTS_X); if (yPnt % 2 != 0) xPnt = (GRID_MAX_POINTS_X - 1) - xPnt; // zag row - DEBUG_ECHOLNPGM("meshPoint ", meshPoint, " xPnt ", xPnt, " yPnt ", yPnt); - float meshVal = float(recdat.data[0] - (recdat.data[0] >= 32768 ? 65536 : 0)) / 1000; - DEBUG_ECHOLNPGM("meshVal ", meshVal); LIMIT(meshVal, Z_PROBE_LOW_POINT, Z_CLEARANCE_BETWEEN_PROBES); - DEBUG_ECHOLNPGM("Constrain meshVal ", meshVal); xy_uint8_t point = { xPnt, yPnt }; setMeshPoint(point, meshVal); rtscheck.RTS_SndData(meshVal * 1000, recdat.addr); break; } - default: - DEBUG_ECHOLNPGM("No Match :"); - break; + default: break; } memset(&recdat, 0, sizeof(recdat)); @@ -1770,7 +1675,7 @@ namespace ExtUI { LIMIT(Settings.screen_brightness, 10, 100); // Prevent a possible all-dark screen LIMIT(Settings.standby_time_seconds, 10, 655); // Prevent a possible all-dark screen for standby, yet also don't go higher than the DWIN limitation - unsigned char cfg_bits = 0x0 + uint8_t cfg_bits = 0x0 | _BV(7) // 7: Enable Control ... TERN0(DWINOS_4, _BV(7)) | _BV(5) // 5: load 22 touch file | _BV(4) // 4: auto-upload should always be enabled @@ -1782,12 +1687,12 @@ namespace ExtUI { #endif ; - const unsigned char config_set[] = { 0x5A, 0x00, TERN(DWINOS_4, 0x00, 0xFF), cfg_bits }; + const uint8_t config_set[] = { 0x5A, 0x00, TERN(DWINOS_4, 0x00, 0xFF), cfg_bits }; WriteVariable(0x80 /*System_Config*/, config_set, sizeof(config_set)); // Standby brightness (LED_Config) uint16_t dwinStandbyTimeSeconds = 100 * Settings.standby_time_seconds; /* milliseconds, but divided by 10 (not 5 like the docs say) */ - const unsigned char brightness_set[] = { + const uint8_t brightness_set[] = { Settings.screen_brightness /*% active*/, Settings.standby_screen_brightness /*% standby*/, static_cast(dwinStandbyTimeSeconds >> 8), @@ -1816,9 +1721,8 @@ namespace ExtUI { } void onPrinterKilled(FSTR_P const error, FSTR_P const component) { - DEBUG_ECHOLNPGM("***kill***"); rtscheck.RTS_SndData(ExchangePageBase + 88, ExchangepageAddr); - int j = 0; + int16_t j = 0; char outmsg[40]; char killMsg[strlen_P(FTOP(error)) + strlen_P(FTOP(component)) + 3]; sprintf_P(killMsg, PSTR(S_FMT ": " S_FMT), FTOP(error), FTOP(component)); @@ -1839,7 +1743,6 @@ namespace ExtUI { } void onMediaInserted() { - DEBUG_ECHOLNPGM("***Initing card is OK***"); filenavigator.reset(); filenavigator.getFiles(0); fileIndex = 0; @@ -1848,61 +1751,53 @@ namespace ExtUI { void onMediaError() { filenavigator.reset(); - for (int i = 0; i < MaxFileNumber; i++) - for (int j = 0; j < 10; j++) rtscheck.RTS_SndData(0, SDFILE_ADDR + i * 10 + j); + for (int16_t i = 0; i < MaxFileNumber; i++) + for (int16_t j = 0; j < 10; j++) rtscheck.RTS_SndData(0, SDFILE_ADDR + i * 10 + j); - for (int j = 0; j < 10; j++) { + for (int16_t j = 0; j < 10; j++) { rtscheck.RTS_SndData(0, Printfilename + j); // clean screen. rtscheck.RTS_SndData(0, Choosefilename + j); // clean filename } - for (int j = 0; j < 8; j++) rtscheck.RTS_SndData(0, FilenameCount + j); - for (int j = 1; j <= MaxFileNumber; j++) { + for (int16_t j = 0; j < 8; j++) rtscheck.RTS_SndData(0, FilenameCount + j); + for (int16_t j = 1; j <= MaxFileNumber; j++) { rtscheck.RTS_SndData(10, FilenameIcon + j); rtscheck.RTS_SndData(10, FilenameIcon1 + j); } - return; - DEBUG_ECHOLNPGM("***Initing card fails***"); } void onMediaRemoved() { filenavigator.reset(); - for (int i = 0; i < MaxFileNumber; i++) - for (int j = 0; j < 10; j++) rtscheck.RTS_SndData(0, SDFILE_ADDR + i * 10 + j); + for (int16_t i = 0; i < MaxFileNumber; i++) + for (int16_t j = 0; j < 10; j++) rtscheck.RTS_SndData(0, SDFILE_ADDR + i * 10 + j); - for (int j = 0; j < 10; j++) { + for (int16_t j = 0; j < 10; j++) { rtscheck.RTS_SndData(0, Printfilename + j); // clean screen. rtscheck.RTS_SndData(0, Choosefilename + j); // clean filename } - for (int j = 0; j < 8; j++) rtscheck.RTS_SndData(0, FilenameCount + j); - for (int j = 1; j <= MaxFileNumber; j++) { + for (int16_t j = 0; j < 8; j++) rtscheck.RTS_SndData(0, FilenameCount + j); + for (int16_t j = 1; j <= MaxFileNumber; j++) { rtscheck.RTS_SndData(10, FilenameIcon + j); rtscheck.RTS_SndData(10, FilenameIcon1 + j); } - return; - DEBUG_ECHOLNPGM("***Card Removed***"); } void onPlayTone(const uint16_t frequency, const uint16_t duration) { - DEBUG_ECHOLNPGM("***CPlay Tone***"); rtscheck.RTS_SndData(StartSoundSet, SoundAddr); } void onPrintTimerStarted() { - DEBUG_ECHOLNPGM("==onPrintTimerStarted=="); if (waitway == 7) return; PrinterStatusKey[1] = 3; - InforShowStatus = true; + InforShowStatus = true; delay_ms(1); rtscheck.RTS_SndData(ExchangePageBase + 53, ExchangepageAddr); } void onPrintTimerPaused() { - DEBUG_ECHOLNPGM("==onPrintTimerPaused=="); rtscheck.RTS_SndData(ExchangePageBase + 78, ExchangepageAddr); // Display Pause Screen onStatusChanged(F("Pausing...")); } void onPrintTimerStopped() { - DEBUG_ECHOLNPGM("==onPrintTimerStopped=="); if (waitway == 3) return; #if FAN_COUNT > 0 @@ -1910,26 +1805,24 @@ namespace ExtUI { #endif PrinterStatusKey[0] = 0; - InforShowStatus = true; - TPShowStatus = false; + InforShowStatus = true; + TPShowStatus = false; rtscheck.RTS_SndData(ExchangePageBase + 51, ExchangepageAddr); } void onFilamentRunout() { - DEBUG_ECHOLNPGM("==onFilamentRunout=="); PrinterStatusKey[1] = 4; - TPShowStatus = false; + TPShowStatus = false; rtscheck.RTS_SndData(ExchangePageBase + 78, ExchangepageAddr); } void onFilamentRunout(extruder_t extruder) { - DEBUG_ECHOLNPGM("==onFilamentRunout=="); PrinterStatusKey[1] = 4; - TPShowStatus = false; + TPShowStatus = false; rtscheck.RTS_SndData(ExchangePageBase + 78, ExchangepageAddr); } void onUserConfirmRequired(const char *const msg) { PrinterStatusKey[1] = 4; - TPShowStatus = false; + TPShowStatus = false; if (lastPauseMsgState == ExtUI::pauseModeStatus && msg == (const char*)GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)) return; @@ -2009,16 +1902,14 @@ namespace ExtUI { default: { setPauseMenuResponse(PAUSE_RESPONSE_RESUME_PRINT); setUserConfirmed(); - DEBUG_ECHOLNPGM("Pause Mode Status"); break; } } lastPauseMsgState = ExtUI::pauseModeStatus; - DEBUG_ECHOLNPGM("==onUserConfirmRequired==", pauseModeStatus); } void onStatusChanged(const char *const statMsg) { - for (int j = 0; j < 20; j++) // Clear old message + for (int16_t j = 0; j < 20; j++) // Clear old message rtscheck.RTS_SndData(' ', StatusMessageString + j); rtscheck.RTS_SndData(statMsg, StatusMessageString); } @@ -2035,7 +1926,6 @@ namespace ExtUI { onStartup(); startprogress = 0; InforShowStatus = true; - DEBUG_ECHOLNPGM("==onFactoryReset=="); } void onMeshUpdate(const int8_t xpos, const int8_t ypos, probe_state_t state) {} @@ -2049,7 +1939,7 @@ namespace ExtUI { for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { const bool zig = outer & 1; // != ((PR_OUTER_END) & 1); - const xy_uint8_t point = { zig ? (GRID_MAX_POINTS_X - 1) - inner : inner, outer }; + const xy_uint8_t point = { uint8_t(zig ? (GRID_MAX_POINTS_X - 1) - inner : inner), outer }; if (point.x == xpos && outer == ypos) rtscheck.RTS_SndData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + (abl_probe_index * 2)); ++abl_probe_index; @@ -2064,7 +1954,6 @@ namespace ExtUI { ); // Write to buffer - DEBUG_ECHOLNPGM("Saving DWIN LCD setting from EEPROM"); memcpy(buff, &Settings, sizeof(creality_dwin_settings_t)); } @@ -2079,48 +1968,34 @@ namespace ExtUI { // If size is not the same, discard settings if (eepromSettings.settings_size != sizeof(creality_dwin_settings_t)) { - DEBUG_ECHOLNPGM("Discarding DWIN LCD setting from EEPROM - size incorrect"); onFactoryReset(); return; } if (eepromSettings.settings_version != dwin_settings_version) { - DEBUG_ECHOLNPGM("Discarding DWIN LCD setting from EEPROM - settings version incorrect"); onFactoryReset(); return; } // Copy into final location - DEBUG_ECHOLNPGM("Loading DWIN LCD setting from EEPROM"); memcpy(&Settings, &eepromSettings, sizeof(creality_dwin_settings_t)); - DEBUG_ECHOLNPGM("Setting Brightness : ", Settings.screen_brightness); - DEBUG_ECHOLNPGM("Setting Standby : ", Settings.standby_screen_brightness); - DEBUG_ECHOLNPGM("Setting Standby Time : ", Settings.standby_time_seconds); - DEBUG_ECHOLNPGM("Setting Rotation : ", Settings.screen_rotation); - DEBUG_ECHOLNPGM("Setting Volume : ", Settings.display_volume); - - DEBUG_ECHOLNPGM("Setting Standby On : ", Settings.display_standby); - DEBUG_ECHOLNPGM("Setting Volume On : ", Settings.display_sound); - SetTouchScreenConfiguration(); } void onSettingsStored(bool success) { - DEBUG_ECHOLNPGM("==onSettingsStored=="); // This is called after the entire EEPROM has been written, // whether successful or not. } void onSettingsLoaded(bool success) { - DEBUG_ECHOLNPGM("==onConfigurationStoreRead=="); #if HAS_MESH if (ExtUI::getMeshValid()) { uint8_t abl_probe_index = 0; for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { const bool zig = outer & 1; - const xy_uint8_t point = { zig ? (GRID_MAX_POINTS_X - 1) - inner : inner, outer }; + const xy_uint8_t point = { uint8_t(zig ? (GRID_MAX_POINTS_X - 1) - inner : inner), outer }; rtscheck.RTS_SndData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + (abl_probe_index * 2)); ++abl_probe_index; } @@ -2134,14 +2009,12 @@ namespace ExtUI { } #endif - DEBUG_ECHOLNPGM("\n init zprobe_zoffset = ", getZOffset_mm()); rtscheck.RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z); SetTouchScreenConfiguration(); } #if ENABLED(POWER_LOSS_RECOVERY) void onPowerLossResume() { - DEBUG_ECHOLNPGM("==OnPowerLossResume=="); startprogress = 254; InforShowStatus = true; TPShowStatus = false; @@ -2155,13 +2028,13 @@ namespace ExtUI { // Called for temperature PID tuning result rtscheck.RTS_SndData(pid_hotendAutoTemp, HotendPID_AutoTmp); rtscheck.RTS_SndData(pid_bedAutoTemp, BedPID_AutoTmp); - rtscheck.RTS_SndData((unsigned int)(getPID_Kp(E0) * 10), HotendPID_P); - rtscheck.RTS_SndData((unsigned int)(getPID_Ki(E0) * 10), HotendPID_I); - rtscheck.RTS_SndData((unsigned int)(getPID_Kd(E0) * 10), HotendPID_D); + rtscheck.RTS_SndData(uint16_t(getPID_Kp(E0)) * 10, HotendPID_P); + rtscheck.RTS_SndData(uint16_t(getPID_Ki(E0)) * 10, HotendPID_I); + rtscheck.RTS_SndData(uint16_t(getPID_Kd(E0)) * 10, HotendPID_D); #if ENABLED(PIDTEMPBED) - rtscheck.RTS_SndData((unsigned int)(getBedPID_Kp() * 10), BedPID_P); - rtscheck.RTS_SndData((unsigned int)(getBedPID_Ki() * 10), BedPID_I); - rtscheck.RTS_SndData((unsigned int)(getBedPID_Kd() * 10), BedPID_D); + rtscheck.RTS_SndData(uint16_t(getBedPID_Kp()) * 10, BedPID_P); + rtscheck.RTS_SndData(uint16_t(getBedPID_Ki()) * 10, BedPID_I); + rtscheck.RTS_SndData(uint16_t(getBedPID_Kd()) * 10, BedPID_D); #endif onStatusChanged(F("PID Tune Finished")); } @@ -2176,7 +2049,7 @@ namespace ExtUI { for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { const bool zig = outer & 1; - const xy_uint8_t point = { zig ? (GRID_MAX_POINTS_X - 1) - inner : inner, outer }; + const xy_uint8_t point = { uint8_t(zig ? (GRID_MAX_POINTS_X - 1) - inner : inner), outer }; rtscheck.RTS_SndData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + abl_probe_index * 2); ++abl_probe_index; } diff --git a/Marlin/src/lcd/extui/ia_creality/creality_extui.h b/Marlin/src/lcd/extui/ia_creality/creality_extui.h index a051ea92c2c8..874a51b6f6b2 100644 --- a/Marlin/src/lcd/extui/ia_creality/creality_extui.h +++ b/Marlin/src/lcd/extui/ia_creality/creality_extui.h @@ -49,19 +49,21 @@ #define SizeofDatabuf 46 -/*************Register and Variable addr*****************/ +//#define FONT_EEPROM 90 +//#define AutoLeve_EEPROM 100 +//#define FanOn 255 +#define FanOff 0 + +#define ExchangePageBase 0x5A010000UL // the first page ID. other page = first page ID + relevant num; +#define StartSoundSet 0x060480A0UL // 06,start-music; 04, 4 musics; 80, the volume value; 04, return value about music number. + +// Register addresses #define RegAddr_W 0x80 #define RegAddr_R 0x81 #define VarAddr_W 0x82 #define VarAddr_R 0x83 -#define ExchangePageBase (unsigned long)0x5A010000 // the first page ID. other page = first page ID + relevant num; -#define StartSoundSet ((unsigned long)0x060480A0) // 06,start-music; 04, 4 musics; 80, the volume value; 04, return value about music number. -//#define FONT_EEPROM 90 -//#define AutoLeve_EEPROM 100 -//#define FanOn 255 -#define FanOff 0 -/*variable addr*/ +// Variable addresses #define ExchangepageAddr 0x0084 #define SoundAddr 0x00A0 #define StartIcon 0x1000 @@ -142,7 +144,7 @@ #define DisplayZaxis 0x104C #define FilamentUnit1 0x1054 -#define Exchfilement 0x1056 +#define Exchfilament 0x1056 #define FilamentUnit2 0x1058 #define MacVersion 0x1060 @@ -193,13 +195,13 @@ namespace ExtUI { } rx_datagram_state_t; typedef struct DataBuf { - unsigned char len; - unsigned char head[2]; - unsigned char command; - unsigned long addr; - unsigned long bytelen; - unsigned short data[32]; - unsigned char reserv[4]; + uint8_t len; + uint8_t head[2]; + uint8_t command; + uint32_t addr; + uint32_t bytelen; + uint16_t data[32]; + uint8_t reserv[4]; } DB; struct creality_dwin_settings_t { @@ -220,27 +222,27 @@ namespace ExtUI { class RTSSHOW { public: RTSSHOW(); - int RTS_RecData(); + int16_t RTS_RecData(); void RTS_SDCardInit(void); void RTS_SDCardUpate(bool, bool); - int RTS_CheckFilament(int); + int16_t RTS_CheckFilament(int16_t); void RTS_SndData(void); - void RTS_SndData(const String &, unsigned long, unsigned char = VarAddr_W); - void RTS_SndData(const char[], unsigned long, unsigned char = VarAddr_W); - void RTS_SndData(char, unsigned long, unsigned char = VarAddr_W); - void RTS_SndData(unsigned char*, unsigned long, unsigned char = VarAddr_W); - void RTS_SndData(int, unsigned long, unsigned char = VarAddr_W); - void RTS_SndData(float, unsigned long, unsigned char = VarAddr_W); - void RTS_SndData(unsigned int,unsigned long, unsigned char = VarAddr_W); - void RTS_SndData(long,unsigned long, unsigned char = VarAddr_W); - void RTS_SndData(unsigned long,unsigned long, unsigned char = VarAddr_W); + void RTS_SndData(const String &, uint32_t, uint8_t=VarAddr_W); + void RTS_SndData(const char[], uint32_t, uint8_t=VarAddr_W); + void RTS_SndData(char, uint32_t, uint8_t=VarAddr_W); + void RTS_SndData(uint8_t*, uint32_t, uint8_t=VarAddr_W); + void RTS_SndData(int16_t, uint32_t, uint8_t=VarAddr_W); + void RTS_SndData(float, uint32_t, uint8_t=VarAddr_W); + void RTS_SndData(uint16_t, uint32_t, uint8_t=VarAddr_W); + void RTS_SndData(int32_t, uint32_t, uint8_t=VarAddr_W); + void RTS_SndData(uint32_t, uint32_t, uint8_t=VarAddr_W); void RTS_SDcard_Stop(); void RTS_HandleData(); void RTS_Init(); DB recdat; DB snddat; - unsigned char databuf[SizeofDatabuf]; + uint8_t databuf[SizeofDatabuf]; static rx_datagram_state_t rx_datagram_state; static uint8_t rx_datagram_len; @@ -250,13 +252,13 @@ namespace ExtUI { static RTSSHOW rtscheck; #define Addvalue 3 - #define PrintChoice_Value (0+Addvalue) - #define Zoffset_Value (3+Addvalue) - #define Setting_Value (8+Addvalue) - #define XYZEaxis_Value (12+Addvalue) - #define Filament_Value (15+Addvalue) - #define Language_Value (18+Addvalue) - #define Filename_Value (22+Addvalue) + #define PrintChoice_Value (0 + Addvalue) + #define Zoffset_Value (3 + Addvalue) + #define Setting_Value (8 + Addvalue) + #define XYZEaxis_Value (12 + Addvalue) + #define Filament_Value (15 + Addvalue) + #define Language_Value (18 + Addvalue) + #define Filename_Value (22 + Addvalue) enum PROC_COM { Printfile = 0, @@ -279,7 +281,7 @@ namespace ExtUI { Filename = Filename_Value }; - const unsigned long Addrbuf[] = { + const uint32_t Addrbuf[] = { 0x1002, 0x1004, 0x1006, 0x1008, 0x100A, 0x100C, 0x1026, 0x1030, 0x1032, 0x1034, 0x103A, 0x103E, 0x1040, 0x1044, 0x1046, 0x1048, 0x104A, 0x104C, 0x1054, 0x1056, 0x1058, 0x105C, 0x105E, 0x105F, 0x1088, 0 diff --git a/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h b/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h index ad1523893243..a289a80dc773 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h +++ b/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h @@ -38,7 +38,7 @@ extern TIPS_TYPE wifi_tips_type; typedef struct { unsigned char timer; - unsigned int timer_count; + uint16_t timer_count; } TIPS_DISP; extern TIPS_DISP tips_disp; diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp index b31977e7ca4c..a5a8f7cbe41f 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp @@ -300,7 +300,7 @@ void lv_fill_rect(lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2, lv #define TICK_CYCLE 1 -unsigned int getTickDiff(unsigned int curTick, unsigned int lastTick) { +uint16_t getTickDiff(uint16_t curTick, uint16_t lastTick) { return TICK_CYCLE * (lastTick <= curTick ? (curTick - lastTick) : (0xFFFFFFFF - lastTick + curTick)); } diff --git a/Marlin/src/lcd/extui/mks_ui/wifiSerial_STM32.cpp b/Marlin/src/lcd/extui/mks_ui/wifiSerial_STM32.cpp index 0e55b3448ba1..cac3d2a17d59 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifiSerial_STM32.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifiSerial_STM32.cpp @@ -230,7 +230,7 @@ void WifiSerial::_rx_complete_irq(serial_t *obj) { WRITE(WIFI_IO1_PIN, HIGH); - rx_buffer_index_t i = (unsigned int)(obj->rx_head + 1) % WIFI_RX_BUF_SIZE; + rx_buffer_index_t i = uint16_t(obj->rx_head + 1) % WIFI_RX_BUF_SIZE; // if we should be storing the received character into the location // just before the tail (meaning that the head would advance to the @@ -292,7 +292,7 @@ void WifiSerial::begin(unsigned long baud, byte config) { case 0: Error_Handler(); break; } - uart_init(&_serial, (uint32_t)baud, databits, parity, stopbits); + uart_init(&_serial, uint32_t(baud), databits, parity, stopbits); enableHalfDuplexRx(); if (baud == WIFI_BAUDRATE) uart_attach_rx_callback(&_serial, _rx_complete_irq); @@ -311,7 +311,7 @@ void WifiSerial::end() { } int WifiSerial::available() { - return ((unsigned int)(WIFI_RX_BUF_SIZE + _serial.rx_head - _serial.rx_tail)) % WIFI_RX_BUF_SIZE; + return uint16_t(WIFI_RX_BUF_SIZE + _serial.rx_head - _serial.rx_tail) % WIFI_RX_BUF_SIZE; } // diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp index a8d30b442a9b..215281d450a4 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp @@ -59,7 +59,7 @@ extern uint8_t Explore_Disk(char *path, uint8_t recu_level); extern uint8_t commands_in_queue; extern uint8_t sel_id; -extern unsigned int getTickDiff(unsigned int curTick, unsigned int lastTick); +extern uint16_t getTickDiff(uint16_t curTick, uint16_t lastTick); volatile SZ_USART_FIFO WifiRxFifo; diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp index 18a311303ccf..44869d477098 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp @@ -79,9 +79,9 @@ const uint32_t ESP_FLASH_ADDR = 0x40200000; // address of start of Flash UPLOAD_STRUCT esp_upload; -static const unsigned int retriesPerReset = 3; +static const uint16_t retriesPerReset = 3; static const uint32_t connectAttemptInterval = 50; -static const unsigned int percentToReportIncrement = 5; // how often we report % complete +static const uint16_t percentToReportIncrement = 5; // how often we report % complete static const uint32_t defaultTimeout = 500; static const uint32_t eraseTimeout = 15000; static const uint32_t blockWriteTimeout = 200; @@ -151,7 +151,7 @@ void flushInput() { uint32_t getData(unsigned byteCnt, const uint8_t *buf, int ofst) { uint32_t val = 0; if (buf && byteCnt) { - unsigned int shiftCnt = 0; + uint16_t shiftCnt = 0; NOMORE(byteCnt, 4U); do { val |= (uint32_t)buf[ofst++] << shiftCnt; @@ -348,7 +348,7 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t // Send a block of data performing SLIP encoding of the content. void _writePacket(const uint8_t *data, size_t len) { unsigned char outBuf[2048] = {0}; - unsigned int outIndex = 0; + uint16_t outIndex = 0; while (len != 0) { if (*data == 0xC0) { outBuf[outIndex++] = 0xDB; @@ -597,7 +597,7 @@ void upload_spin() { case uploading: // The ESP needs several milliseconds to recover from one packet before it will accept another if (getWifiTickDiff(esp_upload.lastAttemptTime, getWifiTick()) >= 15) { - unsigned int percentComplete; + uint16_t percentComplete; const uint32_t blkCnt = (esp_upload.fileSize + EspFlashBlockSize - 1) / EspFlashBlockSize; if (esp_upload.uploadBlockNumber < blkCnt) { esp_upload.uploadResult = flashWriteBlock(0, 0); diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 1d4801278ce2..a7da7c6e9681 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -93,7 +93,7 @@ namespace Language_an { LSTR MSG_MOVE_50MM = _UxGT("Mover 50mm"); LSTR MSG_MOVE_100MM = _UxGT("Mover 100mm"); LSTR MSG_SPEED = _UxGT("Velocidat"); - LSTR MSG_BED_Z = _UxGT("Base Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Base Z"); LSTR MSG_NOZZLE = _UxGT("Boquilla"); LSTR MSG_NOZZLE_N = _UxGT("Boquilla ~"); LSTR MSG_BED = _UxGT("Base"); diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index 312ada7b10cd..87199ffbc98d 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -82,7 +82,7 @@ namespace Language_bg { LSTR MSG_MOVE_50MM = _UxGT("Премести с 50mm"); LSTR MSG_MOVE_100MM = _UxGT("Премести с 100mm"); LSTR MSG_SPEED = _UxGT("Скорост"); - LSTR MSG_BED_Z = _UxGT("Bed Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Bed Z"); LSTR MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" Дюза"); LSTR MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" Дюза ~"); LSTR MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" Легло"); diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 13b5d70837ad..fec9c447419a 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -93,7 +93,7 @@ namespace Language_ca { LSTR MSG_MOVE_50MM = _UxGT("Mou 50mm"); LSTR MSG_MOVE_100MM = _UxGT("Mou 100mm"); LSTR MSG_SPEED = _UxGT("Velocitat"); - LSTR MSG_BED_Z = _UxGT("Llit Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Llit Z"); LSTR MSG_NOZZLE = _UxGT("Nozzle"); LSTR MSG_NOZZLE_N = _UxGT("Nozzle ~"); LSTR MSG_BED = _UxGT("Llit"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index bb930eb7846c..f0da14106945 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -243,7 +243,7 @@ namespace Language_cz { LSTR MSG_MOVE_50MM = _UxGT("Posunout o 50mm"); LSTR MSG_MOVE_100MM = _UxGT("Posunout o 100mm"); LSTR MSG_SPEED = _UxGT("Rychlost"); - LSTR MSG_BED_Z = _UxGT("Výška podl."); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Výška podl."); LSTR MSG_NOZZLE = _UxGT("Tryska"); LSTR MSG_NOZZLE_N = _UxGT("Tryska ~"); LSTR MSG_BED = _UxGT("Podložka"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 56c53b84fd51..ec1a76978360 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -84,7 +84,7 @@ namespace Language_da { LSTR MSG_MOVE_50MM = _UxGT("Flyt 50mm"); LSTR MSG_MOVE_100MM = _UxGT("Flyt 100mm"); LSTR MSG_SPEED = _UxGT("Hastighed"); - LSTR MSG_BED_Z = _UxGT("Plade Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Plade Z"); LSTR MSG_NOZZLE = _UxGT("Dyse"); LSTR MSG_NOZZLE_N = _UxGT("Dyse ~"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 1cbddf860e25..32da975e04ac 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -308,7 +308,7 @@ namespace Language_de { LSTR MSG_MOVE_01IN = _UxGT("0.100 in"); LSTR MSG_MOVE_1IN = _UxGT("1.000 in"); LSTR MSG_SPEED = _UxGT("Geschw."); - LSTR MSG_BED_Z = _UxGT("Bett Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Bett Z"); LSTR MSG_NOZZLE = _UxGT("Düse"); LSTR MSG_NOZZLE_N = _UxGT("Düse ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Düse geparkt"); diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 57af804147c5..a411f3315520 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -102,7 +102,7 @@ namespace Language_el { LSTR MSG_MOVE_50MM = _UxGT("Μετακίνηση 50 μμ"); LSTR MSG_MOVE_100MM = _UxGT("Μετακίνηση 100 μμ"); LSTR MSG_SPEED = _UxGT("Ταχύτητα"); - LSTR MSG_BED_Z = _UxGT("Επ. Εκτύπωσης Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Επ. Εκτύπωσης Z"); LSTR MSG_NOZZLE = _UxGT("Ακροφύσιο"); LSTR MSG_NOZZLE_N = _UxGT("Ακροφύσιο ~"); LSTR MSG_BED = _UxGT("Επ. Εκτύπωσης"); diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index 08f647f705bb..463d6d4c7bd9 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -91,7 +91,7 @@ namespace Language_el_gr { LSTR MSG_MOVE_50MM = _UxGT("Μετακίνηση 50 μμ"); LSTR MSG_MOVE_100MM = _UxGT("Μετακίνηση 100 μμ"); LSTR MSG_SPEED = _UxGT("Ταχύτητα"); - LSTR MSG_BED_Z = _UxGT("Κλίνη Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Κλίνη Z"); LSTR MSG_NOZZLE = _UxGT("Ακροφύσιο"); LSTR MSG_NOZZLE_N = _UxGT("Ακροφύσιο ~"); LSTR MSG_BED = _UxGT("Κλίνη"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 5adc5275fc6e..0a695bfe0633 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -329,7 +329,7 @@ namespace Language_en { LSTR MSG_MOVE_1IN = _UxGT("Move 1.0in"); LSTR MSG_LIVE_MOVE = _UxGT("Live Move"); LSTR MSG_SPEED = _UxGT("Speed"); - LSTR MSG_BED_Z = _UxGT("Bed Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Bed Z"); LSTR MSG_NOZZLE = _UxGT("Nozzle"); LSTR MSG_NOZZLE_N = _UxGT("Nozzle ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Nozzle Parked"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index d95275c317ac..13d9a9b6550b 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -237,7 +237,7 @@ namespace Language_es { LSTR MSG_MOVE_50MM = _UxGT("Mover 50mm"); LSTR MSG_MOVE_100MM = _UxGT("Mover 100mm"); LSTR MSG_SPEED = _UxGT("Velocidad"); - LSTR MSG_BED_Z = _UxGT("Cama Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Cama Z"); LSTR MSG_NOZZLE = _UxGT("Boquilla"); LSTR MSG_NOZZLE_N = _UxGT("Boquilla ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Boquilla Aparcada"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 0c29cdd2aaba..f000b5fcfb10 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -146,7 +146,7 @@ namespace Language_eu { LSTR MSG_MOVE_50MM = _UxGT("Mugitu 50mm"); LSTR MSG_MOVE_100MM = _UxGT("Mugitu 100mm"); LSTR MSG_SPEED = _UxGT("Abiadura"); - LSTR MSG_BED_Z = _UxGT("Z Ohea"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Z Ohea"); LSTR MSG_NOZZLE = _UxGT("Pita"); LSTR MSG_NOZZLE_N = _UxGT("Pita ~"); LSTR MSG_BED = _UxGT("Ohea"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index fdb556abe86a..e274de8db63c 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -246,7 +246,7 @@ namespace Language_fr { LSTR MSG_MOVE_05IN = _UxGT("Déplacer 0.5\""); LSTR MSG_MOVE_1IN = _UxGT("Déplacer 1\""); LSTR MSG_SPEED = _UxGT("Vitesse"); - LSTR MSG_BED_Z = _UxGT("Lit Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Lit Z"); LSTR MSG_NOZZLE = _UxGT("Buse"); LSTR MSG_NOZZLE_N = _UxGT("Buse ~"); LSTR MSG_BED = _UxGT("Lit"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 28917bad35bf..7d6b28583428 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -234,7 +234,7 @@ namespace Language_gl { LSTR MSG_MOVE_50MM = _UxGT("Mover 50mm"); LSTR MSG_MOVE_100MM = _UxGT("Mover 100mm"); LSTR MSG_SPEED = _UxGT("Velocidade"); - LSTR MSG_BED_Z = _UxGT("Cama Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Cama Z"); LSTR MSG_NOZZLE = _UxGT("Bico"); LSTR MSG_NOZZLE_N = _UxGT("Bico ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Bico Estacionado"); diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 36eaf78acb1a..697341fc44c0 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -89,7 +89,7 @@ namespace Language_hr { LSTR MSG_MOVE_50MM = _UxGT("Miči 50mm"); LSTR MSG_MOVE_100MM = _UxGT("Miči 100mm"); LSTR MSG_SPEED = _UxGT("Brzina"); - LSTR MSG_BED_Z = _UxGT("Bed Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Bed Z"); LSTR MSG_NOZZLE = _UxGT("Dizna"); LSTR MSG_NOZZLE_N = _UxGT("Dizna ~"); LSTR MSG_BED = _UxGT("Bed"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 61c7d9f9c4e4..e17de38747c7 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -272,7 +272,7 @@ namespace Language_hu { LSTR MSG_MOVE_05IN = _UxGT("Mozgás 12.7mm"); LSTR MSG_MOVE_1IN = _UxGT("Mozgáá 25.4mm"); LSTR MSG_SPEED = _UxGT("Sebesség"); - LSTR MSG_BED_Z = _UxGT("Z ágy"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Z ágy"); LSTR MSG_NOZZLE = _UxGT("Fej"); LSTR MSG_NOZZLE_N = _UxGT("Fej ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Fej parkolva"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index ee8d51203c09..0caf950aa583 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -326,7 +326,7 @@ namespace Language_it { LSTR MSG_MOVE_1IN = _UxGT("Muovi di 1\""); LSTR MSG_LIVE_MOVE = _UxGT("Modalità Live"); LSTR MSG_SPEED = _UxGT("Velocità"); - LSTR MSG_BED_Z = _UxGT("Piatto Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Piatto Z"); LSTR MSG_NOZZLE = _UxGT("Ugello"); LSTR MSG_NOZZLE_N = _UxGT("Ugello ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Ugello parcheggiato"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index 335d4533daa6..8ed1a7865e2c 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -102,7 +102,7 @@ namespace Language_jp_kana { LSTR MSG_MOVE_50MM = _UxGT(" 50mm イドウ"); // "Move 50mm" LSTR MSG_MOVE_100MM = _UxGT(" 100mm イドウ"); // "Move 100mm" LSTR MSG_SPEED = _UxGT("ソクド"); // "Speed" - LSTR MSG_BED_Z = _UxGT("Zオフセット"); // "Bed Z" + LSTR MSG_MESH_Z_OFFSET = _UxGT("Zオフセット"); // "Bed Z" LSTR MSG_NOZZLE = _UxGT("ノズル"); // "Nozzle" LSTR MSG_BED = _UxGT("ベッド"); // "Bed" LSTR MSG_FAN_SPEED = _UxGT("ファンソクド"); // "Fan speed" diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 9ad16bcd8c14..6397a95a7e16 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -93,7 +93,7 @@ namespace Language_nl { LSTR MSG_MOVE_10MM = _UxGT("Verplaats 10mm"); LSTR MSG_MOVE_100MM = _UxGT("Verplaats 100mm"); LSTR MSG_SPEED = _UxGT("Snelheid"); - LSTR MSG_BED_Z = _UxGT("Bed Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Bed Z"); LSTR MSG_NOZZLE = _UxGT("Nozzle"); LSTR MSG_NOZZLE_N = _UxGT("Nozzle ~"); LSTR MSG_BED = _UxGT("Bed"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index b39c084ec89a..15d6a29053e6 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -248,7 +248,7 @@ namespace Language_pl { LSTR MSG_MOVE_001IN = _UxGT("Przesuń co 0.01 cala"); LSTR MSG_MOVE_01IN = _UxGT("Przesuń co 0.1 cala"); LSTR MSG_SPEED = _UxGT("Predkość"); - LSTR MSG_BED_Z = _UxGT("Stół Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Stół Z"); LSTR MSG_NOZZLE = _UxGT("Dysza"); LSTR MSG_NOZZLE_N = _UxGT("Dysza ~"); LSTR MSG_NOZZLE_STANDBY = _UxGT("Dysza w oczekiwaniu"); diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 55d9c1d7c572..4d9a8ae6da9c 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -87,7 +87,7 @@ namespace Language_pt { LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); LSTR MSG_MOVE_100MM = _UxGT("Mover 100mm"); LSTR MSG_SPEED = _UxGT("Velocidade"); - LSTR MSG_BED_Z = _UxGT("Base Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Base Z"); LSTR MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" Bico"); LSTR MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" Bico ~"); LSTR MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" Base"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index d52728d10726..1bd3f6168206 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -219,7 +219,7 @@ namespace Language_pt_br { LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); LSTR MSG_MOVE_100MM = _UxGT("Mover 100mm"); LSTR MSG_SPEED = _UxGT("Velocidade"); - LSTR MSG_BED_Z = _UxGT("Base Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Base Z"); LSTR MSG_NOZZLE = _UxGT("Bocal"); LSTR MSG_NOZZLE_N = _UxGT("Bocal ~"); LSTR MSG_BED = _UxGT("Mesa"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index c5fdcc786f68..162f3a361619 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -232,7 +232,7 @@ namespace Language_ro { LSTR MSG_MOVE_10MM = _UxGT("Move 10mm"); LSTR MSG_MOVE_100MM = _UxGT("Move 100mm"); LSTR MSG_SPEED = _UxGT("Speed"); - LSTR MSG_BED_Z = _UxGT("Bed Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Bed Z"); LSTR MSG_NOZZLE = _UxGT("Nozzle"); LSTR MSG_NOZZLE_N = _UxGT("Nozzle ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Nozzle Parked"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index b9cb0c5ebf94..75579972a2ee 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -342,7 +342,7 @@ namespace Language_ru { LSTR MSG_MOVE_10MM = _UxGT("Движение 10мм"); LSTR MSG_MOVE_100MM = _UxGT("Движение 100mm"); LSTR MSG_SPEED = _UxGT("Скорость"); - LSTR MSG_BED_Z = _UxGT("Z стола"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Z стола"); LSTR MSG_NOZZLE = _UxGT("Сопло, ") LCD_STR_DEGREE _UxGT("C"); LSTR MSG_NOZZLE_N = _UxGT("Сопло ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Сопло запарковано"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 4167fc802ab9..0e00ce4b1238 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -327,7 +327,7 @@ namespace Language_sk { LSTR MSG_MOVE_1IN = _UxGT("Posunúť o 1,0in"); LSTR MSG_LIVE_MOVE = _UxGT("Živý pohyb"); LSTR MSG_SPEED = _UxGT("Rýchlosť"); - LSTR MSG_BED_Z = _UxGT("Výška podl."); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Výška podl."); LSTR MSG_NOZZLE = _UxGT("Tryska"); LSTR MSG_NOZZLE_N = _UxGT("Tryska ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Tryska zaparkovaná"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index e550e877a1b3..c7e6c19bd702 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -262,7 +262,7 @@ namespace Language_sv { LSTR MSG_MOVE_001IN = _UxGT("Flytta 0.01tum"); LSTR MSG_MOVE_01IN = _UxGT("Flytta 0.1tum"); LSTR MSG_SPEED = _UxGT("Hastighet"); - LSTR MSG_BED_Z = _UxGT("Bädd Z"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Bädd Z"); LSTR MSG_NOZZLE = _UxGT("Munstycke"); LSTR MSG_NOZZLE_N = _UxGT("Munstycke ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Munstycke Parkerad"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 5ff8ab7b4882..cb3c6a03ae5c 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -235,7 +235,7 @@ namespace Language_tr { LSTR MSG_MOVE_10MM = _UxGT("10mm"); LSTR MSG_MOVE_100MM = _UxGT("100mm"); LSTR MSG_SPEED = _UxGT("Hız"); - LSTR MSG_BED_Z = _UxGT("Z Mesafesi"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Z Mesafesi"); LSTR MSG_NOZZLE = _UxGT("Nozul"); LSTR MSG_NOZZLE_N = _UxGT("Nozul ~"); LSTR MSG_BED = _UxGT("Tabla"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index f4e7741f9333..dc032655247c 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -343,7 +343,7 @@ namespace Language_uk { LSTR MSG_MOVE_10MM = _UxGT("Рух 10мм"); LSTR MSG_MOVE_100MM = _UxGT("Рух 100mm"); LSTR MSG_SPEED = _UxGT("Швидкість"); - LSTR MSG_BED_Z = _UxGT("Z Столу"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Z Столу"); LSTR MSG_NOZZLE = _UxGT("Сопло, ") LCD_STR_DEGREE _UxGT("C"); LSTR MSG_NOZZLE_N = _UxGT("Сопло ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Сопло запарковане"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index 575191f50b28..c01b2f44faa1 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -207,7 +207,7 @@ namespace Language_vi { LSTR MSG_MOVE_10MM = _UxGT("Di chuyển 10mm"); // Move 10mm LSTR MSG_MOVE_100MM = _UxGT("Di chuyển 100mm"); // Move 100mm LSTR MSG_SPEED = _UxGT("Tốc độ"); // Speed - LSTR MSG_BED_Z = _UxGT("Z Bàn"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Z Bàn"); LSTR MSG_NOZZLE = _UxGT("Đầu phun"); // Nozzle LSTR MSG_NOZZLE_N = _UxGT("Đầu phun ~"); LSTR MSG_BED = _UxGT("Bàn"); // bed diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 6e2864ce6f78..4dccbc4f0950 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -232,7 +232,7 @@ namespace Language_zh_CN { LSTR MSG_MOVE_10MM = _UxGT("移动 10 mm"); // "Move 10mm" LSTR MSG_MOVE_100MM = _UxGT("移动 100 mm"); // "Move 100mm" LSTR MSG_SPEED = _UxGT("速率"); // "Speed" - LSTR MSG_BED_Z = _UxGT("热床Z"); // "Bed Z" + LSTR MSG_MESH_Z_OFFSET = _UxGT("热床Z"); // "Bed Z" LSTR MSG_NOZZLE = _UxGT("喷嘴"); // "Nozzle" 噴嘴 LSTR MSG_NOZZLE_N = _UxGT("喷嘴 ~"); // "Nozzle" 噴嘴 LSTR MSG_NOZZLE_PARKED = _UxGT("喷嘴已停靠"); diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 79d4ba75a7ba..4ba94f3014ec 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -229,7 +229,7 @@ namespace Language_zh_TW { LSTR MSG_MOVE_50MM = _UxGT("移動 50 mm"); // "Move 50mm" LSTR MSG_MOVE_100MM = _UxGT("移動 100 mm"); // "Move 100mm" LSTR MSG_SPEED = _UxGT("速率"); // "Speed" - LSTR MSG_BED_Z = _UxGT("熱床Z"); // "Bed Z" + LSTR MSG_MESH_Z_OFFSET = _UxGT("熱床Z"); // "Bed Z" LSTR MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" 噴嘴"); // "Nozzle" 噴嘴 LSTR MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" 噴嘴 ~"); LSTR MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" 熱床"); // "Bed" diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 5d264198a3f6..d10ae7c5cc91 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1831,7 +1831,7 @@ void MarlinUI::init() { #endif } - #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) + #if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) void MarlinUI::zoffset_overlay(const_float_t zvalue) { // Determine whether the user is raising or lowering the nozzle. static int8_t dir; diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 827a71a29dc3..fa18878c1ba8 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -506,7 +506,7 @@ class MarlinUI { static bool old_is_printing; #endif - #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) + #if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) static void zoffset_overlay(const int8_t dir); static void zoffset_overlay(const_float_t zvalue); #endif diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 6389383d287a..7f55f79f0372 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -321,7 +321,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { if (ui.should_draw()) { if (do_probe) { MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z)); - TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, ui.zoffset_overlay(probe.offset.z)); + TERN_(BABYSTEP_GFX_OVERLAY, ui.zoffset_overlay(probe.offset.z)); } else { #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 9505a82dd77c..d25d35011e8f 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -283,7 +283,7 @@ void menu_bed_leveling() { #else #define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99 #endif - EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_BED_Z, &bedlevel.z_offset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_MESH_Z_OFFSET, &bedlevel.z_offset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif #if ENABLED(BABYSTEP_ZPROBE_OFFSET) diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index 423af4e5a1eb..8c4b2b1cfcd3 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -120,7 +120,7 @@ void menu_tune() { // Manual bed leveling, Bed Z: // #if BOTH(MESH_BED_LEVELING, LCD_BED_LEVELING) - EDIT_ITEM(float43, MSG_BED_Z, &bedlevel.z_offset, -1, 1); + EDIT_ITEM(float43, MSG_MESH_Z_OFFSET, &bedlevel.z_offset, -1, 1); #endif // diff --git a/buildroot/tests/FYSETC_F6 b/buildroot/tests/FYSETC_F6 index 24fe550157ad..5129ff9807d6 100755 --- a/buildroot/tests/FYSETC_F6 +++ b/buildroot/tests/FYSETC_F6 @@ -11,7 +11,7 @@ set -e # restore_configs opt_set MOTHERBOARD BOARD_FYSETC_F6_13 LCD_SERIAL_PORT 1 DGUS_LCD_UI FYSETC -exec_test $1 $2 "FYSETC F6 1.3 with DGUS" "$3" +exec_test $1 $2 "FYSETC F6 1.3 with DGUS (FYSETC)" "$3" # # Delta Config (generic) + UBL + ALLEN_KEY + EEPROM_SETTINGS + OLED_PANEL_TINYBOY2 diff --git a/buildroot/tests/LPC1768 b/buildroot/tests/LPC1768 index 2e680b60d797..37cc705c0cb9 100755 --- a/buildroot/tests/LPC1768 +++ b/buildroot/tests/LPC1768 @@ -44,7 +44,7 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER ADAPTIVE_FAN_SLOWING TE FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING SOUND_MENU_ITEM \ NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR PREHEAT_BEFORE_LEVELING G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ ASSISTED_TRAMMING ASSISTED_TRAMMING_WIZARD REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \ - BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ + BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ HOST_KEEPALIVE_FEATURE HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT \ diff --git a/buildroot/tests/SAMD21_minitronics20 b/buildroot/tests/SAMD21_minitronics20 index 420495bb7659..b46fb9f08ab3 100755 --- a/buildroot/tests/SAMD21_minitronics20 +++ b/buildroot/tests/SAMD21_minitronics20 @@ -24,7 +24,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE BLTOUCH Z_MIN_PROBE_REPEATABILITY_TEST \ STATUS_MESSAGE_SCROLLING SET_PROGRESS_MANUALLY SHOW_REMAINING_TIME SET_REMAINING_TIME \ LONG_FILENAME_HOST_SUPPORT CUSTOM_FIRMWARE_UPLOAD M20_TIMESTAMP_SUPPORT \ SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \ - MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ + MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \ LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \ SQUARE_WAVE_STEPPING exec_test $1 $2 "Minitronics 2.0 with assorted features" "$3" diff --git a/buildroot/tests/SAMD51_grandcentral_m4 b/buildroot/tests/SAMD51_grandcentral_m4 index ef67e061fe4b..042733072ddc 100755 --- a/buildroot/tests/SAMD51_grandcentral_m4 +++ b/buildroot/tests/SAMD51_grandcentral_m4 @@ -24,7 +24,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_R STATUS_MESSAGE_SCROLLING SET_PROGRESS_MANUALLY SHOW_REMAINING_TIME SET_REMAINING_TIME \ LONG_FILENAME_HOST_SUPPORT CUSTOM_FIRMWARE_UPLOAD M20_TIMESTAMP_SUPPORT \ SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \ - MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ + MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \ LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \ SQUARE_WAVE_STEPPING TMC_DEBUG exec_test $1 $2 "Grand Central M4 with assorted features" "$3" diff --git a/buildroot/tests/teensy35 b/buildroot/tests/teensy35 index bcb8e944a1ed..ec12082909f9 100755 --- a/buildroot/tests/teensy35 +++ b/buildroot/tests/teensy35 @@ -24,7 +24,7 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT SDCARD_SORT_A LCD_INFO_MENU LCD_PRINTER_INFO_IS_BOOTSCREEN LARGE_MOVE_ITEMS TURBO_BACK_MENU_ITEM PREHEAT_SHORTCUT_MENU_ITEM \ FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY CALIBRATION_GCODE BAUD_RATE_GCODE SOUND_MENU_ITEM \ FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ - BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ + BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER \ ADVANCED_PAUSE_FEATURE ARC_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES PARK_HEAD_ON_PAUSE \ PHOTO_GCODE PHOTO_POSITION PHOTO_SWITCH_POSITION PHOTO_SWITCH_MS PHOTO_DELAY_MS PHOTO_RETRACT_MM \