From db90a180c24dfcc37e6dd88e8520c9b4d26a69b7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 5 May 2021 06:32:54 -0500 Subject: [PATCH] Cleanup, hex formatting, includes --- Marlin/src/HAL/AVR/MarlinSerial.cpp | 8 +++++--- Marlin/src/HAL/LPC1768/HAL_MinSerial.cpp | 1 + Marlin/src/HAL/STM32/timers.h | 3 --- Marlin/src/HAL/STM32F1/timers.h | 6 +++--- Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp | 3 ++- Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp | 3 ++- Marlin/src/HAL/TEENSY40_41/HAL.cpp | 3 ++- Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp | 3 ++- Marlin/src/HAL/shared/Marduino.h | 4 ++++ Marlin/src/inc/MarlinConfigPre.h | 2 +- Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp | 7 ++----- Marlin/src/libs/softspi.h | 6 +----- 12 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Marlin/src/HAL/AVR/MarlinSerial.cpp b/Marlin/src/HAL/AVR/MarlinSerial.cpp index 7cd444698..8f82b7b41 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 ab9af1fe0..57065c49a 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 464982430..7a35e4321 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 3e2e7775f..63ddfb9e6 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 21330eaac..b6f01e6c0 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 5b22668fc..28bca65af 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 a986c293a..ccc8c2659 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 e4335ff74..7e202d724 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 d0ee6ecc9..56be8d721 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 dfa0adba1..c090b7e37 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 8833423b3..2abec905c 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 fb02de865..cc36d658c 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