From fa107db77b9643f7df504c50caf9aec9fd24a769 Mon Sep 17 00:00:00 2001 From: Victor Mateus Oliveira Date: Mon, 21 Sep 2020 16:27:38 -0300 Subject: [PATCH] board target defines --- Marlin/src/pins/ramps/pins_RAMPS.h | 13 +++++++++---- .../share/PlatformIO/scripts/common-dependencies.h | 12 ++++++++---- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index e32c79afa9ddb..01a490ec9e9a5 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -45,10 +45,12 @@ * 7 | 11 */ -#ifdef TARGET_LPC1768 - #error "Oops! Set MOTHERBOARD to an LPC1768-based board when building for LPC1768." -#elif defined(__STM32F1__) - #error "Oops! Set MOTHERBOARD to an STM32F1-based board when building for STM32F1." +#ifndef __PREBUILD_SCRIPT_RUNNING__ + #ifdef TARGET_LPC1768 + #error "Oops! Set MOTHERBOARD to an LPC1768-based board when building for LPC1768." + #elif defined(__STM32F1__) + #error "Oops! Set MOTHERBOARD to an STM32F1-based board when building for STM32F1." + #endif #endif #if NONE(IS_RAMPS_SMART, IS_RAMPS_DUO, IS_RAMPS4DUE, TARGET_LPC1768) @@ -764,3 +766,6 @@ #define CLCD_MOD_RESET 31 #define CLCD_SPI_CS 33 #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050 + + +#define BOARD_CUSTOM_BUILD_FLAGS -DFOO diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.h b/buildroot/share/PlatformIO/scripts/common-dependencies.h index 148ba7744e3a8..0cbb94ca7469d 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.h +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.h @@ -151,14 +151,20 @@ #endif // define all platform macros to include pins file +#define __PREBUILD_SCRIPT_RUNNING__ #define ARDUINO_GRAND_CENTRAL_M4 #define __AVR_ATmega1280__ +#define __AVR_ATmega2560__ +#define __AVR_ATmega644P__ +#define __AVR_ATmega1284P__ #define __AVR__ #define ARDUINO_ARCH_SAM #define __MK20DX256__ #define __MK64FX512__ #define __MK66FX1M0__ #define __IMXRT1062__ +#define IS_32BIT_TEENSY 1 +#define IS_TEENSY32 1 #define STM32GENERIC #define STM32F4 #define STM32F7 @@ -168,8 +174,6 @@ #define __SAMD51__ #define MCU_LPC1769 #define MCU_LPC1768 -#if !MB(RAMPS_14_EFB) - #define TARGET_LPC1768 - #define __STM32F1__ -#endif +#define TARGET_LPC1768 +#define __STM32F1__ #include "../../../../Marlin/src/pins/pins.h"