Browse Source

Fix E3V2 DWIN Jerk Menu (#20352)

* Fix E3V2 DWIN build without CLASSIC_JERK
* Fix jerk edits applying to wrong index
vanilla_fb_2.0.x
Jason Smith 4 years ago
committed by GitHub
parent
commit
a4618309ce
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      Marlin/src/lcd/dwin/e3v2/dwin.cpp
  2. 4
      buildroot/tests/STM32F103RET6_creality-tests

19
Marlin/src/lcd/dwin/e3v2/dwin.cpp

@ -185,7 +185,10 @@ bool dwin_abort_flag = false; // Flag to reset feedrate, return to Home
constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE;
constexpr float default_max_acceleration[] = DEFAULT_MAX_ACCELERATION;
constexpr float default_max_jerk[] = { DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK, DEFAULT_EJERK };
#if HAS_CLASSIC_JERK
constexpr float default_max_jerk[] = { DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK, DEFAULT_EJERK };
#endif
uint8_t Percentrecord = 0;
uint16_t remain_time = 0;
@ -1492,8 +1495,8 @@ void HMI_MaxAccelerationXYZE() {
if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.Max_Jerk)) {
checkkey = MaxJerk;
EncoderRate.enabled = false;
if (WITHIN(HMI_flag.step_axis, X_AXIS, E_AXIS))
planner.set_max_jerk(HMI_flag.step_axis, HMI_ValueStruct.Max_Jerk / 10);
if (WITHIN(HMI_flag.jerk_axis, X_AXIS, E_AXIS))
planner.set_max_jerk(HMI_flag.jerk_axis, HMI_ValueStruct.Max_Jerk / 10);
DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 210, MBASE(select_jerk.now), HMI_ValueStruct.Max_Jerk);
return;
}
@ -2955,7 +2958,8 @@ inline void Draw_Max_Accel_Menu() {
#endif
}
inline void Draw_Max_Jerk_Menu() {
#if HAS_CLASSIC_JERK
inline void Draw_Max_Jerk_Menu() {
Clear_Main_Window();
if (HMI_IsChinese()) {
@ -3023,7 +3027,8 @@ inline void Draw_Max_Jerk_Menu() {
#if HAS_HOTEND
DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, 210, MBASE(4), planner.max_jerk[E_AXIS] * MINUNITMULT);
#endif
}
}
#endif
inline void Draw_Steps_Menu() {
Clear_Main_Window();
@ -3636,7 +3641,9 @@ void DWIN_HandleScreen() {
#endif
case MaxSpeed: HMI_MaxSpeed(); break;
case MaxAcceleration: HMI_MaxAcceleration(); break;
#if HAS_CLASSIC_JERK
case MaxJerk: HMI_MaxJerk(); break;
#endif
case Step: HMI_Step(); break;
case Move_X: HMI_Move_X(); break;
case Move_Y: HMI_Move_Y(); break;
@ -3657,7 +3664,9 @@ void DWIN_HandleScreen() {
case PrintSpeed: HMI_PrintSpeed(); break;
case MaxSpeed_value: HMI_MaxFeedspeedXYZE(); break;
case MaxAcceleration_value: HMI_MaxAccelerationXYZE(); break;
#if HAS_CLASSIC_JERK
case MaxJerk_value: HMI_MaxJerkXYZE(); break;
#endif
case Step_value: HMI_StepXYZE(); break;
default: break;
}

4
buildroot/tests/STM32F103RET6_creality-tests

@ -13,4 +13,8 @@ use_example_configs "Creality/Ender-3 V2"
opt_enable MARLIN_DEV_MODE
exec_test $1 $2 "Ender 3 v2" "$3"
use_example_configs "Creality/Ender-3 V2"
opt_disable CLASSIC_JERK
exec_test $1 $2 "Ender 3 v2 w/o CLASSIC_JERK" "$3"
restore_configs

Loading…
Cancel
Save