Browse Source

Add board reset reporting (from Repetier-Firmware)

Phil Hord 13 years ago
parent
commit
09469add55
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      Marlin/Marlin.pde

+ 10
- 0
Marlin/Marlin.pde View 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…
Cancel
Save