diff --git a/avr/variants/leonardo_no_usb/no_usb_isr.cpp b/avr/variants/leonardo_no_usb/no_usb_isr.cpp new file mode 100644 index 0000000..eec342f --- /dev/null +++ b/avr/variants/leonardo_no_usb/no_usb_isr.cpp @@ -0,0 +1,11 @@ +#include +#include + +// workaround for undefined USBCON has to be placed in every sketch +// otherwise the timings wont work correctly +// this is only needed for Leonardo/Micro boards and not for HoodLoader2 +// due to a better bootloader reset (usb clock does not run after programming) +ISR(USB_GEN_vect) +{ + UDINT = 0; +} \ No newline at end of file diff --git a/avr/variants/micro_no_usb/no_usb_isr.cpp b/avr/variants/micro_no_usb/no_usb_isr.cpp new file mode 100644 index 0000000..eec342f --- /dev/null +++ b/avr/variants/micro_no_usb/no_usb_isr.cpp @@ -0,0 +1,11 @@ +#include +#include + +// workaround for undefined USBCON has to be placed in every sketch +// otherwise the timings wont work correctly +// this is only needed for Leonardo/Micro boards and not for HoodLoader2 +// due to a better bootloader reset (usb clock does not run after programming) +ISR(USB_GEN_vect) +{ + UDINT = 0; +} \ No newline at end of file diff --git a/examples/Projects/Leonardo_Micro_NoUSB_Blink/Leonardo_Micro_NoUSB_Blink.ino b/examples/Projects/Leonardo_Micro_NoUSB_Blink/Leonardo_Micro_NoUSB_Blink.ino deleted file mode 100644 index 8309b26..0000000 --- a/examples/Projects/Leonardo_Micro_NoUSB_Blink/Leonardo_Micro_NoUSB_Blink.ino +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (c) 2014 NicoHood - See the readme for credit to other people. - - Leonardo_Micro_NoUSB_Blink - - Blinks Led and shows what workaround is needed to fix the timing. - This is not needed for HoodLoader2 devices any more. -*/ - - -// workaround for undefined USBCON has to be placed in every sketch -// otherwise the timings wont work correctly -ISR(USB_GEN_vect) -{ - UDINT = 0; -} - -// the setup function runs once when you press reset or power the board -void setup() { - // initialize digital pin 13 as an output. - pinMode(13, OUTPUT); -} - -// the loop function runs over and over again forever -void loop() { - digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) - delay(1000); // wait for a second - digitalWrite(13, LOW); // turn the LED off by making the voltage LOW - delay(1000); // wait for a second -}