ConfigValue: remove redundant as_pin and as_pwm methods
[clinton/Smoothieware.git] / makefile
index 8bceca0..a612509 100644 (file)
--- a/makefile
+++ b/makefile
@@ -17,14 +17,47 @@ INCDIRS=
 LIBS_PREFIX=\r
 LIBS_SUFFIX=\r
 SRC=./src\r
+\r
+#GCC4MBED_TYPE=Debug\r
+#GCC4MBED_TYPE=Release\r
 GCC4MBED_TYPE=Checked\r
-MRI_UART=MRI_UART_MBED_USB\r
+\r
+# Set to 1 to allow MRI debug monitor to take full control of UART0 and use it\r
+# as a dedicated debug channel.  If you are using the USB based serial port for\r
+# the console then this should cause you no problems.  Set MRI_BREAK_ON_INIT to\r
+# 0 if you don't want to break into GDB at startup.\r
+ENABLE_DEBUG_MONITOR?=0\r
+\r
+ifeq "$(ENABLE_DEBUG_MONITOR)" "1"\r
+# Can add MRI_UART_BAUD=115200 to next line if GDB fails to connect to MRI.\r
+# Tends to happen on some Linux distros but not Windows and OS X.\r
+MRI_UART=MRI_UART_0\r
+MRI_BREAK_ON_INIT=1\r
+MRI_SEMIHOST_STDIO=1\r
+else\r
+MRI_UART=MRI_UART_0 MRI_UART_SHARE\r
 MRI_BREAK_ON_INIT=0\r
 MRI_SEMIHOST_STDIO=0\r
+endif\r
+\r
+CONSOLE=/dev/ttyUSB0\r
 \r
 include ./gcc4mbed/build/gcc4mbed.mk\r
 \r
-flash: \r
-       lpc21isp $(PROJECT).hex /dev/ttyACM0 115200 14746\r
+.PHONY: debug-store flash upload debug console\r
+\r
+debug-store: $(PROJECT).elf\r
+       cp $(PROJECT).elf $(PROJECT)_lastupload.elf\r
+\r
+flash: $(PROJECT).hex debug-store\r
+       lpc21isp $< $(CONSOLE) 115200 12000\r
+\r
+upload: $(PROJECT).bin debug-store\r
+       dfu-util -d 1d50:6015 -R -D $<\r
 \r
+debug: $(PROJECT)_lastupload.elf\r
+       arm-none-eabi-gdb $< -ex  "set target-charset ASCII" -ex "set remotelogfile mri.log" -ex "target remote $(CONSOLE)"\r
 \r
+console:\r
+       stty raw ignbrk -echo 2000000 < $(CONSOLE)\r
+       ( cat <&3 & cat >&3 ; kill %% ) 3<>$(CONSOLE)\r