From 4fa8ace967d5779ccc628667754fa627e8f2e777 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 17 May 2022 13:42:05 -0500 Subject: [PATCH] Post-merge cleanup --- .github/workflows/test-builds.yml | 2 +- Marlin/src/gcode/probe/G30.cpp | 11 ++-- Marlin/src/lcd/e3v2/creality/dwin.cpp | 10 +-- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 65 +++++++++---------- .../boards/marlin_Artillery_Ruby.json | 2 +- docker/Dockerfile | 2 +- ini/stm32f4.ini | 20 +++--- 8 files changed, 53 insertions(+), 61 deletions(-) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 3887ed271aaa7..e339f856462e8 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -138,7 +138,7 @@ jobs: - name: Install PlatformIO run: | - pip install -U platformio + pip install -U https://github.com/platformio/platformio-core/archive/v5.2.5.zip platformio update - name: Run ${{ matrix.test-platform }} Tests diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index 68146e2c6beec..4e51614d4d194 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -54,9 +54,8 @@ void GcodeSuite::G30() { if (!probe.can_reach(pos)) { #if ENABLED(DWIN_LCD_PROUI) - FSTR_P const msg = F("Outside of Probing Area"); - SERIAL_ECHOLNF(msg); - ui.set_status(msg); + SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT)); + LCD_MESSAGE(MSG_ZPROBE_OUT); #endif return; } @@ -76,13 +75,13 @@ void GcodeSuite::G30() { if (!isnan(measured_z)) { SERIAL_ECHOLNPGM("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z); #if ENABLED(DWIN_LCD_PROUI) - char cmd[31], str_1[6], str_2[6], str_3[6]; - sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"), + char msg[31], str_1[6], str_2[6], str_3[6]; + sprintf_P(msg, PSTR("X:%s, Y:%s, Z:%s"), dtostrf(pos.x, 1, 1, str_1), dtostrf(pos.y, 1, 1, str_2), dtostrf(measured_z, 1, 2, str_3) ); - ui.set_status(cmd); + ui.set_status(msg); #endif } diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index 65da4cb42157e..b2cb1bee30ce5 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -2728,7 +2728,7 @@ void HMI_Prepare() { EncoderRate.enabled = true; #else // Apply workspace offset, making the current position 0,0,0 - queue.inject(F("G92 X0 Y0 Z0")); + queue.inject(F("G92X0Y0Z0")); HMI_AudioFeedback(); #endif break; @@ -3556,9 +3556,9 @@ void HMI_AdvSet() { case ADVSET_CASE_HOMEOFF: checkkey = HomeOff; select_item.reset(); - HMI_ValueStruct.Home_OffX_scaled = home_offset[X_AXIS] * 10; - HMI_ValueStruct.Home_OffY_scaled = home_offset[Y_AXIS] * 10; - HMI_ValueStruct.Home_OffZ_scaled = home_offset[Z_AXIS] * 10; + HMI_ValueStruct.Home_OffX_scaled = home_offset.x * 10; + HMI_ValueStruct.Home_OffY_scaled = home_offset.y * 10; + HMI_ValueStruct.Home_OffZ_scaled = home_offset.z * 10; Draw_HomeOff_Menu(); break; #endif @@ -3806,7 +3806,7 @@ void HMI_Tune() { EncoderRate.enabled = true; #else // Apply workspace offset, making the current position 0,0,0 - queue.inject(F("G92 X0 Y0 Z0")); + queue.inject(F("G92X0Y0Z0")); HMI_AudioFeedback(); #endif break; diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 04a612a9cc2d5..9d6871fc2dda6 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -1246,7 +1246,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ if (draw) Draw_Menu_Item(row, ICON_SetHome, F("Set Home Position")); else { - gcode.process_subcommands_now(F("G92 X0 Y0 Z0")); + gcode.process_subcommands_now(F("G92X0Y0Z0")); AudioFeedback(); } break; diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index c6e7b6a9c6cf7..cae29e5b28e96 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -85,8 +85,8 @@ #if ENABLED(BABYSTEPPING) #include "../../../feature/babystep.h" #if !HAS_BED_PROBE - #define JUST_BABYSTEP 1 - #endif + #define JUST_BABYSTEP 1 + #endif #endif #endif @@ -1956,7 +1956,7 @@ void RebootPrinter() { hal.reboot(); } -void Goto_Info_Menu(){ +void Goto_Info_Menu() { Draw_Info_Menu(); DWIN_UpdateLCD(); HMI_SaveProcessID(WaitResponse); @@ -1965,7 +1965,6 @@ void Goto_Info_Menu(){ void Goto_Move_Menu() { #if HAS_HOTEND gcode.process_subcommands_now(F("G92E0")); // reset extruder position - planner.synchronize(); #endif Draw_Move_Menu(); } @@ -1983,7 +1982,7 @@ void HomeZ() { queue.inject(F("G28Z")); } void SetHome() { // Apply workspace offset, making the current position 0,0,0 - queue.inject(F("G92 X0 Y0 Z0")); + queue.inject(F("G92X0Y0Z0")); DONE_BUZZ(true); } @@ -2006,16 +2005,15 @@ void SetHome() { void SetMoveZto0() { #if ENABLED(Z_SAFE_HOMING) - char cmd[48], str_1[5], str_2[5]; - sprintf_P(cmd, PSTR("G28XYO\nG28Z\nG0X%sY%sF5000\nM420S0\nG0Z0F300"), + char cmd[54], str_1[5], str_2[5]; + sprintf_P(cmd, PSTR("G28XYO\nG28Z\nG0X%sY%sF5000\nM420S0\nG0Z0F300\nM400"), dtostrf(Z_SAFE_HOMING_X_POINT, 1, 1, str_1), dtostrf(Z_SAFE_HOMING_Y_POINT, 1, 1, str_2) ); gcode.process_subcommands_now(cmd); #else - gcode.process_subcommands_now(F("G28O\nM420S0\nG0Z0F300")); + gcode.process_subcommands_now(F("G28O\nM420S0\nG0Z0F300\nM400")); #endif - planner.synchronize(); ui.reset_status(); DONE_BUZZ(true); } @@ -2025,7 +2023,7 @@ void SetHome() { DisableMotors(); } -#endif // HAS_ZOFFSET_ITEM +#endif // HAS_ZOFFSET_ITEM #if HAS_PREHEAT void DoPreheat0() { ui.preheat_all(0); } @@ -2059,9 +2057,9 @@ void ApplyMoveE() { planner.buffer_line(current_position, MMM_TO_MMS(FEEDRATE_E)); } } -void SetMoveX() { HMI_value.axis = X_AXIS; SetPFloatOnClick(X_MIN_POS, X_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove);} -void SetMoveY() { HMI_value.axis = Y_AXIS; SetPFloatOnClick(Y_MIN_POS, Y_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove);} -void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove);} +void SetMoveX() { HMI_value.axis = X_AXIS; SetPFloatOnClick(X_MIN_POS, X_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove); } +void SetMoveY() { HMI_value.axis = Y_AXIS; SetPFloatOnClick(Y_MIN_POS, Y_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove); } +void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove); } #if HAS_HOTEND void SetMoveE() { @@ -2074,14 +2072,13 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #endif void SetPID(celsius_t t, heater_id_t h) { - char cmd[48] = ""; + char cmd[53] = ""; char str_1[5] = "", str_2[5] = ""; - sprintf_P(cmd, PSTR("G28OXY\nG0Z5F300\nG0X%sY%sF5000\nM84"), + sprintf_P(cmd, PSTR("G28OXY\nG0Z5F300\nG0X%sY%sF5000\nM84\nM400"), dtostrf(X_CENTER, 1, 1, str_1), dtostrf(Y_CENTER, 1, 1, str_2) ); gcode.process_subcommands_now(cmd); - planner.synchronize(); thermalManager.PID_autotune(t, h, HMI_data.PidCycles, true); } #if HAS_HOTEND @@ -2272,18 +2269,18 @@ void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } queue.inject(F("M600 B2")); } - void ParkHead(){ + void ParkHead() { LCD_MESSAGE(MSG_FILAMENT_PARK_ENABLED); queue.inject(F("G28O\nG27")); } #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void UnloadFilament(){ + void UnloadFilament() { LCD_MESSAGE(MSG_FILAMENTUNLOAD); queue.inject(F("M702 Z20")); } - void LoadFilament(){ + void LoadFilament() { LCD_MESSAGE(MSG_FILAMENTLOAD); queue.inject(F("M701 Z20")); } @@ -2348,11 +2345,10 @@ TERN(HAS_BED_PROBE, float, void) Tram(uint8_t point) { LIMIT(ypos, MESH_MIN_Y, MESH_MAX_Y); probe.stow(); gcode.process_subcommands_now(F("M420S0\nG28O")); - planner.synchronize(); inLev = true; zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW); if (isnan(zval)) - LCD_MESSAGE_F("Outside of Probing Area"); + LCD_MESSAGE(MSG_ZPROBE_OUT); else { sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"), dtostrf(xpos, 1, 1, str_1), @@ -2451,10 +2447,9 @@ void TramC () { Tram(4); } #if ENABLED(MESH_BED_LEVELING) - void ManualMeshStart(){ + void ManualMeshStart() { LCD_MESSAGE(MSG_UBL_BUILD_MESH_MENU); gcode.process_subcommands_now(F("G28XYO\nG28Z\nM211S0\nG29S1")); - planner.synchronize(); #ifdef MANUAL_PROBE_START_Z const uint8_t line = CurrentMenu->line(MMeshMoveZItem->pos); DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Background_Color, 3, 2, VALX - 2 * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(line), MANUAL_PROBE_START_Z); @@ -2468,15 +2463,14 @@ void TramC () { Tram(4); } planner.buffer_line(current_position, homing_feedrate(Z_AXIS)); } } - void SetMMeshMoveZ() { SetPFloatOnClick(-1, 1, 2, planner.synchronize, LiveMeshMoveZ);} + void SetMMeshMoveZ() { SetPFloatOnClick(-1, 1, 2, planner.synchronize, LiveMeshMoveZ); } - void ManualMeshContinue(){ + void ManualMeshContinue() { gcode.process_subcommands_now(F("G29S2")); - planner.synchronize(); MMeshMoveZItem->redraw(); } - void ManualMeshSave(){ + void ManualMeshSave() { LCD_MESSAGE(MSG_UBL_STORAGE_MESH_MENU); queue.inject(F("M211S1\nM500")); } @@ -3134,7 +3128,7 @@ void Draw_Move_Menu() { #endif } CurrentMenu->draw(); - if (!all_axes_trusted()) LCD_MESSAGE_F("WARNING: current position is unknown, home axes"); + if (!all_axes_trusted()) LCD_MESSAGE_F("WARNING: Current position unknown. Home axes."); } #if HAS_HOME_OFFSET @@ -3142,9 +3136,9 @@ void Draw_Move_Menu() { checkkey = Menu; if (SetMenu(HomeOffMenu, GET_TEXT_F(MSG_SET_HOME_OFFSETS), 4)) { BACK_ITEM(Draw_AdvancedSettings_Menu); - EDIT_ITEM_F(ICON_HomeOffsetX, MSG_HOME_OFFSET_X, onDrawPFloatMenu, SetHomeOffsetX, &home_offset[X_AXIS]); - EDIT_ITEM_F(ICON_HomeOffsetY, MSG_HOME_OFFSET_Y, onDrawPFloatMenu, SetHomeOffsetY, &home_offset[Y_AXIS]); - EDIT_ITEM_F(ICON_HomeOffsetZ, MSG_HOME_OFFSET_Z, onDrawPFloatMenu, SetHomeOffsetZ, &home_offset[Z_AXIS]); + EDIT_ITEM_F(ICON_HomeOffsetX, MSG_HOME_OFFSET_X, onDrawPFloatMenu, SetHomeOffsetX, &home_offset.x); + EDIT_ITEM_F(ICON_HomeOffsetY, MSG_HOME_OFFSET_Y, onDrawPFloatMenu, SetHomeOffsetY, &home_offset.y); + EDIT_ITEM_F(ICON_HomeOffsetZ, MSG_HOME_OFFSET_Z, onDrawPFloatMenu, SetHomeOffsetZ, &home_offset.z); } UpdateMenu(HomeOffMenu); } @@ -3619,9 +3613,9 @@ void Draw_Steps_Menu() { void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &Z_VALUES_ARR[HMI_value.Select ? mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : mesh_y]; EditZValueItem->redraw(); } void ApplyEditMeshX() { mesh_x = MenuData.Value; } - void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick (0, GRID_MAX_POINTS_X - 1, mesh_x, ApplyEditMeshX, LiveEditMesh); } + void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick(0, GRID_MAX_POINTS_X - 1, mesh_x, ApplyEditMeshX, LiveEditMesh); } void ApplyEditMeshY() { mesh_y = MenuData.Value; } - void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick (0, GRID_MAX_POINTS_Y - 1, mesh_y, ApplyEditMeshY, LiveEditMesh); } + void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, mesh_y, ApplyEditMeshY, LiveEditMesh); } void SetEditZValue() { SetPFloatOnClick(Z_OFFSET_MIN, Z_OFFSET_MAX, 3); } #endif @@ -3629,14 +3623,14 @@ void Draw_Steps_Menu() { #if ENABLED(AUTO_BED_LEVELING_UBL) void ApplyUBLSlot() { ubl.storage_slot = MenuData.Value; } - void SetUBLSlot() { SetIntOnClick (0, settings.calc_num_meshes() - 1, ubl.storage_slot, ApplyUBLSlot); } + void SetUBLSlot() { SetIntOnClick(0, settings.calc_num_meshes() - 1, ubl.storage_slot, ApplyUBLSlot); } void onDrawUBLSlot(MenuItemClass* menuitem, int8_t line) { if (ubl.storage_slot < 0) ubl.storage_slot = 0; onDrawIntMenu(menuitem, line, ubl.storage_slot); } void ApplyUBLTiltGrid() { ubl_tools.tilt_grid = MenuData.Value; } - void SetUBLTiltGrid() { SetIntOnClick (1, 3, ubl_tools.tilt_grid, ApplyUBLTiltGrid); } + void SetUBLTiltGrid() { SetIntOnClick(1, 3, ubl_tools.tilt_grid, ApplyUBLTiltGrid); } void UBLTiltMesh() { if (ubl.storage_slot < 0) ubl.storage_slot = 0; @@ -3647,7 +3641,6 @@ void Draw_Steps_Menu() { } else gcode.process_subcommands_now(F("G28O\nG29J")); - planner.synchronize(); LCD_MESSAGE(MSG_UBL_MESH_TILTED); } diff --git a/buildroot/share/PlatformIO/boards/marlin_Artillery_Ruby.json b/buildroot/share/PlatformIO/boards/marlin_Artillery_Ruby.json index 5b0593a6164b1..e1c8333800cda 100644 --- a/buildroot/share/PlatformIO/boards/marlin_Artillery_Ruby.json +++ b/buildroot/share/PlatformIO/boards/marlin_Artillery_Ruby.json @@ -2,7 +2,7 @@ "build": { "core": "stm32", "cpu": "cortex-m4", - "extra_flags": "-DSTM32F401xx -DSTM32F401xC -DTARGET_STM32F4 -DARDUINO_ARCH_STM32", + "extra_flags": "-DSTM32F401xx", "f_cpu": "84000000L", "hwids": [ [ diff --git a/docker/Dockerfile b/docker/Dockerfile index b6286b706edda..ad3e15d5de6f2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.9.0-buster -RUN pip install -U platformio +RUN pip install -U https://github.com/platformio/platformio-core/archive/v5.2.5.zip RUN platformio update # To get the test platforms RUN pip install PyYaml diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 5add074dc31c2..688cc1054736b 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -251,14 +251,14 @@ build_unflags = ${env:BIGTREE_SKR_2_F429_USB.build_unflags} -Os -NDEBUG # BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4) # [env:BIGTREE_OCTOPUS_V1] -extends = stm32_variant -board = marlin_BigTree_Octopus_v1 -board_build.offset = 0x8000 +extends = stm32_variant +board = marlin_BigTree_Octopus_v1 +board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 debug_tool = stlink upload_protocol = stlink -build_flags = ${stm32_variant.build_flags} - -DSTM32F446_5VX -DUSE_USB_HS_IN_FS +build_flags = ${stm32_variant.build_flags} + -DSTM32F446_5VX -DUSE_USB_HS_IN_FS # # BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4) with USB Flash Drive Support @@ -277,14 +277,14 @@ build_flags = ${stm_flash_drive.build_flags} # BigTreeTech Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4) # [env:BIGTREE_OCTOPUS_PRO_V1_F429] -extends = stm32_variant -board = marlin_BigTree_Octopus_Pro_v1_F429 -board_build.offset = 0x8000 +extends = stm32_variant +board = marlin_BigTree_Octopus_Pro_v1_F429 +board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 debug_tool = stlink upload_protocol = stlink -build_flags = ${stm32_variant.build_flags} - -DUSE_USB_HS_IN_FS +build_flags = ${stm32_variant.build_flags} + -DUSE_USB_HS_IN_FS # # BigTreeTech Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4) with USB Flash Drive Support