Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DWIN_LCD_PROUI compile errors & orphan code #25304

Closed
wants to merge 19 commits into from

Conversation

Bob-the-Kuhn
Copy link
Contributor

This PR corrects three conditions in dwin.cpp:

  • DWIN_LCD_PROUI compile time errors when TEMP_SENSOR_BED being set to 0
  • DWIN_LCD_PROUI compile time errors when having a probe, enabling BABYSTEPPING, and NOT enabling BABYSTEP_ZPROBE_OFFSET
  • The following line will never be executed because one of the preceeding #elif statements will always be executed:
    MENU_ITEM(ICON_SetHome, MSG_SET_HOME_OFFSETS, onDrawHomeOffset, SetHome);

Steps to Reproduce:

  • Enable a probe
  • Enable BABYSTEPPING
  • Leave TEMP_SENSOR_BED as 0
  • Enable DWIN_LCD_PROUI
  • Change MOTHERBOARD to a board that supports the DWIN display

Here's a minimal set of config files that demonstrate the problems.
Config.zip

This PR fixes the issues in #25271

NOTE: I do not have the hardware needed to test this PR.


Changes to fix DWIN_LCD_PROUI compile time errors when TEMP_SENSOR_BED being set to 0

Add #if HAS_HEATED_BED logic in three places:

  • old line 1251 - this one needed to have an ELSE added so that the thermalManager.wholeDegHotend(0) would be executed when a heated bed wasn't present.
  • old lines 1495-1501
  • old lines 1516-1520

Changes to fix DWIN_LCD_PROUI compile time errors when having a probe, enabling BABYSTEPPING, and NOT enabling BABYSTEP_ZPROBE_OFFSET

This backs out the changes from PR #25176 on the old line 3327.

The routine onDrawZOffset is only defined when either of the following is true:

  • BABYSTEPPING is enabled and a probe is NOT enabled
  • BABYSTEPPING is enabled and BABYSTEP_ZPROBE_OFFSET is enabled

The routine onDrawZOffset is only used in this line:
EDIT_ITEM(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawZOffset, SetZOffset, &BABY_Z_VAR);

Currently this line is only compiled when BABYSTEPPING is enabled and a probe is enabled. Prior to PR #25176 it would be executed if either of the following are true:

  • BABYSTEPPING is enabled and a probe is NOT enabled
  • BABYSTEPPING is enabled and BABYSTEP_ZPROBE_OFFSET is enabled

Changes to allow MENU_ITEM(ICON_SetHome, MSG_SET_HOME_OFFSETS, onDrawHomeOffset, SetHome); to execute

This backs out the changes from PR #25176 on the old lines 3026, 3028 & 3030.

thinkyhead and others added 13 commits January 3, 2023 18:57

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.

Partially verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
… into bugfix-2.1.x
1) remove menu items when heatbed isn't present
2) restore #if logic so that onDrawHomeOffset menu item isn't an orphan
3) restore #if logic so that onDrawZOffset menu item is  executed if either of the following are true:
BABYSTEPPING is enabled and a probe is NOT enabled
BABYSTEPPING is enabled and BABYSTEP_ZPROBE_OFFSET is enabled
@thisiskeithb
Copy link
Member

NOTE: I do not have the hardware needed to test this PR.

@mriscoc Should be able to.

Add in original condition so now it'll only execute when  n!= PIDTEMP_START
@Bob-the-Kuhn
Copy link
Contributor Author

Just changed new line 1254 so that it only executes when HMI_value.pidresult isn't equal to PIDTEMP_START.

This makes it only execute the update under the same conditions as new line 1252.

@mriscoc
Copy link
Contributor

mriscoc commented Jan 28, 2023

@mriscoc Should be able to.

I'm preparing a PR with the menu items for Linear Advance and Input Shaping. I think that currently I have those issues fixed in my working sources.

@Bob-the-Kuhn
Copy link
Contributor Author

Let me know for sure. I'll close this PR if that's the case.

@thinkyhead thinkyhead force-pushed the bugfix-2.1.x branch 2 times, most recently from e90c213 to 4b9bb85 Compare March 7, 2023 05:17
@thinkyhead thinkyhead force-pushed the bugfix-2.1.x branch 6 times, most recently from 27df113 to 8d31429 Compare March 25, 2023 04:25
@thinkyhead thinkyhead force-pushed the bugfix-2.1.x branch 3 times, most recently from de391db to 0f34163 Compare April 12, 2023 05:14
@thinkyhead
Copy link
Member

@mriscoc ; @Bob-the-Kuhn — Are these changes still needed, or is there a pending ProUI update that already has them? If needed, I can put together a PR based on the latest ProUI, rebased on the current state of bugfix-2.1.x, so the latest changes can get merged ahead of 2.1.3.

@mriscoc
Copy link
Contributor

mriscoc commented May 10, 2023

@thinkyhead the code for ProUI has diverged from the code from my repository, so I need to do some more work to provide a good PR with the latest changes.

@mriscoc
Copy link
Contributor

mriscoc commented Jun 21, 2023

Finally, here is the latest ProUI PR: #26003

@thinkyhead thinkyhead closed this Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants