diff --git a/Marlin/src/HAL/AVR/MarlinSerial.cpp b/Marlin/src/HAL/AVR/MarlinSerial.cpp index 7cd4446987..8f82b7b418 100644 --- a/Marlin/src/HAL/AVR/MarlinSerial.cpp +++ b/Marlin/src/HAL/AVR/MarlinSerial.cpp @@ -582,7 +582,8 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser); template class MarlinSerial< MarlinSerialCfg >; MSerialT2 customizedSerial2(MSerialT2::HasEmergencyParser); -#endif + +#endif // SERIAL_PORT_2 #ifdef MMU2_SERIAL_PORT @@ -596,7 +597,8 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser); template class MarlinSerial< MMU2SerialCfg >; MSerialT3 mmuSerial(MSerialT3::HasEmergencyParser); -#endif + +#endif // MMU2_SERIAL_PORT #ifdef LCD_SERIAL_PORT @@ -622,7 +624,7 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser); } #endif -#endif +#endif // LCD_SERIAL_PORT #endif // !USBCON && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) diff --git a/Marlin/src/HAL/LPC1768/HAL_MinSerial.cpp b/Marlin/src/HAL/LPC1768/HAL_MinSerial.cpp index ab9af1fe00..57065c49ac 100644 --- a/Marlin/src/HAL/LPC1768/HAL_MinSerial.cpp +++ b/Marlin/src/HAL/LPC1768/HAL_MinSerial.cpp @@ -21,6 +21,7 @@ */ #ifdef TARGET_LPC1768 +#include "../../inc/MarlinConfig.h" #include "HAL.h" #if ENABLED(POSTMORTEM_DEBUGGING) diff --git a/Marlin/src/HAL/STM32/timers.h b/Marlin/src/HAL/STM32/timers.h index 4649824303..7a35e43210 100644 --- a/Marlin/src/HAL/STM32/timers.h +++ b/Marlin/src/HAL/STM32/timers.h @@ -21,15 +21,12 @@ */ #pragma once -#include #include "../../inc/MarlinConfig.h" // ------------------------ // Defines // ------------------------ -#define FORCE_INLINE __attribute__((always_inline)) inline - // STM32 timers may be 16 or 32 bit. Limiting HAL_TIMER_TYPE_MAX to 16 bits // avoids issues with STM32F0 MCUs, which seem to pause timers if UINT32_MAX // is written to the register. STM32F4 timers do not manifest this issue, diff --git a/Marlin/src/HAL/STM32F1/timers.h b/Marlin/src/HAL/STM32F1/timers.h index 3e2e7775f1..63ddfb9e60 100644 --- a/Marlin/src/HAL/STM32F1/timers.h +++ b/Marlin/src/HAL/STM32F1/timers.h @@ -25,9 +25,10 @@ * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) */ -#include +#include "../../inc/MarlinConfig.h" +#include "HAL.h" + #include -#include "../../core/boards.h" // ------------------------ // Defines @@ -37,7 +38,6 @@ * TODO: Check and confirm what timer we will use for each Temps and stepper driving. * We should probable drive temps with PWM. */ -#define FORCE_INLINE __attribute__((always_inline)) inline typedef uint16_t hal_timer_t; #define HAL_TIMER_TYPE_MAX 0xFFFF diff --git a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp index 21330eaac1..b6f01e6c0e 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp @@ -21,11 +21,12 @@ */ #ifdef __MK20DX256__ +#include "../../inc/MarlinConfig.h" #include "HAL.h" + #include #include #include "spi_pins.h" -#include "../../core/macros.h" static SPISettings spiConfig; diff --git a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp index 5b22668fce..28bca65af5 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp @@ -26,11 +26,12 @@ #if defined(__MK64FX512__) || defined(__MK66FX1M0__) +#include "../../inc/MarlinConfig.h" #include "HAL.h" + #include #include #include "spi_pins.h" -#include "../../core/macros.h" static SPISettings spiConfig; diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.cpp b/Marlin/src/HAL/TEENSY40_41/HAL.cpp index a986c293a9..ccc8c2659c 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.cpp +++ b/Marlin/src/HAL/TEENSY40_41/HAL.cpp @@ -26,10 +26,11 @@ #ifdef __IMXRT1062__ +#include "../../inc/MarlinConfig.h" #include "HAL.h" + #include "../shared/Delay.h" #include "timers.h" - #include #define _IMPLEMENT_SERIAL(X) DefaultSerial##X MSerial##X(false, Serial##X) diff --git a/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp index e4335ff74f..7e202d724e 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp @@ -26,11 +26,12 @@ #ifdef __IMXRT1062__ +#include "../../inc/MarlinConfig.h" #include "HAL.h" + #include #include #include "spi_pins.h" -#include "../../core/macros.h" static SPISettings spiConfig; diff --git a/Marlin/src/HAL/shared/Marduino.h b/Marlin/src/HAL/shared/Marduino.h index d0ee6ecc9d..56be8d7211 100644 --- a/Marlin/src/HAL/shared/Marduino.h +++ b/Marlin/src/HAL/shared/Marduino.h @@ -82,4 +82,8 @@ #define UNUSED(x) ((void)(x)) #endif +#ifndef FORCE_INLINE + #define FORCE_INLINE inline __attribute__((always_inline)) +#endif + #include "progmem.h" diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index dfa0adba1b..c090b7e37b 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -34,8 +34,8 @@ #include "../HAL/platforms.h" #endif -#include "../core/boards.h" #include "../core/macros.h" +#include "../core/boards.h" #include "../../Configuration.h" #ifdef CUSTOM_VERSION_FILE diff --git a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp index 8833423b37..2abec905cb 100644 --- a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp @@ -26,19 +26,16 @@ #include "../DGUSScreenHandler.h" +#include "../../../../../inc/MarlinConfig.h" + #include "../../../../../MarlinCore.h" -#include "../../../../../gcode/queue.h" -#include "../../../../../libs/duration_t.h" #include "../../../../../module/settings.h" #include "../../../../../module/temperature.h" #include "../../../../../module/motion.h" #include "../../../../../module/planner.h" #include "../../../../../module/printcounter.h" -#include "../../../../../sd/cardreader.h" #include "../../../../../gcode/gcode.h" -#include "../../../../../pins/pins.h" -#include "../../../../../libs/nozzle.h" #if ENABLED(HAS_STEALTHCHOP) #include "../../../../../module/stepper/trinamic.h" diff --git a/Marlin/src/libs/softspi.h b/Marlin/src/libs/softspi.h index fb02de8653..cc36d658cd 100644 --- a/Marlin/src/libs/softspi.h +++ b/Marlin/src/libs/softspi.h @@ -25,11 +25,7 @@ // Based on https://github.com/niteris/ArduinoSoftSpi // -#include "../HAL/shared/Marduino.h" - -#ifndef FORCE_INLINE - #define FORCE_INLINE inline __attribute__((always_inline)) -#endif +#include "../HAL/shared/Marduino.h" // CORE_TEENSY #define nop __asm__ volatile ("nop") // NOP for timing