From b908e38d084377e445428f1053ce24a2a0e6f6ff Mon Sep 17 00:00:00 2001 From: Christopher Pepper Date: Sat, 26 Aug 2017 21:25:25 +0100 Subject: [PATCH] Add needed platform defined gaurds to compile with Arduino IDE Also removed explicit platform HAL directory inclusion from platformio.ini to make sure these errors are caught by Travis in the future --- Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp | 4 ++++ Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp | 3 ++- Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp | 3 +++ Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp | 4 ++++ platformio.ini | 18 +++++++++--------- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp b/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp index b195fab1ca..9d5c392f0c 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp @@ -20,6 +20,8 @@ * */ +#ifdef TARGET_LPC1768 + #include "../../../macros.h" #include "../HAL.h" #include "HardwareSerial.h" @@ -634,3 +636,5 @@ void UART3_IRQHandler (void) #ifdef __cplusplus } #endif + +#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp b/Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp index 7c9af17088..a7765d24e4 100644 --- a/Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp @@ -61,6 +61,7 @@ * */ +#ifdef TARGET_LPC1768 #if HAS_SERVOS @@ -166,5 +167,5 @@ #endif // HAS_SERVOS - +#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp b/Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp index 9b5eab549b..f89d704f5e 100644 --- a/Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp @@ -29,6 +29,7 @@ The latest version of this library can always be found at http://arduiniana.org. */ +#ifdef TARGET_LPC1768 // // Includes @@ -396,3 +397,5 @@ int SoftwareSerial::peek() // Read from "head" return _receive_buffer[_receive_buffer_head]; } + +#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp b/Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp index cfb591b0a2..7bf93c1a7e 100644 --- a/Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp @@ -16,6 +16,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifdef TARGET_LPC1768 + #include "../../../macros.h" #include "../HAL.h" #include "arduino.h" @@ -222,3 +224,5 @@ return; //silences warning } } #endif + +#endif // TARGET_LPC1768 diff --git a/platformio.ini b/platformio.ini index 33ce164e37..835e463192 100644 --- a/platformio.ini +++ b/platformio.ini @@ -25,7 +25,7 @@ lib_deps = https://github.com/lincomatic/LiquidTWI2.git https://github.com/teemuatlut/TMC2130Stepper.git https://github.com/adafruit/Adafruit_NeoPixel.git -default_src_filter = +<*> - - - +default_src_filter = +<*> - - [env:megaatmega2560] platform = atmelavr @@ -34,7 +34,7 @@ board = megaatmega2560 build_flags = -I $BUILDSRC_DIR board_f_cpu = 16000000L lib_deps = ${common.lib_deps} -src_filter = ${common.default_src_filter} + +src_filter = ${common.default_src_filter} [env:megaatmega1280] platform = atmelavr @@ -43,7 +43,7 @@ board = megaatmega1280 build_flags = -I $BUILDSRC_DIR board_f_cpu = 16000000L lib_deps = ${common.lib_deps} -src_filter = ${common.default_src_filter} + +src_filter = ${common.default_src_filter} [env:printrboard] platform = teensy @@ -53,7 +53,7 @@ build_flags = -I $BUILDSRC_DIR -D MOTHERBOARD=BOARD_PRINTRBOARD # Bug in arduino framework does not allow boards running at 20Mhz #board_f_cpu = 20000000L lib_deps = ${common.lib_deps} -src_filter = ${common.default_src_filter} + +src_filter = ${common.default_src_filter} [env:printrboard_revf] platform = teensy @@ -68,7 +68,7 @@ framework = arduino board = teensy20pp build_flags = -I $BUILDSRC_DIR -D MOTHERBOARD=BOARD_BRAINWAVE_PRO lib_deps = ${common.lib_deps} -src_filter = ${common.default_src_filter} + +src_filter = ${common.default_src_filter} [env:rambo] platform = atmelavr @@ -77,7 +77,7 @@ board = reprap_rambo build_flags = -I $BUILDSRC_DIR board_f_cpu = 16000000L lib_deps = ${common.lib_deps} -src_filter = ${common.default_src_filter} + +src_filter = ${common.default_src_filter} [env:anet10] platform = atmelavr @@ -98,7 +98,7 @@ framework = arduino board = due build_flags = -I $BUILDSRC_DIR -D MOTHERBOARD=BOARD_RAMPS4DUE_EFB lib_deps = ${common.lib_deps} -src_filter = ${common.default_src_filter} + +src_filter = ${common.default_src_filter} [env:teensy35] platform = teensy @@ -107,7 +107,7 @@ board = teensy35 build_flags = -I $BUILDSRC_DIR lib_deps = ${common.lib_deps} lib_ignore = Adafruit NeoPixel -src_filter = ${common.default_src_filter} + +src_filter = ${common.default_src_filter} [env:Re-ARM] platform = nxplpc @@ -115,5 +115,5 @@ board_f_cpu = 100000000L build_flags = !python Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py lib_ldf_mode = off lib_deps = U8glib-ARM -src_filter = ${common.default_src_filter} + + +src_filter = ${common.default_src_filter} + extra_scripts = Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py