diff --git a/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp b/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp index 02dc772296..025e5a3bb6 100644 --- a/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp +++ b/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp @@ -60,6 +60,10 @@ #ifdef __SAMD21__ +#include "../../../inc/MarlinConfigPre.h" + +#if HAS_MARLINUI_U8GLIB + #include #include "SPI.h" @@ -151,4 +155,6 @@ uint8_t u8g_com_samd21_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val return 1; } +#endif // HAS_MARLINUI_U8GLIB + #endif // __SAMD21__