diff --git a/avr/usbload/main.c b/avr/usbload/main.c index d13088a..e70dc6e 100644 --- a/avr/usbload/main.c +++ b/avr/usbload/main.c @@ -405,6 +405,7 @@ int main(void) while (req_state != REQ_STATUS_AVR){ usbPoll(); +#if 0 i = 20; while (--i) { /* fake USB disconnect for > 250 ms */ _delay_ms(100); @@ -421,7 +422,7 @@ int main(void) sram_bulk_read_start(0x003000); printf("Read 0x3000=%c\n",c); - +#endif } } diff --git a/avr/usbload/watchdog.c b/avr/usbload/watchdog.c new file mode 100644 index 0000000..f9e99a0 --- /dev/null +++ b/avr/usbload/watchdog.c @@ -0,0 +1,10 @@ +#include "watchdog.h" + +void wdt_init(void) +{ + MCUSR = 0; + wdt_disable(); + + return; +} + diff --git a/avr/usbload/watchdog.h b/avr/usbload/watchdog.h new file mode 100644 index 0000000..6c13799 --- /dev/null +++ b/avr/usbload/watchdog.h @@ -0,0 +1,19 @@ +#include + +#ifndef __WATCHDOG_H__ +#define __WATCHDOG_H__ + + +void wdt_init(void) __attribute__((naked)) __attribute__((section(".init3"))); + +#define soft_reset() \ +do \ +{ \ + wdt_enable(WDTO_500MS );\ + for(;;) \ + { \ + } \ +} while(0) + +#endif +