Skip to content

Commit 76c10b3

Browse files
authored
🏗️ Define HAL_STM32 for HAL/STM32 (#22537)
1 parent 331cc5f commit 76c10b3

34 files changed

+105
-57
lines changed

Marlin/src/HAL/STM32/HAL.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*
2222
*/
23-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) && !defined(MAPLE_STM32F1)
23+
#include "../platforms.h"
24+
25+
#ifdef HAL_STM32
2426

2527
#include "HAL.h"
2628
#include "usb_serial.h"
@@ -165,4 +167,4 @@ void HAL_SYSTICK_Callback() {
165167
if (systick_user_callback) systick_user_callback();
166168
}
167169

168-
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC && !MAPLE_STM32F1
170+
#endif // HAL_STM32

Marlin/src/HAL/STM32/HAL_MinSerial.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*
2222
*/
23-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) && !defined(MAPLE_STM32F1)
23+
#include "../platforms.h"
24+
25+
#ifdef HAL_STM32
2426

2527
#include "../../inc/MarlinConfigPre.h"
2628

@@ -149,4 +151,4 @@ extern "C" {
149151
#endif
150152

151153
#endif // POSTMORTEM_DEBUGGING
152-
#endif // ARDUINO_ARCH_STM32
154+
#endif // HAL_STM32

Marlin/src/HAL/STM32/HAL_SPI.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*
2222
*/
23-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) && !defined(MAPLE_STM32F1)
23+
#include "../platforms.h"
24+
25+
#ifdef HAL_STM32
2426

2527
#include "../../inc/MarlinConfig.h"
2628

@@ -224,4 +226,4 @@ static SPISettings spiConfig;
224226

225227
#endif // SOFTWARE_SPI
226228

227-
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC && !MAPLE_STM32F1
229+
#endif // HAL_STM32

Marlin/src/HAL/STM32/MarlinSPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) && !defined(MAPLE_STM32F1) && !defined(STM32H7xx)
22+
#if defined(HAL_STM32) && !defined(STM32H7xx)
2323

2424
#include "MarlinSPI.h"
2525

@@ -165,4 +165,4 @@ uint8_t MarlinSPI::dmaSend(const void * transmitBuf, uint16_t length, bool minc)
165165
return 1;
166166
}
167167

168-
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC && !MAPLE_STM32F1 && !STM32H7xx
168+
#endif // HAL_STM32 && !STM32H7xx

Marlin/src/HAL/STM32/MarlinSerial.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*
1818
*/
19-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) && !defined(MAPLE_STM32F1)
19+
#include "../platforms.h"
20+
21+
#ifdef HAL_STM32
2022

2123
#include "../../inc/MarlinConfig.h"
2224
#include "MarlinSerial.h"
@@ -101,4 +103,4 @@ void MarlinSerial::_rx_complete_irq(serial_t *obj) {
101103
}
102104
}
103105

104-
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC && !MAPLE_STM32F1
106+
#endif // HAL_STM32

Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) && !defined(MAPLE_STM32F1)
22+
#include "../platforms.h"
23+
24+
#ifdef HAL_STM32
2325

2426
#include "../../inc/MarlinConfig.h"
2527

@@ -320,4 +322,4 @@ extern "C" void SDIO_IRQHandler(void) { HAL_SD_IRQHandler(&hsd); }
320322
extern "C" void DMA_IRQ_HANDLER(void) { HAL_DMA_IRQHandler(&hdma_sdio); }
321323

322324
#endif // SDIO_SUPPORT
323-
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC && !MAPLE_STM32F1
325+
#endif // HAL_STM32

Marlin/src/HAL/STM32/Servo.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*
2222
*/
23-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) && !defined(MAPLE_STM32F1)
23+
#include "../platforms.h"
24+
25+
#ifdef HAL_STM32
2426

2527
#include "../../inc/MarlinConfig.h"
2628

@@ -107,4 +109,4 @@ void libServo::setInterruptPriority(uint32_t preemptPriority, uint32_t subPriori
107109
}
108110

109111
#endif // HAS_SERVOS
110-
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC && !MAPLE_STM32F1
112+
#endif // HAL_STM32

Marlin/src/HAL/STM32/eeprom_flash.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*
2222
*/
23-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) && !defined(MAPLE_STM32F1)
23+
#include "../platforms.h"
24+
25+
#ifdef HAL_STM32
2426

2527
#include "../../inc/MarlinConfig.h"
2628

@@ -272,4 +274,4 @@ bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t
272274
}
273275

274276
#endif // FLASH_EEPROM_EMULATION
275-
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC && !MAPLE_STM32F1
277+
#endif // HAL_STM32

Marlin/src/HAL/STM32/eeprom_sdcard.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) && !defined(MAPLE_STM32F1)
22+
#include "../platforms.h"
23+
24+
#ifdef HAL_STM32
2325

2426
/**
2527
* Implementation of EEPROM settings in SD Card
@@ -88,4 +90,4 @@ bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uin
8890
}
8991

9092
#endif // SDCARD_EEPROM_EMULATION
91-
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC && !MAPLE_STM32F1
93+
#endif // HAL_STM32

Marlin/src/HAL/STM32/eeprom_sram.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*
2222
*/
23-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) && !defined(MAPLE_STM32F1)
23+
#include "../platforms.h"
24+
25+
#ifdef HAL_STM32
2426

2527
#include "../../inc/MarlinConfig.h"
2628

@@ -65,4 +67,4 @@ bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t
6567
}
6668

6769
#endif // SRAM_EEPROM_EMULATION
68-
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC && !MAPLE_STM32F1
70+
#endif // HAL_STM32

0 commit comments

Comments
 (0)