MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.28k stars 19.23k forks source link

[BUG] JyersUI compile errors #22736

Closed GhostlyCrowd closed 3 years ago

GhostlyCrowd commented 3 years ago

Did you test the latest bugfix-2.0.x code?

Yes, and the problem still exists.

Bug Description

Current bugfix 2.0.x 754b3191

directly related to https://github.com/MarlinFirmware/Marlin/pull/22422

Fails to compile, without adding #include "../../../gcode/gcode.h" to Marlin\src\lcd\e3v2\jyersui\dwin.cpp

with errors Marlin\src\lcd\e3v2\jyersui\dwin.cpp:335:11: error: 'gcode' was not declared in this scope

Fails to compile without enabling #define POWER_LOSS_RECOVERY in configuration_adv.h

with errors Marlin\src\lcd\e3v2\jyersui\dwin.cpp:4758:11: error: 'recovery' was not declared in this scope; did you mean 'remove'?

Fails to compile because default config/examples missing #define ENCODER_5X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 5x speed in configuration_adv.h

with errors Marlin\src\lcd\e3v2\jyersui\rotary_encoder.cpp:148:39: error: 'ENCODER_5X_STEPS_PER_SEC' was not declared in this scope; did you mean 'ENCODER_10X_STEPS_PER_SEC'?

@Jyers

Bug Timeline

When DWIN_CREALITY_LCD_JYERSUI was presented as an option

Expected behaviour

To compile

Actual behaviour

Fails with the above explanations of errors and how to resolve them

Steps to Reproduce

Try to compile as the code exists.

Version of Marlin Firmware

Bugfix 2.0.x

Electronics

SKR E3 Mini V1.2

electronicm commented 3 years ago

I've known the problem since DWIN MARLINUI.

GhostlyCrowd commented 3 years ago

I've known the problem since DWIN MARLINUI.

Really, I could have sworn I tried that, and it compiled fine today, but DWIN_CREALITY_LCD_ENHANCED also suffers from the same related errors its seems. Just tested,

tome9111991 commented 3 years ago

You use latest config?

https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.0.x/config/examples/Creality/Ender-3%20V2/CrealityUI

GhostlyCrowd commented 3 years ago

You use latest config?

https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.0.x/config/examples/Creality/Ender-3%20V2/CrealityUI

No I use a custom config based on the ender3 skr e3 mini from marlins config example repo and then i use the default config to compare and verify things that are missing.

Aside from that the default config and the examples were updated to include #define DWIN_CREALITY_LCD_JYERSUI however since its missing #define ENCODER_5X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 5x speed in config_adv it would never work for the SKR examples.

And the default config in the source tree should definitely not be missing #define ENCODER_5X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 5x speed

tome9111991 commented 3 years ago

Maybe you should compare your config with latrst e3v2 config

GhostlyCrowd commented 3 years ago

I've tracked it down, DWIN_CREALITY_LCD_JYERSUI depends on #define POWER_LOSS_RECOVERY always being enabled because it is the only place DWIN_CREALITY_LCD_JYERSUI seems to get #include "../../../gcode/gcode.h" included, from src_filter=+<src/feature/powerloss.cpp>

If one doesn't want to run Power loss recovery, Marlin\src\lcd\e3v2\jyersui\dwin.cpp should definitely include #include "../../../gcode/gcode.h" rather than hoping it's defined somewhere else.

Adding #include "../../../gcode/gcode.h" to dwin.cpp squashes several dozen errors related to it not being included with #define POWER_LOSS_RECOVERY but then I still get errors because of course #define POWER_LOSS_RECOVERY Marlin\src\lcd\e3v2\jyersui\dwin.cpp:4758:11: error: 'recovery' was not declared in this scope; did you mean 'remove'?

If it's somehow required explicitly for this, then a sanity check would be beneficial.

thinkyhead commented 3 years ago

Please include configurations when posting bug reports so that we can use them to reproduce the exact conditions for the reported error.

thinkyhead commented 3 years ago

67d82ff228 453e60958a

Please test the bugfix-2.0.x branch to see where it stands. If the problem has been resolved then we can close this issue. If the issue isn't resolved yet, then we should investigate further.

tome9111991 commented 3 years ago

If it's somehow required explicitly for this, then a sanity check would be beneficial.

You should use #define POWER_LOSS_RECOVERY You can Power Loss disable with Display GUI there is a checkbox to enable/disable

(In my mind it is disable by default)

GhostlyCrowd commented 3 years ago

You should use #define POWER_LOSS_RECOVERY You can Power Loss disable with Display GUI there is a checkbox to enable/disable

(In my mind it is disable by default)

It's wasted flash space if one is not going to use it, IE: never print from SD and or has a power loss solution already such as a Battery backup and a generator that auto kicks on like i do.

It should work with out it defined anyhow.

GhostlyCrowd commented 3 years ago

67d82ff 453e609

Please test the bugfix-2.0.x branch to see where it stands. If the problem has been resolved then we can close this issue. If the issue isn't resolved yet, then we should investigate further.

I can confirm it now compiles and works with out #define POWER_LOSS_RECOVERY

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.