Explorar el Código

Stop watchdog before attempting reboot on Teensy 2.0

teensy4-core
PaulStoffregen hace 11 años
padre
commit
9b857be028
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. +7
    -0
      teensy/pins_teensy.c

+ 7
- 0
teensy/pins_teensy.c Ver fichero

#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);

Cargando…
Cancelar
Guardar