From e5d73f68c8f428d3ce9ba350123bb71b9ec18708 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 28 Jul 2019 23:55:24 -0500 Subject: [PATCH] HAL folder organization (#14763) --- Marlin/src/HAL/HAL.h | 30 +------- .../HAL/HAL_AVR/{ => fastio}/fastio_1280.h | 2 +- .../HAL/HAL_AVR/{ => fastio}/fastio_1281.h | 2 +- .../src/HAL/HAL_AVR/{ => fastio}/fastio_168.h | 2 +- .../src/HAL/HAL_AVR/{ => fastio}/fastio_644.h | 2 +- .../HAL/HAL_AVR/{ => fastio}/fastio_AT90USB.h | 2 +- Marlin/src/HAL/HAL_AVR/fastio_AVR.h | 16 ++-- Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h | 22 ++++++ Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h | 22 ++++++ .../src/HAL/HAL_AVR/inc/Conditionals_post.h | 22 ++++++ .../src/HAL/HAL_AVR/{ => inc}/SanityCheck.h | 0 .../u8g_com_HAL_DUE_shared_hw_spi.cpp | 75 +++++++++---------- .../u8g_com_HAL_DUE_st7920_sw_spi.cpp | 8 +- .../{ => dogm}/u8g_com_HAL_DUE_sw_spi.cpp | 6 +- .../u8g_com_HAL_DUE_sw_spi_shared.cpp | 4 +- .../u8g_com_HAL_DUE_sw_spi_shared.h | 4 +- .../src/HAL/HAL_DUE/{ => fastio}/G2_PWM.cpp | 2 +- Marlin/src/HAL/HAL_DUE/{ => fastio}/G2_PWM.h | 4 +- Marlin/src/HAL/HAL_DUE/{ => fastio}/G2_pins.h | 0 Marlin/src/HAL/HAL_DUE/fastio_Due.h | 2 +- Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h | 22 ++++++ Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h | 22 ++++++ .../src/HAL/HAL_DUE/inc/Conditionals_post.h | 22 ++++++ .../src/HAL/HAL_DUE/{ => inc}/SanityCheck.h | 0 .../src/HAL/HAL_ESP32/inc/Conditionals_LCD.h | 22 ++++++ .../src/HAL/HAL_ESP32/inc/Conditionals_adv.h | 22 ++++++ .../src/HAL/HAL_ESP32/inc/Conditionals_post.h | 22 ++++++ .../src/HAL/HAL_ESP32/{ => inc}/SanityCheck.h | 0 .../src/HAL/HAL_LINUX/inc/Conditionals_LCD.h | 22 ++++++ .../src/HAL/HAL_LINUX/inc/Conditionals_adv.h | 22 ++++++ .../src/HAL/HAL_LINUX/inc/Conditionals_post.h | 22 ++++++ .../src/HAL/HAL_LINUX/{ => inc}/SanityCheck.h | 0 .../HAL/HAL_LPC1768/inc/Conditionals_LCD.h | 22 ++++++ .../HAL/HAL_LPC1768/inc/Conditionals_adv.h | 22 ++++++ .../HAL/HAL_LPC1768/inc/Conditionals_post.h | 22 ++++++ .../HAL/HAL_LPC1768/{ => inc}/SanityCheck.h | 0 .../src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h | 22 ++++++ .../src/HAL/HAL_SAMD51/inc/Conditionals_adv.h | 22 ++++++ .../HAL/HAL_SAMD51/inc/Conditionals_post.h | 22 ++++++ .../HAL/HAL_SAMD51/{ => inc}/SanityCheck.h | 0 .../src/HAL/HAL_STM32/inc/Conditionals_LCD.h | 22 ++++++ .../src/HAL/HAL_STM32/inc/Conditionals_adv.h | 22 ++++++ .../src/HAL/HAL_STM32/inc/Conditionals_post.h | 22 ++++++ .../src/HAL/HAL_STM32/{ => inc}/SanityCheck.h | 0 Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h | 4 +- .../{ => dogm}/u8g_com_stm32duino_fsmc.cpp | 12 +-- .../{ => dogm}/u8g_com_stm32duino_swspi.cpp | 4 +- .../HAL/HAL_STM32F1/inc/Conditionals_LCD.h | 22 ++++++ .../HAL/HAL_STM32F1/inc/Conditionals_adv.h | 22 ++++++ .../HAL/HAL_STM32F1/inc/Conditionals_post.h | 22 ++++++ .../HAL/HAL_STM32F1/{ => inc}/SanityCheck.h | 0 .../HAL_STM32_F4_F7/inc/Conditionals_LCD.h | 22 ++++++ .../HAL_STM32_F4_F7/inc/Conditionals_adv.h | 22 ++++++ .../HAL_STM32_F4_F7/inc/Conditionals_post.h | 22 ++++++ .../HAL_STM32_F4_F7/{ => inc}/SanityCheck.h | 0 .../HAL_TEENSY31_32/inc/Conditionals_LCD.h | 22 ++++++ .../HAL_TEENSY31_32/inc/Conditionals_adv.h | 22 ++++++ .../HAL_TEENSY31_32/inc/Conditionals_post.h | 22 ++++++ .../HAL_TEENSY31_32/{ => inc}/SanityCheck.h | 0 .../HAL_TEENSY35_36/inc/Conditionals_LCD.h | 22 ++++++ .../HAL_TEENSY35_36/inc/Conditionals_adv.h | 22 ++++++ .../HAL_TEENSY35_36/inc/Conditionals_post.h | 22 ++++++ .../HAL_TEENSY35_36/{ => inc}/SanityCheck.h | 0 Marlin/src/HAL/platforms.h | 52 +++++++++++++ Marlin/src/inc/MarlinConfig.h | 6 +- Marlin/src/inc/MarlinConfigPre.h | 7 ++ 66 files changed, 865 insertions(+), 107 deletions(-) rename Marlin/src/HAL/HAL_AVR/{ => fastio}/fastio_1280.h (99%) rename Marlin/src/HAL/HAL_AVR/{ => fastio}/fastio_1281.h (99%) rename Marlin/src/HAL/HAL_AVR/{ => fastio}/fastio_168.h (99%) rename Marlin/src/HAL/HAL_AVR/{ => fastio}/fastio_644.h (99%) rename Marlin/src/HAL/HAL_AVR/{ => fastio}/fastio_AT90USB.h (99%) create mode 100644 Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h create mode 100644 Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h create mode 100644 Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h rename Marlin/src/HAL/HAL_AVR/{ => inc}/SanityCheck.h (100%) rename Marlin/src/HAL/HAL_DUE/{ => dogm}/u8g_com_HAL_DUE_shared_hw_spi.cpp (65%) rename Marlin/src/HAL/HAL_DUE/{ => dogm}/u8g_com_HAL_DUE_st7920_sw_spi.cpp (97%) rename Marlin/src/HAL/HAL_DUE/{ => dogm}/u8g_com_HAL_DUE_sw_spi.cpp (97%) rename Marlin/src/HAL/HAL_DUE/{ => dogm}/u8g_com_HAL_DUE_sw_spi_shared.cpp (98%) rename Marlin/src/HAL/HAL_DUE/{ => dogm}/u8g_com_HAL_DUE_sw_spi_shared.h (93%) rename Marlin/src/HAL/HAL_DUE/{ => fastio}/G2_PWM.cpp (99%) rename Marlin/src/HAL/HAL_DUE/{ => fastio}/G2_PWM.h (97%) rename Marlin/src/HAL/HAL_DUE/{ => fastio}/G2_pins.h (100%) create mode 100644 Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h create mode 100644 Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h create mode 100644 Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h rename Marlin/src/HAL/HAL_DUE/{ => inc}/SanityCheck.h (100%) create mode 100644 Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h create mode 100644 Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h create mode 100644 Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h rename Marlin/src/HAL/HAL_ESP32/{ => inc}/SanityCheck.h (100%) create mode 100644 Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h create mode 100644 Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h create mode 100644 Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h rename Marlin/src/HAL/HAL_LINUX/{ => inc}/SanityCheck.h (100%) create mode 100644 Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h create mode 100644 Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h create mode 100644 Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h rename Marlin/src/HAL/HAL_LPC1768/{ => inc}/SanityCheck.h (100%) create mode 100644 Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h create mode 100644 Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h create mode 100644 Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h rename Marlin/src/HAL/HAL_SAMD51/{ => inc}/SanityCheck.h (100%) create mode 100644 Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h create mode 100644 Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h create mode 100644 Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h rename Marlin/src/HAL/HAL_STM32/{ => inc}/SanityCheck.h (100%) rename Marlin/src/HAL/HAL_STM32F1/{ => dogm}/u8g_com_stm32duino_fsmc.cpp (98%) rename Marlin/src/HAL/HAL_STM32F1/{ => dogm}/u8g_com_stm32duino_swspi.cpp (98%) create mode 100644 Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h create mode 100644 Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h create mode 100644 Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h rename Marlin/src/HAL/HAL_STM32F1/{ => inc}/SanityCheck.h (100%) create mode 100644 Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h create mode 100644 Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h create mode 100644 Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h rename Marlin/src/HAL/HAL_STM32_F4_F7/{ => inc}/SanityCheck.h (100%) create mode 100644 Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h create mode 100644 Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h create mode 100644 Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h rename Marlin/src/HAL/HAL_TEENSY31_32/{ => inc}/SanityCheck.h (100%) create mode 100644 Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h create mode 100644 Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h create mode 100644 Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h rename Marlin/src/HAL/HAL_TEENSY35_36/{ => inc}/SanityCheck.h (100%) create mode 100644 Marlin/src/HAL/platforms.h diff --git a/Marlin/src/HAL/HAL.h b/Marlin/src/HAL/HAL.h index 6b6ad03d4..f3946902c 100644 --- a/Marlin/src/HAL/HAL.h +++ b/Marlin/src/HAL/HAL.h @@ -21,34 +21,6 @@ */ #pragma once -#ifdef __AVR__ - #define HAL_PLATFORM HAL_AVR -#elif defined(ARDUINO_ARCH_SAM) - #define HAL_PLATFORM HAL_DUE -#elif defined(__MK20DX256__) - #define HAL_PLATFORM HAL_TEENSY31_32 -#elif defined(__MK64FX512__) || defined(__MK66FX1M0__) - #define HAL_PLATFORM HAL_TEENSY35_36 -#elif defined(TARGET_LPC1768) - #define HAL_PLATFORM HAL_LPC1768 -#elif defined(__STM32F1__) || defined(TARGET_STM32F1) - #define HAL_PLATFORM HAL_STM32F1 -#elif defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) - #define HAL_PLATFORM HAL_STM32_F4_F7 -#elif defined(ARDUINO_ARCH_STM32) - #define HAL_PLATFORM HAL_STM32 -#elif defined(ARDUINO_ARCH_ESP32) - #define HAL_PLATFORM HAL_ESP32 -#elif defined(__PLAT_LINUX__) - #define HAL_PLATFORM HAL_LINUX -#elif defined(__SAMD51__) - #define HAL_PLATFORM HAL_SAMD51 -#else - #error "Unsupported Platform!" -#endif - -#define XSTR_(M) #M -#define XSTR(M) XSTR_(M) -#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL_PLATFORM/NAME) +#include "platforms.h" #include HAL_PATH(.,HAL.h) diff --git a/Marlin/src/HAL/HAL_AVR/fastio_1280.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_1280.h rename to Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h index 84ceffcda..ac2b65011 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_1280.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h @@ -29,7 +29,7 @@ * Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 78 79 80 xx xx 84 85 71 70 xx xx xx xx xx 81 82 83 xx xx 72 72 75 76 77 74 xx xx xx xx xx */ -#include "fastio_AVR.h" +#include "../fastio_AVR.h" // change for your board #define DEBUG_LED DIO21 diff --git a/Marlin/src/HAL/HAL_AVR/fastio_1281.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_1281.h rename to Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h index 153d1fd7d..e3501f484 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_1281.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h @@ -28,7 +28,7 @@ * Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5 */ -#include "fastio_AVR.h" +#include "../fastio_AVR.h" // change for your board #define DEBUG_LED DIO46 diff --git a/Marlin/src/HAL/HAL_AVR/fastio_168.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_168.h rename to Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h index 7e5a1ec79..32db8cae0 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_168.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h @@ -28,7 +28,7 @@ * Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 */ -#include "fastio_AVR.h" +#include "../fastio_AVR.h" #define DEBUG_LED AIO5 diff --git a/Marlin/src/HAL/HAL_AVR/fastio_644.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_644.h rename to Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h index f62a0a35b..582c76f7e 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_644.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h @@ -54,7 +54,7 @@ * +--------+ */ -#include "fastio_AVR.h" +#include "../fastio_AVR.h" #define DEBUG_LED DIO0 diff --git a/Marlin/src/HAL/HAL_AVR/fastio_AT90USB.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_AT90USB.h rename to Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h index c7bf5f6b5..bd37f0599 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_AT90USB.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h @@ -29,7 +29,7 @@ * The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3 */ -#include "fastio_AVR.h" +#include "../fastio_AVR.h" // change for your board #define DEBUG_LED DIO31 /* led D5 red */ diff --git a/Marlin/src/HAL/HAL_AVR/fastio_AVR.h b/Marlin/src/HAL/HAL_AVR/fastio_AVR.h index 1f2e820bd..501a7cdf0 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_AVR.h +++ b/Marlin/src/HAL/HAL_AVR/fastio_AVR.h @@ -27,8 +27,6 @@ * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al. */ -#include "../../core/macros.h" - #include #define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__) || defined(__AVR_AT90USB647__)) @@ -41,15 +39,15 @@ * Include Ports and Functions */ #if AVR_ATmega328_FAMILY - #include "fastio_168.h" + #include "fastio/fastio_168.h" #elif AVR_ATmega1284_FAMILY - #include "fastio_644.h" + #include "fastio/fastio_644.h" #elif AVR_ATmega2560_FAMILY - #include "fastio_1280.h" + #include "fastio/fastio_1280.h" #elif AVR_AT90USB1286_FAMILY - #include "fastio_AT90USB.h" + #include "fastio/fastio_AT90USB.h" #elif AVR_ATmega2561_FAMILY - #include "fastio_1281.h" + #include "fastio/fastio_1281.h" #else #error "No FastIO definition for the selected AVR Board." #endif @@ -274,6 +272,8 @@ enum ClockSource2 : char { #define SET_FOCB(T,V) SET_FOC(T,B,V) #define SET_FOCC(T,V) SET_FOC(T,C,V) +#if 0 + /** * PWM availability macros */ @@ -337,6 +337,8 @@ enum ClockSource2 : char { #define PWM_CHK(P) (PWM_CHK_HEATER(P) || PWM_CHK_SERVO(P) || PWM_CHK_MOTOR_CURRENT(P) || PWM_CHK_FAN_A(P) || PWM_CHK_FAN_B(P)) +#endif // PWM_CHK is not used in Marlin + // define which hardware PWMs are available for the current CPU // all timer 1 PWMS deleted from this list because they are never available #if AVR_ATmega2560_FAMILY diff --git a/Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_AVR/SanityCheck.h b/Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_AVR/SanityCheck.h rename to Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp similarity index 65% rename from Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp rename to Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp index f90d24dae..8f9f74572 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp +++ b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp @@ -21,58 +21,57 @@ */ -/* - - based on u8g_com_msp430_hw_spi.c - - Universal 8bit Graphics Library - - Copyright (c) 2012, olikraus@gmail.com - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list - of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or other - materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ +/** + * Based on u8g_com_msp430_hw_spi.c + * + * Universal 8bit Graphics Library + * + * Copyright (c) 2012, olikraus@gmail.com + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list + * of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ #ifdef __SAM3X8E__ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_GRAPHICAL_LCD #include -#include "../../Marlin.h" +#include "../../../Marlin.h" void spiBegin(); void spiInit(uint8_t spiRate); void spiSend(uint8_t b); void spiSend(const uint8_t* buf, size_t n); -#include "../shared/Marduino.h" -#include "fastio_Due.h" +#include "../../shared/Marduino.h" +#include "../fastio_Due.h" void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) { PIO_Configure(g_APinDescription[u8g->pin_list[pin_index]].pPort, PIO_OUTPUT_1, diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp similarity index 97% rename from Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp rename to Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp index 8af460954..47e56fddb 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp @@ -55,11 +55,11 @@ #ifdef ARDUINO_ARCH_SAM -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if ENABLED(U8GLIB_ST7920) -#include "../shared/Delay.h" +#include "../../shared/Delay.h" #include @@ -145,8 +145,8 @@ uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va } #if ENABLED(LIGHTWEIGHT_UI) - #include "../../lcd/ultralcd.h" - #include "../shared/HAL_ST7920.h" + #include "../../../lcd/ultralcd.h" + #include "../../shared/HAL_ST7920.h" #define ST7920_CS_PIN LCD_PINS_RS diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi.cpp b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp similarity index 97% rename from Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi.cpp rename to Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp index c7929c5c1..e078bc420 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi.cpp +++ b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp @@ -55,7 +55,7 @@ #ifdef ARDUINO_ARCH_SAM -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_GRAPHICAL_LCD && DISABLED(U8GLIB_ST7920) @@ -64,8 +64,8 @@ #include "u8g_com_HAL_DUE_sw_spi_shared.h" -#include "../shared/Marduino.h" -#include "../shared/Delay.h" +#include "../../shared/Marduino.h" +#include "../../shared/Delay.h" #include diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.cpp b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp similarity index 98% rename from Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.cpp rename to Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp index 673ef4fac..d3609f60e 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.cpp +++ b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp @@ -55,11 +55,11 @@ #ifdef ARDUINO_ARCH_SAM -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_GRAPHICAL_LCD -#include "../shared/Delay.h" +#include "../../shared/Delay.h" #include diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.h b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h similarity index 93% rename from Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.h rename to Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h index a7e2432d9..f1cdbba29 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.h +++ b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h @@ -21,8 +21,8 @@ */ #pragma once -#include "../../inc/MarlinConfigPre.h" -#include "../shared/Marduino.h" +#include "../../../inc/MarlinConfigPre.h" +#include "../../shared/Marduino.h" void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index); void u8g_SetPILevel_DUE(u8g_t *u8g, uint8_t pin_index, uint8_t level); diff --git a/Marlin/src/HAL/HAL_DUE/G2_PWM.cpp b/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp similarity index 99% rename from Marlin/src/HAL/HAL_DUE/G2_PWM.cpp rename to Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp index 1e08332a4..4afd83ad4 100644 --- a/Marlin/src/HAL/HAL_DUE/G2_PWM.cpp +++ b/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp @@ -40,7 +40,7 @@ * Some jitter in the Vref signal is OK so the interrupt priority is left at its default value. */ -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if MB(PRINTRBOARD_G2) diff --git a/Marlin/src/HAL/HAL_DUE/G2_PWM.h b/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h similarity index 97% rename from Marlin/src/HAL/HAL_DUE/G2_PWM.h rename to Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h index 8086648bc..4a84dfe64 100644 --- a/Marlin/src/HAL/HAL_DUE/G2_PWM.h +++ b/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h @@ -26,8 +26,8 @@ * PR #7500. It is hardwired for the PRINTRBOARD_G2 Motor Current needs. */ -#include "../../inc/MarlinConfigPre.h" -#include "../../module/stepper.h" +#include "../../../inc/MarlinConfigPre.h" +#include "../../../module/stepper.h" //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\module\stepper.h //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\HAL\HAL_DUE\G2_PWM.h diff --git a/Marlin/src/HAL/HAL_DUE/G2_pins.h b/Marlin/src/HAL/HAL_DUE/fastio/G2_pins.h similarity index 100% rename from Marlin/src/HAL/HAL_DUE/G2_pins.h rename to Marlin/src/HAL/HAL_DUE/fastio/G2_pins.h diff --git a/Marlin/src/HAL/HAL_DUE/fastio_Due.h b/Marlin/src/HAL/HAL_DUE/fastio_Due.h index 576e8536b..2bcd604ae 100644 --- a/Marlin/src/HAL/HAL_DUE/fastio_Due.h +++ b/Marlin/src/HAL/HAL_DUE/fastio_Due.h @@ -77,7 +77,7 @@ #if MB(PRINTRBOARD_G2) - #include "G2_pins.h" + #include "fastio/G2_pins.h" // Set pin as input #define _SET_INPUT(IO) do{ \ diff --git a/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_DUE/SanityCheck.h b/Marlin/src/HAL/HAL_DUE/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_DUE/SanityCheck.h rename to Marlin/src/HAL/HAL_DUE/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_ESP32/SanityCheck.h b/Marlin/src/HAL/HAL_ESP32/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_ESP32/SanityCheck.h rename to Marlin/src/HAL/HAL_ESP32/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LINUX/SanityCheck.h b/Marlin/src/HAL/HAL_LINUX/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_LINUX/SanityCheck.h rename to Marlin/src/HAL/HAL_LINUX/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h b/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_LPC1768/SanityCheck.h rename to Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_SAMD51/SanityCheck.h b/Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_SAMD51/SanityCheck.h rename to Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32/SanityCheck.h b/Marlin/src/HAL/HAL_STM32/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32/SanityCheck.h rename to Marlin/src/HAL/HAL_STM32/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h b/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h index c69f0872b..2ff195d48 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h +++ b/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h @@ -23,8 +23,8 @@ #include "../shared/Marduino.h" -#include "libmaple/sdio.h" -#include "libmaple/dma.h" +#include +#include // ------------------------ // Defines diff --git a/Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_fsmc.cpp b/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp similarity index 98% rename from Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_fsmc.cpp rename to Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp index 0bcbe4169..de1e42ddf 100644 --- a/Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_fsmc.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp @@ -26,17 +26,17 @@ * Communication interface for FSMC */ -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if defined(ARDUINO_ARCH_STM32F1) && PIN_EXISTS(FSMC_CS) // FSMC on 100/144 pins SoCs #if HAS_GRAPHICAL_LCD -#include "U8glib.h" -#include "libmaple/fsmc.h" -#include "libmaple/gpio.h" -#include "libmaple/dma.h" -#include "boards.h" +#include +#include +#include +#include +#include #ifndef LCD_READ_ID #define LCD_READ_ID 0x04 // Read display identification information (0xD3 on ILI9341) diff --git a/Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_swspi.cpp b/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp similarity index 98% rename from Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_swspi.cpp rename to Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp index 51d1fac9d..753a5d5e7 100644 --- a/Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_swspi.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp @@ -18,11 +18,11 @@ */ #ifdef __STM32F1__ -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if HAS_GRAPHICAL_LCD && ENABLED(FORCE_SOFT_SPI) -#include "HAL.h" +#include "../HAL.h" #include #undef SPI_SPEED diff --git a/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32F1/SanityCheck.h b/Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32F1/SanityCheck.h rename to Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/SanityCheck.h b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32_F4_F7/SanityCheck.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/SanityCheck.h b/Marlin/src/HAL/HAL_TEENSY31_32/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_TEENSY31_32/SanityCheck.h rename to Marlin/src/HAL/HAL_TEENSY31_32/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h new file mode 100644 index 000000000..85f26f401 --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/SanityCheck.h b/Marlin/src/HAL/HAL_TEENSY35_36/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_TEENSY35_36/SanityCheck.h rename to Marlin/src/HAL/HAL_TEENSY35_36/inc/SanityCheck.h diff --git a/Marlin/src/HAL/platforms.h b/Marlin/src/HAL/platforms.h new file mode 100644 index 000000000..e3e7f52cf --- /dev/null +++ b/Marlin/src/HAL/platforms.h @@ -0,0 +1,52 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifdef __AVR__ + #define HAL_PLATFORM HAL_AVR +#elif defined(ARDUINO_ARCH_SAM) + #define HAL_PLATFORM HAL_DUE +#elif defined(__MK20DX256__) + #define HAL_PLATFORM HAL_TEENSY31_32 +#elif defined(__MK64FX512__) || defined(__MK66FX1M0__) + #define HAL_PLATFORM HAL_TEENSY35_36 +#elif defined(TARGET_LPC1768) + #define HAL_PLATFORM HAL_LPC1768 +#elif defined(__STM32F1__) || defined(TARGET_STM32F1) + #define HAL_PLATFORM HAL_STM32F1 +#elif defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) + #define HAL_PLATFORM HAL_STM32_F4_F7 +#elif defined(ARDUINO_ARCH_STM32) + #define HAL_PLATFORM HAL_STM32 +#elif defined(ARDUINO_ARCH_ESP32) + #define HAL_PLATFORM HAL_ESP32 +#elif defined(__PLAT_LINUX__) + #define HAL_PLATFORM HAL_LINUX +#elif defined(__SAMD51__) + #define HAL_PLATFORM HAL_SAMD51 +#else + #error "Unsupported Platform!" +#endif + +#define XSTR_(M) #M +#define XSTR(M) XSTR_(M) +#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL_PLATFORM/NAME) diff --git a/Marlin/src/inc/MarlinConfig.h b/Marlin/src/inc/MarlinConfig.h index 8e8bf9682..bb974e64d 100644 --- a/Marlin/src/inc/MarlinConfig.h +++ b/Marlin/src/inc/MarlinConfig.h @@ -30,13 +30,13 @@ #include "../HAL/HAL.h" #include "../pins/pins.h" - #include HAL_PATH(../HAL, spi_pins.h) #include "Conditionals_post.h" -#include "SanityCheck.h" +#include HAL_PATH(../HAL, inc/Conditionals_post.h) -#include HAL_PATH(../HAL, SanityCheck.h) +#include "SanityCheck.h" +#include HAL_PATH(../HAL, inc/SanityCheck.h) // Include all core headers #include "../core/enum.h" diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index fa3b93c29..63c5a6095 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -27,12 +27,19 @@ // Prefix header to acquire configurations // +#include "../HAL/platforms.h" + #include "../core/boards.h" #include "../core/macros.h" #include "../core/millis_t.h" #include "Version.h" #include "../../Configuration.h" + #include "Conditionals_LCD.h" +#include HAL_PATH(../HAL, inc/Conditionals_LCD.h) + #include "../core/drivers.h" #include "../../Configuration_adv.h" + #include "Conditionals_adv.h" +#include HAL_PATH(../HAL, inc/Conditionals_adv.h)