Skip to content

[BUG] Parsing U8glib-HAL.h may fail under specific conditions #93

@Maoweicao

Description

@Maoweicao

I am using Marlin 2.0.9.10 with PlatformIO 6.1.15 to compile firmware for an ESP32 board (MagicMaker Sparrow).
I found that U8glib-HAL.h may fail to parse in espcom.cpp under specific circumstances, even if the dependency already exists.

Original code:

#if HAS_MARLINUI_U8GLIB
  #include <U8glib-HAL.h>
#endif

After modifying to the following code, the compilation error disappears and the firmware works normally:

#if HAS_MARLINUI_U8GLIB
  #if __has_include (<U8glib-HAL.h>)
    #include <U8glib-HAL.h>
  #endif
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions