Browse Source

Add support of LiquidTWI2-based panels to Makefile

Use LIQUID_TWI2=1 as make argument to enable this support
Guillaume Seguin 11 years ago
parent
commit
374bc99fa3
1 changed files with 20 additions and 2 deletions
  1. 20
    2
      Marlin/Makefile

+ 20
- 2
Marlin/Makefile View File

54
 #Directory used to build files in, contains all the build files, from object files to the final hex file.
54
 #Directory used to build files in, contains all the build files, from object files to the final hex file.
55
 BUILD_DIR          ?= applet
55
 BUILD_DIR          ?= applet
56
 
56
 
57
+# This defines whether Liquid_TWI2 support will be built
58
+LIQUID_TWI2 ?= 0
59
+
57
 ############################################################################
60
 ############################################################################
58
 # Below here nothing should be changed...
61
 # Below here nothing should be changed...
59
 
62
 
199
 ifeq ($(HARDWARE_VARIANT), arduino)
202
 ifeq ($(HARDWARE_VARIANT), arduino)
200
 VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal
203
 VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal
201
 VPATH += $(ARDUINO_INSTALL_DIR)/libraries/SPI
204
 VPATH += $(ARDUINO_INSTALL_DIR)/libraries/SPI
205
+ifeq ($(LIQUID_TWI2), 1)
206
+VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire
207
+VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility
208
+VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidTWI2
209
+endif
202
 else
210
 else
203
 VPATH += $(HARDWARE_DIR)/libraries/LiquidCrystal
211
 VPATH += $(HARDWARE_DIR)/libraries/LiquidCrystal
204
 VPATH += $(HARDWARE_DIR)/libraries/SPI
212
 VPATH += $(HARDWARE_DIR)/libraries/SPI
213
+ifeq ($(LIQUID_TWI2), 1)
214
+VPATH += $(HARDWARE_DIR)/libraries/Wire
215
+VPATH += $(HARDWARE_DIR)/libraries/Wire/utility
216
+VPATH += $(HARDWARE_DIR)/libraries/LiquidTWI2
217
+endif
205
 endif
218
 endif
206
 ifeq ($(HARDWARE_VARIANT), arduino)
219
 ifeq ($(HARDWARE_VARIANT), arduino)
207
 HARDWARE_SUB_VARIANT ?= mega
220
 HARDWARE_SUB_VARIANT ?= mega
218
 	MarlinSerial.cpp Sd2Card.cpp SdBaseFile.cpp SdFatUtil.cpp	\
231
 	MarlinSerial.cpp Sd2Card.cpp SdBaseFile.cpp SdFatUtil.cpp	\
219
 	SdFile.cpp SdVolume.cpp motion_control.cpp planner.cpp		\
232
 	SdFile.cpp SdVolume.cpp motion_control.cpp planner.cpp		\
220
 	stepper.cpp temperature.cpp cardreader.cpp ConfigurationStore.cpp \
233
 	stepper.cpp temperature.cpp cardreader.cpp ConfigurationStore.cpp \
221
-	watchdog.cpp
222
-CXXSRC += LiquidCrystal.cpp ultralcd.cpp SPI.cpp Servo.cpp Tone.cpp
234
+	watchdog.cpp SPI.cpp Servo.cpp Tone.cpp ultralcd.cpp
235
+ifeq ($(LIQUID_TWI2), 0)
236
+CXXSRC += LiquidCrystal.cpp
237
+else
238
+SRC += twi.c
239
+CXXSRC += Wire.cpp LiquidTWI2.cpp
240
+endif
223
 
241
 
224
 #Check for Arduino 1.0.0 or higher and use the correct sourcefiles for that version
242
 #Check for Arduino 1.0.0 or higher and use the correct sourcefiles for that version
225
 ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
243
 ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)

Loading…
Cancel
Save