Move Pro-Micro LEDs into own Board-Definition PROMICRO
[pub/lufa.git] / Bootloaders / DFU / BootloaderDFU.c
index 3e2f330..eb6c069 100644 (file)
@@ -174,7 +174,7 @@ int main(void)
        SetupHardware();
 
        /* Turn on first LED on the board to indicate that the bootloader has started */
-       //LEDs_SetAllLEDs(LEDS_LED1);
+       LEDs_SetAllLEDs(LEDS_LED1);
 
        /* Enable global interrupts so that the USB stack can function */
        GlobalInterruptEnable();
@@ -237,11 +237,7 @@ static void SetupHardware(void)
 
        /* Initialize the USB and other board hardware drivers */
        USB_Init();
-       //LEDs_Init();
-       DDRB = 1;
-       PORTB = _BV(PB5);
-       DDRD = 0b00100000;
-       PORTD = 0;
+       LEDs_Init();
 
        /* Bootloader active LED toggle timer initialization */
        TIMSK1 = (1 << TOIE1);
@@ -253,11 +249,7 @@ static void ResetHardware(void)
 {
        /* Shut down the USB and other board hardware drivers */
        USB_Disable();
-       //LEDs_Disable();
-       DDRB = 0;
-       PORTB = 0;
-       DDRD = 0;
-       PORTD = 0;
+       LEDs_Disable();
 
        /* Disable Bootloader active LED toggle timer */
        TIMSK1 = 0;
@@ -271,10 +263,7 @@ static void ResetHardware(void)
 /** ISR to periodically toggle the LEDs on the board to indicate that the bootloader is active. */
 ISR(TIMER1_OVF_vect, ISR_BLOCK)
 {
-       //LEDs_ToggleLEDs(LEDS_LED1 | LEDS_LED2);
-       PORTB &= ~_BV(PB0);
-       _delay_ms(5);
-       PORTB |= _BV(PB0);
+       LEDs_ToggleLEDs(LEDS_LED1 | LEDS_LED2);
 }
 
 /** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to
@@ -293,10 +282,7 @@ void EVENT_USB_Device_ControlRequest(void)
 stayinbootloader = true;
 
        /* Activity - toggle indicator LEDs */
-       //LEDs_ToggleLEDs(LEDS_LED1 | LEDS_LED2);
-       PORTB &= ~_BV(PB0);
-       _delay_ms(5);
-       PORTB |= _BV(PB0);
+       LEDs_ToggleLEDs(LEDS_LED1 | LEDS_LED2);
 
        /* Get the size of the command and data from the wLength value */
        SentCommand.DataSize = USB_ControlRequest.wLength;