Skip to content

Commit

Permalink
Post-merge cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 17, 2022
1 parent 2e8d0c1 commit 4fa8ace
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions Marlin/src/gcode/probe/G30.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
}

Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/lcd/e3v2/creality/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/jyersui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
65 changes: 29 additions & 36 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -1956,7 +1956,7 @@ void RebootPrinter() {
hal.reboot();
}

void Goto_Info_Menu(){
void Goto_Info_Menu() {
Draw_Info_Menu();
DWIN_UpdateLCD();
HMI_SaveProcessID(WaitResponse);
Expand All @@ -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();
}
Expand All @@ -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);
}

Expand All @@ -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);
}
Expand All @@ -2025,7 +2023,7 @@ void SetHome() {
DisableMotors();
}

#endif // HAS_ZOFFSET_ITEM
#endif // HAS_ZOFFSET_ITEM

#if HAS_PREHEAT
void DoPreheat0() { ui.preheat_all(0); }
Expand Down Expand Up @@ -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() {
Expand All @@ -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
Expand Down Expand Up @@ -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"));
}
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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);
Expand All @@ -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"));
}
Expand Down Expand Up @@ -3134,17 +3128,17 @@ 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
void Draw_HomeOffset_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);
}
Expand Down Expand Up @@ -3619,24 +3613,24 @@ 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

#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;
Expand All @@ -3647,7 +3641,6 @@ void Draw_Steps_Menu() {
}
else
gcode.process_subcommands_now(F("G28O\nG29J"));
planner.synchronize();
LCD_MESSAGE(MSG_UBL_MESH_TILTED);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
[
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 10 additions & 10 deletions ini/stm32f4.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4fa8ace

Please sign in to comment.