Sfoglia il codice sorgente

Merge pull request #81 from phord/09469add55

Clean up and add some trace info
ErikZalm 13 anni fa
parent
commit
071eec7aa7
3 ha cambiato i file con 19 aggiunte e 5 eliminazioni
  1. 2
    0
      Marlin/.gitignore
  2. 7
    5
      Marlin/Makefile
  3. 10
    0
      Marlin/Marlin.pde

+ 2
- 0
Marlin/.gitignore Vedi File

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

+ 7
- 5
Marlin/Makefile Vedi File

@@ -138,6 +138,8 @@ all: build sizeafter
138 138
 build: elf hex 
139 139
 
140 140
 applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE)
141
+
142
+applet/%.cpp: %.pde
141 143
 # Here is the "preprocessing".
142 144
 # It creates a .cpp file based with the same name as the .pde file.
143 145
 # On top of the new .cpp file comes the WProgram.h header.
@@ -145,11 +147,11 @@ applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE)
145 147
 # Then the .cpp file will be compiled. Errors during compile will
146 148
 # refer to this new, automatically generated, file. 
147 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 156
 elf: applet/$(TARGET).elf
155 157
 hex: applet/$(TARGET).hex

+ 10
- 0
Marlin/Marlin.pde Vedi File

@@ -252,6 +252,16 @@ void setup()
252 252
   MYSERIAL.begin(BAUDRATE);
253 253
   SERIAL_PROTOCOLLNPGM("start");
254 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 265
   SERIAL_ECHOPGM("Marlin: ");
256 266
   SERIAL_ECHOLNPGM(VERSION_STRING);
257 267
   #ifdef STRING_VERSION_CONFIG_H

Loading…
Annulla
Salva