aboutsummaryrefslogtreecommitdiffstats
path: root/Projects
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-07-29 13:04:53 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-07-29 13:04:53 +0000
commit62022252ea4d2763e15c1150367ca972bc4926bf (patch)
tree6f10dd34dd13737847c084538ffd3dade20e4475 /Projects
parent30c2b620de700a34a91ddef0ae97f01ea6f116bd (diff)
downloadlufa-62022252ea4d2763e15c1150367ca972bc4926bf.tar.gz
lufa-62022252ea4d2763e15c1150367ca972bc4926bf.tar.bz2
lufa-62022252ea4d2763e15c1150367ca972bc4926bf.zip
Add special support to the AVRISP-MKII for the new model USBTINY-MKII's additional LED to indicate target power source.
Add support to the USBTINY-MKII's additional LED in the board's LED driver header. Changed LED indicator masks for the AVRISP-MKII project, so that there are defined roles for each LED.
Diffstat (limited to 'Projects')
-rw-r--r--Projects/AVRISP-MKII/AVRISP-MKII.c8
-rw-r--r--Projects/AVRISP-MKII/AVRISP-MKII.h12
2 files changed, 14 insertions, 6 deletions
diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.c b/Projects/AVRISP-MKII/AVRISP-MKII.c
index 7293906bb..0afb087cf 100644
--- a/Projects/AVRISP-MKII/AVRISP-MKII.c
+++ b/Projects/AVRISP-MKII/AVRISP-MKII.c
@@ -49,6 +49,12 @@ int main(void)
for (;;)
{
+ #if (BOARD == BOARD_USBTINYMKII)
+ /* On the USBTINY-MKII target, there is a secondary LED which indicates the current selected power
+ mode - either VBUS, or sourced from the VTARGET pin of the programming connectors */
+ LEDs_ChangeLEDs(LEDMASK_VBUSPOWER, (PIND & (1 << 0)) ? LEDMASK_VBUSPOWER : 0);
+ #endif
+
AVRISP_Task();
USB_USBTask();
}
@@ -66,7 +72,7 @@ void SetupHardware(void)
/* Hardware Initialization */
LEDs_Init();
- USB_Init();
+ USB_Init();
}
/** Event handler for the library USB Connection event. */
diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.h b/Projects/AVRISP-MKII/AVRISP-MKII.h
index 1018ebc3d..3491abf0c 100644
--- a/Projects/AVRISP-MKII/AVRISP-MKII.h
+++ b/Projects/AVRISP-MKII/AVRISP-MKII.h
@@ -42,8 +42,6 @@
#include <avr/interrupt.h>
#include <avr/power.h>
- #include "Descriptors.h"
-
#include <LUFA/Version.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
@@ -52,6 +50,7 @@
#include <LUFA/Drivers/Peripheral/ADC.h>
#endif
+ #include "Descriptors.h"
#include "Lib/V2Protocol.h"
/* Macros: */
@@ -59,16 +58,19 @@
#define LEDMASK_USB_NOTREADY LEDS_LED1
/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */
- #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3)
+ #define LEDMASK_USB_ENUMERATING (LEDS_LED1 | LEDS_LED2)
/** LED mask for the library LED driver, to indicate that the USB interface is ready. */
- #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4)
+ #define LEDMASK_USB_READY LEDS_LED2
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */
- #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)
+ #define LEDMASK_USB_ERROR LEDS_LED1
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_BUSY (LEDS_LED1 | LEDS_LED2)
+
+ /** LED mask for the library LED driver, to indicate that the target is being powered by VBUS. */
+ #define LEDMASK_VBUSPOWER LEDS_LED3
/* Function Prototypes: */
void SetupHardware(void);