Added No USB workaround to pins.h

Due to a bad Leonardo Bootloader this is the only way (i know) to fix
this bug right now. It no longer needs to be included in the sketch
anymore, this will be compiled automatically now.
This commit is contained in:
Nico 2015-02-20 14:45:25 +01:00
parent 8392355ebe
commit 8681c19dab
3 changed files with 22 additions and 31 deletions

View file

@ -0,0 +1,11 @@
#include <Arduino.h>
#include <pins_arduino.h>
// 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;
}

View file

@ -0,0 +1,11 @@
#include <Arduino.h>
#include <pins_arduino.h>
// 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;
}

View file

@ -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
}