From ee48fc6544bcf916bd1c4ac24831648b33835194 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 10 Nov 2020 01:32:08 -0800 Subject: [PATCH] Fix Arduino DUE compilation (#20058) --- Marlin/src/HAL/STM32/MarlinSPI.cpp | 4 ++++ Marlin/src/feature/controllerfan.cpp | 2 ++ Marlin/src/feature/controllerfan.h | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/src/HAL/STM32/MarlinSPI.cpp b/Marlin/src/HAL/STM32/MarlinSPI.cpp index fd05b1aeb..da11b88a6 100644 --- a/Marlin/src/HAL/STM32/MarlinSPI.cpp +++ b/Marlin/src/HAL/STM32/MarlinSPI.cpp @@ -20,6 +20,8 @@ * */ +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + #include "MarlinSPI.h" static void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb, uint32_t dataSize) { @@ -159,3 +161,5 @@ uint8_t MarlinSPI::dmaSend(const void * transmitBuf, uint16_t length, bool minc) HAL_DMA_DeInit(&_dmaTx); return 1; } + +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/feature/controllerfan.cpp b/Marlin/src/feature/controllerfan.cpp index fa5a86b01..020646775 100644 --- a/Marlin/src/feature/controllerfan.cpp +++ b/Marlin/src/feature/controllerfan.cpp @@ -34,6 +34,8 @@ uint8_t ControllerFan::speed; #if ENABLED(CONTROLLER_FAN_EDITABLE) controllerFan_settings_t ControllerFan::settings; // {0} + #else + const controllerFan_settings_t &ControllerFan::settings = controllerFan_defaults; #endif void ControllerFan::setup() { diff --git a/Marlin/src/feature/controllerfan.h b/Marlin/src/feature/controllerfan.h index d1d39f21f..55f2d5cfc 100644 --- a/Marlin/src/feature/controllerfan.h +++ b/Marlin/src/feature/controllerfan.h @@ -58,7 +58,7 @@ class ControllerFan { #if ENABLED(CONTROLLER_FAN_EDITABLE) static controllerFan_settings_t settings; #else - static const controllerFan_settings_t constexpr &settings = controllerFan_defaults; + static const controllerFan_settings_t &settings; #endif static inline bool state() { return speed > 0; } static inline void init() { reset(); }