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

[BUG] Compile error when HAS_LCD_MENU is false in MarlinUI::external_encoder #18777

Closed
ellensp opened this issue Jul 25, 2020 · 3 comments · Fixed by #18778
Closed

[BUG] Compile error when HAS_LCD_MENU is false in MarlinUI::external_encoder #18777

ellensp opened this issue Jul 25, 2020 · 3 comments · Fixed by #18778

Comments

@ellensp
Copy link
Contributor

ellensp commented Jul 25, 2020

Bug Description

In ultralcd.h external_encoder() is only defined if HAS_LCD_MENU is true.
But in ultralcd.cpp the function external_encoder() is created when HAS_LCD_MENU is true or false.

With the right Configuration file, this can trigger the following compile error.
"Marlin/src/lcd/ultralcd.cpp:760:35: error: no 'void MarlinUI::external_encoder()' member function declared in class 'MarlinUI'"

My Configurations

Break_marlin_config.zip

Steps to Reproduce

  1. Obtain latest marlin bugfix 2.0.x
  2. Use provided Configuration.h
  3. Watch it fail to compile.

Expected behavior:

It should compile

Actual behavior:

It errors with
Marlin/src/lcd/ultralcd.cpp:760:35: error: no 'void MarlinUI::external_encoder()' member function declared in class 'MarlinUI'

@rhapsodyv
Copy link
Sponsor Member

The cause:

The method is compiled when AUTO_BED_LEVELING_UBL is enabled. But is defined only when
#if HAS_LCD_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) and #if ENABLED(AUTO_BED_LEVELING_UBL)

  #if HAS_LCD_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
    static bool external_control;
    FORCE_INLINE static void capture() { external_control = true; }
    FORCE_INLINE static void release() { external_control = false; }
    #if ENABLED(AUTO_BED_LEVELING_UBL)
      static void external_encoder();
    #endif

We must match the same conditions in cpp and the header files.

rhapsodyv added a commit to rhapsodyv/Marlin that referenced this issue Jul 25, 2020
MarlinUI::external_encoder only when AUTO_BED_LEVELING_UBL and HAS_LCD_MENU enabled, to match declaration in ultralcd.h
@rhapsodyv
Copy link
Sponsor Member

I did the cpp match the header in #18778

@thinkyhead thinkyhead linked a pull request Jul 25, 2020 that will close this issue
@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants