Browse Source

Stop watchdog before attempting reboot on Teensy 2.0

main
PaulStoffregen 10 years ago
parent
commit
9b857be028
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      teensy/pins_teensy.c

+ 7
- 0
teensy/pins_teensy.c View File

@@ -1662,10 +1662,17 @@ static void disable_peripherals(void)
#endif
}

#ifndef WDFR
#define WDFR 3
#endif

void _reboot_Teensyduino_(void)
{
cli();
// stop watchdog timer, if running
MCUSR &= ~(1<<WDFR);
WDTCSR |= (1<<WDCE);
WDTCSR = 0;
delayMicroseconds(5000);
UDCON = 1;
USBCON = (1<<FRZCLK);

Loading…
Cancel
Save