Merge pull request #81 from phord/09469add5560ca8a676c42e4bcd499868c33f0dd

Clean up and add some trace info
This commit is contained in:
ErikZalm 2012-02-27 08:38:36 -08:00
commit 071eec7aa7
3 changed files with 19 additions and 5 deletions

2
Marlin/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.o
applet/

View File

@ -138,6 +138,8 @@ all: build sizeafter
build: elf hex build: elf hex
applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE) applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE)
applet/%.cpp: %.pde
# Here is the "preprocessing". # Here is the "preprocessing".
# It creates a .cpp file based with the same name as the .pde file. # 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. # 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 # Then the .cpp file will be compiled. Errors during compile will
# refer to this new, automatically generated, file. # refer to this new, automatically generated, file.
# Not the original .pde file you actually edit... # Not the original .pde file you actually edit...
@echo " WR applet/$(TARGET).cpp" @echo " WR $@"
@test -d applet || mkdir applet @test -d $(dir $@) || mkdir $(dir $@)
@echo '#include "WProgram.h"' > applet/$(TARGET).cpp @echo '#include "WProgram.h"' > $@
@cat $(TARGET).pde >> applet/$(TARGET).cpp @cat $< >> $@
@cat $(ARDUINO)/main.cpp >> applet/$(TARGET).cpp @cat $(ARDUINO)/main.cpp >> $@
elf: applet/$(TARGET).elf elf: applet/$(TARGET).elf
hex: applet/$(TARGET).hex hex: applet/$(TARGET).hex

View File

@ -252,6 +252,16 @@ void setup()
MYSERIAL.begin(BAUDRATE); MYSERIAL.begin(BAUDRATE);
SERIAL_PROTOCOLLNPGM("start"); SERIAL_PROTOCOLLNPGM("start");
SERIAL_ECHO_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_ECHOPGM("Marlin: ");
SERIAL_ECHOLNPGM(VERSION_STRING); SERIAL_ECHOLNPGM(VERSION_STRING);
#ifdef STRING_VERSION_CONFIG_H #ifdef STRING_VERSION_CONFIG_H