Browse Source

Stop watchdog before attempting reboot on Teensy 2.0

teensy4-core
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

#endif #endif
} }


#ifndef WDFR
#define WDFR 3
#endif


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

Loading…
Cancel
Save