projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2b0c953
)
Added LED flashing to the CDC and DFU class bootloaders to indicate when they are...
author
Dean Camera
<dean@fourwalledcubicle.com>
Sat, 23 Apr 2011 03:45:29 +0000
(
03:45
+0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Sat, 23 Apr 2011 03:45:29 +0000
(
03:45
+0000)
Bootloaders/CDC/BootloaderCDC.c
patch
|
blob
|
blame
|
history
Bootloaders/CDC/BootloaderCDC.h
patch
|
blob
|
blame
|
history
Bootloaders/DFU/BootloaderDFU.c
patch
|
blob
|
blame
|
history
Bootloaders/DFU/BootloaderDFU.h
patch
|
blob
|
blame
|
history
LUFA/ManPages/ChangeLog.txt
patch
|
blob
|
blame
|
history
diff --git
a/Bootloaders/CDC/BootloaderCDC.c
b/Bootloaders/CDC/BootloaderCDC.c
index
8e6a58b
..
ba0a629
100644
(file)
--- a/
Bootloaders/CDC/BootloaderCDC.c
+++ b/
Bootloaders/CDC/BootloaderCDC.c
@@
-66,6
+66,9
@@
int main(void)
/* Setup hardware required for the bootloader */
SetupHardware();
/* 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();
/* Enable global interrupts so that the USB stack can function */
sei();
@@
-100,6
+103,17
@@
void SetupHardware(void)
/* Initialize USB Subsystem */
USB_Init();
/* 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
}
/** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready
diff --git
a/Bootloaders/CDC/BootloaderCDC.h
b/Bootloaders/CDC/BootloaderCDC.h
index
b6bea11
..
72bc1e7
100644
(file)
--- a/
Bootloaders/CDC/BootloaderCDC.h
+++ b/
Bootloaders/CDC/BootloaderCDC.h
@@
-48,6
+48,7
@@
#include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h>
#include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Drivers/Board/LEDs.h>
/* Macros: */
/** Version major of the CDC bootloader. */
/* Macros: */
/** Version major of the CDC bootloader. */
diff --git
a/Bootloaders/DFU/BootloaderDFU.c
b/Bootloaders/DFU/BootloaderDFU.c
index
113bea7
..
9f61660
100644
(file)
--- a/
Bootloaders/DFU/BootloaderDFU.c
+++ b/
Bootloaders/DFU/BootloaderDFU.c
@@
-119,6
+119,9
@@
int main(void)
MCUCR &= ~(1 << JTD);
#endif
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();
/* Enable global interrupts so that the USB stack can function */
sei();
@@
-149,6
+152,11
@@
void SetupHardware(void)
/* Initialize the USB subsystem */
USB_Init();
/* 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. */
}
/** Resets all configured hardware required for the bootloader back to their original states. */
@@
-162,6
+170,12
@@
void ResetHardware(void)
MCUCR = 0;
}
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.
/** 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.
diff --git
a/Bootloaders/DFU/BootloaderDFU.h
b/Bootloaders/DFU/BootloaderDFU.h
index
1c1ebba
..
8fbf64c
100644
(file)
--- a/
Bootloaders/DFU/BootloaderDFU.h
+++ b/
Bootloaders/DFU/BootloaderDFU.h
@@
-50,6
+50,7
@@
#include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h>
#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
/* Macros: */
/** Configuration define. Define this token to true to case the bootloader to reject all memory commands
diff --git
a/LUFA/ManPages/ChangeLog.txt
b/LUFA/ManPages/ChangeLog.txt
index
f7a0085
..
d507790
100644
(file)
--- a/
LUFA/ManPages/ChangeLog.txt
+++ b/
LUFA/ManPages/ChangeLog.txt
@@
-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 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:
*
* <b>Changed:</b>
* - Core: