HID/examples/Projects/HoodLoader2_RunBootloader/HoodLoader2_RunBootloader.ino
Nico 0e738a08d9 Added Runbootloader example
Alternative way to the USB-Serial Bridge
2015-02-20 14:33:11 +01:00

33 lines
604 B
C++

/*
Copyright (c) 2015 NicoHood
See the readme for credit to other people.
HoodLoader2 Run Bootloader example
Starts Bootloader mode.
This is useful if you only want to use
the USB-Serial bridge again.
You could delete the program with avrdude,
but this sketch is way simpler to upload.
It forces a watchdog reset,
meaning the bootloader is started completely indipendant.
*/
#include <avr/wdt.h>
void setup() {
// close interrupts
cli();
// write magic key to ram
*(uint8_t *)0x0280 = 0x77;
// watchdog reset
wdt_enable(WDTO_120MS);
}
void loop() {
// wait for reset
}