Bläddra i källkod

Merge pull request #81 from phord/09469add55

Clean up and add some trace info
ErikZalm 13 år sedan
förälder
incheckning
071eec7aa7
3 ändrade filer med 19 tillägg och 5 borttagningar
  1. 2
    0
      Marlin/.gitignore
  2. 7
    5
      Marlin/Makefile
  3. 10
    0
      Marlin/Marlin.pde

+ 2
- 0
Marlin/.gitignore Visa fil

1
+*.o
2
+applet/

+ 7
- 5
Marlin/Makefile Visa fil

138
 build: elf hex 
138
 build: elf hex 
139
 
139
 
140
 applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE)
140
 applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE)
141
+
142
+applet/%.cpp: %.pde
141
 # Here is the "preprocessing".
143
 # Here is the "preprocessing".
142
 # It creates a .cpp file based with the same name as the .pde file.
144
 # It creates a .cpp file based with the same name as the .pde file.
143
 # On top of the new .cpp file comes the WProgram.h header.
145
 # On top of the new .cpp file comes the WProgram.h header.
145
 # Then the .cpp file will be compiled. Errors during compile will
147
 # Then the .cpp file will be compiled. Errors during compile will
146
 # refer to this new, automatically generated, file. 
148
 # refer to this new, automatically generated, file. 
147
 # Not the original .pde file you actually edit...
149
 # Not the original .pde file you actually edit...
148
-	@echo "  WR    applet/$(TARGET).cpp"
149
-	@test -d applet || mkdir applet
150
-	@echo '#include "WProgram.h"' > applet/$(TARGET).cpp
151
-	@cat $(TARGET).pde >> applet/$(TARGET).cpp
152
-	@cat $(ARDUINO)/main.cpp >> applet/$(TARGET).cpp
150
+	@echo "  WR    $@"
151
+	@test -d $(dir $@) || mkdir $(dir $@)
152
+	@echo '#include "WProgram.h"' > $@
153
+	@cat $< >> $@
154
+	@cat $(ARDUINO)/main.cpp >> $@
153
 
155
 
154
 elf: applet/$(TARGET).elf
156
 elf: applet/$(TARGET).elf
155
 hex: applet/$(TARGET).hex
157
 hex: applet/$(TARGET).hex

+ 10
- 0
Marlin/Marlin.pde Visa fil

252
   MYSERIAL.begin(BAUDRATE);
252
   MYSERIAL.begin(BAUDRATE);
253
   SERIAL_PROTOCOLLNPGM("start");
253
   SERIAL_PROTOCOLLNPGM("start");
254
   SERIAL_ECHO_START;
254
   SERIAL_ECHO_START;
255
+
256
+  // Check startup - does nothing if bootloader sets MCUSR to 0
257
+  byte mcu = MCUSR;
258
+  if(mcu & 1) SERIAL_ECHOLNPGM("PowerUp");
259
+  if(mcu & 2) SERIAL_ECHOLNPGM("External Reset");
260
+  if(mcu & 4) SERIAL_ECHOLNPGM("Brown out Reset");
261
+  if(mcu & 8) SERIAL_ECHOLNPGM("Watchdog Reset");
262
+  if(mcu & 32) SERIAL_ECHOLNPGM("Software Reset");
263
+  MCUSR=0;
264
+
255
   SERIAL_ECHOPGM("Marlin: ");
265
   SERIAL_ECHOPGM("Marlin: ");
256
   SERIAL_ECHOLNPGM(VERSION_STRING);
266
   SERIAL_ECHOLNPGM(VERSION_STRING);
257
   #ifdef STRING_VERSION_CONFIG_H
267
   #ifdef STRING_VERSION_CONFIG_H

Laddar…
Avbryt
Spara