From 98046776693df30554f1fb1899ce1d90f92c44aa Mon Sep 17 00:00:00 2001 From: ellensp Date: Sat, 3 Oct 2020 11:28:08 +1300 Subject: [PATCH] Fix wrappers on HAL/STM32F1 .cpp files (#19581) Co-authored-by: Scott Lahteine --- Marlin/src/HAL/STM32F1/HAL_SPI.cpp | 3 --- Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp | 3 +++ Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp | 3 +++ Marlin/src/HAL/STM32F1/eeprom_wired.cpp | 10 +++++----- Marlin/src/HAL/STM32F1/msc_sd.cpp | 4 ++-- Marlin/src/HAL/STM32F1/onboard_sd.cpp | 3 +++ 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/HAL_SPI.cpp b/Marlin/src/HAL/STM32F1/HAL_SPI.cpp index 4d72473e7f..550a79deae 100644 --- a/Marlin/src/HAL/STM32F1/HAL_SPI.cpp +++ b/Marlin/src/HAL/STM32F1/HAL_SPI.cpp @@ -24,9 +24,6 @@ /** * Software SPI functions originally from Arduino Sd2Card Library * Copyright (c) 2009 by William Greiman - */ - -/** * Adapted to the STM32F1 HAL */ diff --git a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp index f77306a88a..658b7cd4a6 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp @@ -25,6 +25,8 @@ * with simple implementations supplied by Marlin. */ +#ifdef __STM32F1__ + #include "../../inc/MarlinConfig.h" #if ENABLED(IIC_BL24CXX_EEPROM) @@ -79,3 +81,4 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t } #endif // IIC_BL24CXX_EEPROM +#endif // __STM32F1__ diff --git a/Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp b/Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp index 33dd277add..ccc3fc537f 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp @@ -25,6 +25,8 @@ * Enable USE_SHARED_EEPROM if not supplied by the framework. */ +#ifdef __STM32F1__ + #include "../../inc/MarlinConfig.h" #if ENABLED(IIC_BL24CXX_EEPROM) @@ -49,3 +51,4 @@ uint8_t eeprom_read_byte(uint8_t *pos) { } #endif // IIC_BL24CXX_EEPROM +#endif // __STM32F1__ diff --git a/Marlin/src/HAL/STM32F1/eeprom_wired.cpp b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp index b4699d00dc..fffd6ccaf0 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_wired.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp @@ -17,17 +17,17 @@ * along with this program. If not, see . * */ + +/** + * HAL PersistentStore for STM32F1 + */ + #ifdef __STM32F1__ #include "../../inc/MarlinConfig.h" #if USE_WIRED_EEPROM -/** - * PersistentStore for Arduino-style EEPROM interface - * with simple implementations supplied by Marlin. - */ - #include "../shared/eeprom_if.h" #include "../shared/eeprom_api.h" diff --git a/Marlin/src/HAL/STM32F1/msc_sd.cpp b/Marlin/src/HAL/STM32F1/msc_sd.cpp index 6a4652e467..4f44f2ee90 100644 --- a/Marlin/src/HAL/STM32F1/msc_sd.cpp +++ b/Marlin/src/HAL/STM32F1/msc_sd.cpp @@ -13,7 +13,7 @@ * along with this program. If not, see . * */ -#ifdef USE_USB_COMPOSITE +#if defined(__STM32F1__) && defined(USE_USB_COMPOSITE) #include "msc_sd.h" #include "SPI.h" @@ -77,4 +77,4 @@ void MSC_SD_init() { #endif } -#endif // USE_USB_COMPOSITE +#endif // __STM32F1__ && USE_USB_COMPOSITE diff --git a/Marlin/src/HAL/STM32F1/onboard_sd.cpp b/Marlin/src/HAL/STM32F1/onboard_sd.cpp index da25271734..9c2b128ddc 100644 --- a/Marlin/src/HAL/STM32F1/onboard_sd.cpp +++ b/Marlin/src/HAL/STM32F1/onboard_sd.cpp @@ -11,6 +11,8 @@ * Redistributions of source code must retain the above copyright notice. */ +#ifdef __STM32F1__ + #include "../../inc/MarlinConfig.h" #if SD_CONNECTION_IS(ONBOARD) @@ -553,3 +555,4 @@ DRESULT disk_read ( #endif // _DISKIO_IOCTL #endif // SD_CONNECTION_IS(ONBOARD) +#endif // __STM32F1__