From 245dca4bee3ea5cb4b1a294162cc01c40a55a3e5 Mon Sep 17 00:00:00 2001 From: Phil Hord Date: Thu, 16 Feb 2012 12:17:33 -0500 Subject: [PATCH 1/3] Makefile: generic pde=>cpp rule This adds flexibility to the makefile by allowing different pde targets to be specified for different needs. --- Marlin/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Marlin/Makefile b/Marlin/Makefile index 71ee747..7ab3586 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -138,6 +138,8 @@ all: build sizeafter build: elf hex applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE) + +applet/%.cpp: %.pde # Here is the "preprocessing". # It creates a .cpp file based with the same name as the .pde file. # On top of the new .cpp file comes the WProgram.h header. @@ -145,11 +147,11 @@ applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE) # Then the .cpp file will be compiled. Errors during compile will # refer to this new, automatically generated, file. # Not the original .pde file you actually edit... - @echo " WR applet/$(TARGET).cpp" - @test -d applet || mkdir applet - @echo '#include "WProgram.h"' > applet/$(TARGET).cpp - @cat $(TARGET).pde >> applet/$(TARGET).cpp - @cat $(ARDUINO)/main.cpp >> applet/$(TARGET).cpp + @echo " WR $@" + @test -d $(dir $@) || mkdir $(dir $@) + @echo '#include "WProgram.h"' > $@ + @cat $< >> $@ + @cat $(ARDUINO)/main.cpp >> $@ elf: applet/$(TARGET).elf hex: applet/$(TARGET).hex From f3101e96d90d4046c2ce19508a2bac1946d88964 Mon Sep 17 00:00:00 2001 From: Phil Hord Date: Thu, 16 Feb 2012 12:06:33 -0500 Subject: [PATCH 2/3] Add suitable .gitignore to avoid build noise --- Marlin/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Marlin/.gitignore diff --git a/Marlin/.gitignore b/Marlin/.gitignore new file mode 100644 index 0000000..37a3c9b --- /dev/null +++ b/Marlin/.gitignore @@ -0,0 +1,2 @@ +*.o +applet/ From 09469add5560ca8a676c42e4bcd499868c33f0dd Mon Sep 17 00:00:00 2001 From: Phil Hord Date: Mon, 20 Feb 2012 02:30:31 -0500 Subject: [PATCH 3/3] Add board reset reporting (from Repetier-Firmware) --- Marlin/Marlin.pde | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 93c3a71..3d906cc 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -252,6 +252,16 @@ void setup() MYSERIAL.begin(BAUDRATE); SERIAL_PROTOCOLLNPGM("start"); SERIAL_ECHO_START; + + // Check startup - does nothing if bootloader sets MCUSR to 0 + byte mcu = MCUSR; + if(mcu & 1) SERIAL_ECHOLNPGM("PowerUp"); + if(mcu & 2) SERIAL_ECHOLNPGM("External Reset"); + if(mcu & 4) SERIAL_ECHOLNPGM("Brown out Reset"); + if(mcu & 8) SERIAL_ECHOLNPGM("Watchdog Reset"); + if(mcu & 32) SERIAL_ECHOLNPGM("Software Reset"); + MCUSR=0; + SERIAL_ECHOPGM("Marlin: "); SERIAL_ECHOLNPGM(VERSION_STRING); #ifdef STRING_VERSION_CONFIG_H