🧑‍💻 Change HAL_PATH macro for easier HAL relocation (#25743)

This commit is contained in:
Scott Lahteine 2023-04-26 14:29:21 -05:00 committed by GitHub
parent 1771d7ab64
commit d364babbc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 36 additions and 35 deletions

View file

@ -27,7 +27,7 @@
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#endif
#include HAL_PATH(.,HAL.h)
#include HAL_PATH(..,HAL.h)
extern MarlinHAL hal;
#define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)

View file

@ -24,34 +24,34 @@
#define XSTR(V...) #V
#ifdef __AVR__
#define HAL_PATH(PATH, NAME) XSTR(PATH/AVR/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/AVR/NAME)
#elif defined(ARDUINO_ARCH_SAM)
#define HAL_PATH(PATH, NAME) XSTR(PATH/DUE/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/DUE/NAME)
#elif defined(__MK20DX256__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/TEENSY31_32/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/TEENSY31_32/NAME)
#elif defined(__MK64FX512__) || defined(__MK66FX1M0__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/TEENSY35_36/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/TEENSY35_36/NAME)
#elif defined(__IMXRT1062__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/TEENSY40_41/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/TEENSY40_41/NAME)
#elif defined(TARGET_LPC1768)
#define HAL_PATH(PATH, NAME) XSTR(PATH/LPC1768/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/LPC1768/NAME)
#elif defined(__STM32F1__) || defined(TARGET_STM32F1)
#define HAL_PATH(PATH, NAME) XSTR(PATH/STM32F1/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/STM32F1/NAME)
#elif defined(ARDUINO_ARCH_STM32)
#ifndef HAL_STM32
#define HAL_STM32
#endif
#define HAL_PATH(PATH, NAME) XSTR(PATH/STM32/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/STM32/NAME)
#elif defined(ARDUINO_ARCH_ESP32)
#define HAL_PATH(PATH, NAME) XSTR(PATH/ESP32/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/ESP32/NAME)
#elif defined(__PLAT_LINUX__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/LINUX/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/LINUX/NAME)
#elif defined(__PLAT_NATIVE_SIM__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/NATIVE_SIM/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/NATIVE_SIM/NAME)
#elif defined(__SAMD51__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/SAMD51/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/SAMD51/NAME)
#elif defined(__SAMD21__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/SAMD21/NAME)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/SAMD21/NAME)
#else
#error "Unsupported Platform!"
#endif

View file

@ -34,21 +34,21 @@
#include "../pins/pins.h"
#ifndef __MARLIN_DEPS__
#include HAL_PATH(../HAL, timers.h)
#include HAL_PATH(../HAL, spi_pins.h)
#include HAL_PATH(.., timers.h)
#include HAL_PATH(.., spi_pins.h)
#endif
#include "Conditionals_post.h"
#ifndef __MARLIN_DEPS__
#include HAL_PATH(../HAL, inc/Conditionals_post.h)
#include HAL_PATH(.., inc/Conditionals_post.h)
#include "../core/types.h" // Ahead of sanity-checks
#include "Changes.h"
#include "SanityCheck.h"
#include HAL_PATH(../HAL, inc/SanityCheck.h)
#include HAL_PATH(.., inc/SanityCheck.h)
// Include all core headers
#include "../core/language.h"

View file

@ -49,7 +49,7 @@
#include "Conditionals_LCD.h"
#ifndef __MARLIN_DEPS__
#include HAL_PATH(../HAL, inc/Conditionals_LCD.h)
#include HAL_PATH(.., inc/Conditionals_LCD.h)
#endif
#include "../core/drivers.h"
@ -58,5 +58,5 @@
#include "Conditionals_adv.h"
#ifndef __MARLIN_DEPS__
#include HAL_PATH(../HAL, inc/Conditionals_adv.h)
#include HAL_PATH(.., inc/Conditionals_adv.h)
#endif

View file

@ -38,7 +38,7 @@
#include "../../../MarlinCore.h"
#include "../../../inc/MarlinConfig.h"
#include HAL_PATH(../../../HAL, tft/xpt2046.h)
#include HAL_PATH(../../.., tft/xpt2046.h)
#include "../../marlinui.h"
XPT2046 touch;

View file

@ -31,10 +31,10 @@
#endif
#if ENABLED(TFT_TOUCH_DEVICE_GT911)
#include HAL_PATH(../../HAL, tft/gt911.h)
#include HAL_PATH(../.., tft/gt911.h)
#define TOUCH_DRIVER_CLASS GT911
#elif ENABLED(TFT_TOUCH_DEVICE_XPT2046)
#include HAL_PATH(../../HAL, tft/xpt2046.h)
#include HAL_PATH(../.., tft/xpt2046.h)
#define TOUCH_DRIVER_CLASS XPT2046
#else
#error "Unknown Touch Screen Type."

View file

@ -24,11 +24,11 @@
#include "../../inc/MarlinConfig.h"
#if HAS_SPI_TFT
#include HAL_PATH(../../HAL, tft/tft_spi.h)
#include HAL_PATH(../.., tft/tft_spi.h)
#elif HAS_FSMC_TFT
#include HAL_PATH(../../HAL, tft/tft_fsmc.h)
#include HAL_PATH(../.., tft/tft_fsmc.h)
#elif HAS_LTDC_TFT
#include HAL_PATH(../../HAL, tft/tft_ltdc.h)
#include HAL_PATH(../.., tft/tft_ltdc.h)
#else
#error "TFT IO only supports SPI, FSMC or LTDC interface."
#endif

View file

@ -28,10 +28,10 @@
#include "../scaled_tft.h"
#if ENABLED(TFT_TOUCH_DEVICE_GT911)
#include HAL_PATH(../../HAL, tft/gt911.h)
#include HAL_PATH(../.., tft/gt911.h)
GT911 touchIO;
#elif ENABLED(TFT_TOUCH_DEVICE_XPT2046)
#include HAL_PATH(../../HAL, tft/xpt2046.h)
#include HAL_PATH(../.., tft/xpt2046.h)
XPT2046 touchIO;
#else
#error "Unknown Touch Screen Type."

View file

@ -45,7 +45,7 @@
#include "../inc/MarlinConfig.h"
#include "../HAL/shared/Delay.h"
#include HAL_PATH(../HAL, MarlinSPI.h)
#include HAL_PATH(.., MarlinSPI.h)
#define MAX31865_CONFIG_REG 0x00
#define MAX31865_CONFIG_BIAS 0x80

View file

@ -23,7 +23,7 @@
#include <stdint.h>
#include HAL_PATH(../HAL, MarlinSPI.h)
#include HAL_PATH(.., MarlinSPI.h)
#define W25X_WriteEnable 0x06
#define W25X_WriteDisable 0x04

View file

@ -35,7 +35,7 @@
#include "../core/debug_out.h"
#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
#include HAL_PATH(../HAL, endstop_interrupts.h)
#include HAL_PATH(.., endstop_interrupts.h)
#endif
#if BOTH(SD_ABORT_ON_ENDSTOP_HIT, HAS_MEDIA)

View file

@ -3985,7 +3985,7 @@ void Stepper::report_positions() {
#else // PRINTRBOARD_G2
#include HAL_PATH(../HAL, fastio/G2_PWM.h)
#include HAL_PATH(.., fastio/G2_PWM.h)
#endif

View file

@ -168,7 +168,7 @@ const PinInfo pin_array[] PROGMEM = {
};
#include HAL_PATH(../HAL, pinsDebug.h) // get the correct support file for this CPU
#include HAL_PATH(.., pinsDebug.h) // get the correct support file for this CPU
#ifndef M43_NEVER_TOUCH
#define M43_NEVER_TOUCH(Q) false

View file

@ -84,10 +84,10 @@
#elif ENABLED(USE_OTG_USB_HOST)
#if HAS_SD_HOST_DRIVE
#include HAL_PATH(../../HAL, msc_sd.h)
#include HAL_PATH(../.., msc_sd.h)
#endif
#include HAL_PATH(../../HAL, usb_host.h)
#include HAL_PATH(../.., usb_host.h)
#define UHS_START usb.start()
#define rREVISION 0

View file

@ -248,3 +248,4 @@ HAS_MICROSTEPS = src_filter=+<src/gcode/control/M350_M35
arduinoWebSockets=links2004/WebSockets@2.3.4
luc-github/ESP32SSDP@1.1.1
lib_ignore=ESPAsyncTCP
build_flags=-DSRCHOME=${platformio.src_dir}/src -DHALHOME=SRCHOME