Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
513db465
Commit
513db465
authored
Apr 23, 2011
by
Dean Camera
Browse files
Added LED flashing to the CDC and DFU class bootloaders to indicate when they are running.
parent
2b0c9532
Changes
5
Hide whitespace changes
Inline
Side-by-side
Bootloaders/CDC/BootloaderCDC.c
View file @
513db465
...
...
@@ -66,6 +66,9 @@ int main(void)
/* Setup hardware required for the bootloader */
SetupHardware
();
/* Turn on first LED on the board to indicate that the bootloader has started */
LEDs_SetAllLEDs
(
LEDS_LED1
);
/* Enable global interrupts so that the USB stack can function */
sei
();
...
...
@@ -100,6 +103,17 @@ void SetupHardware(void)
/* Initialize USB Subsystem */
USB_Init
();
LEDs_Init
();
/* Bootloader active LED toggle timer initialization */
TIMSK1
=
(
1
<<
TOIE1
);
TCCR1B
=
((
1
<<
CS11
)
|
(
1
<<
CS10
));
}
/** 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
);
}
/** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready
...
...
Bootloaders/CDC/BootloaderCDC.h
View file @
513db465
...
...
@@ -48,6 +48,7 @@
#include
"Descriptors.h"
#include
<LUFA/Drivers/USB/USB.h>
#include
<LUFA/Drivers/Board/LEDs.h>
/* Macros: */
/** Version major of the CDC bootloader. */
...
...
Bootloaders/DFU/BootloaderDFU.c
View file @
513db465
...
...
@@ -119,6 +119,9 @@ int main(void)
MCUCR
&=
~
(
1
<<
JTD
);
#endif
/* Turn on first LED on the board to indicate that the bootloader has started */
LEDs_SetAllLEDs
(
LEDS_LED1
);
/* Enable global interrupts so that the USB stack can function */
sei
();
...
...
@@ -149,6 +152,11 @@ void SetupHardware(void)
/* Initialize the USB subsystem */
USB_Init
();
LEDs_Init
();
/* Bootloader active LED toggle timer initialization */
TIMSK1
=
(
1
<<
TOIE1
);
TCCR1B
=
((
1
<<
CS11
)
|
(
1
<<
CS10
));
}
/** Resets all configured hardware required for the bootloader back to their original states. */
...
...
@@ -162,6 +170,12 @@ void ResetHardware(void)
MCUCR
=
0
;
}
/** 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
);
}
/** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to
* the device from the USB host before passing along unhandled control requests to the library for processing
* internally.
...
...
Bootloaders/DFU/BootloaderDFU.h
View file @
513db465
...
...
@@ -50,6 +50,7 @@
#include
"Descriptors.h"
#include
<LUFA/Drivers/USB/USB.h>
#include
<LUFA/Drivers/Board/LEDs.h>
/* Macros: */
/** Configuration define. Define this token to true to case the bootloader to reject all memory commands
...
...
LUFA/ManPages/ChangeLog.txt
View file @
513db465
...
...
@@ -33,6 +33,7 @@
* - Added new KeyboardMouseMultiReport Device ClassDriver demo
* - Added new VirtualSerialMassStorage Device ClassDriver demo
* - Added HID class bootloader, compatible with a modified version of the command line Teensy loader from PJRC.com
* - Added LED flashing to the CDC and DFU class bootloaders to indicate when they are running
*
* <b>Changed:</b>
* - Core:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment