X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/2b23318357721e843fd7042a1612e1eab49af229..3c1b28cf5ff16fede61f2abf37d5616f3e661036:/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h
diff --git a/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h b/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h
index 63b96b0df..7149923ea 100644
--- a/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h
+++ b/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h
@@ -1,13 +1,13 @@
/*
LUFA Library
- Copyright (C) Dean Camera, 2011.
+ Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -35,7 +35,7 @@
* \note This file should not be included directly. It is automatically included as needed by the LEDs driver
* dispatch header located in LUFA/Drivers/Board/LEDs.h.
*/
-
+
/** \ingroup Group_LEDs
* \defgroup Group_LEDs_TEENSY2 TEENSY2
* \brief Board specific LED driver header for the PJRC Teensy 2 boards.
@@ -51,6 +51,18 @@
*
* Board specific LED driver header for the PJRC Teensy boards (http://www.pjrc.com/teensy/index.html).
*
+ * TEENSY:
+ *
+ * | Name | Color | Info | Active Level | Port Pin |
+ * | LEDS_LED1 | Green | General Indicator | High | PORTD.6 |
+ *
+ *
+ * TEENSY2:
+ *
+ * | Name | Color | Info | Active Level | Port Pin |
+ * | LEDS_LED1 | Green | General Indicator | Low | PORTD.6 |
+ *
+ *
* @{
*/
@@ -88,16 +100,22 @@
DDRD |= LEDS_ALL_LEDS;
#if (BOARD == BOARD_TEENSY2)
- PORTD &= ~LEDS_ALL_LEDS;
+ PORTD &= ~LEDS_ALL_LEDS;
#else
PORTD |= LEDS_ALL_LEDS;
#endif
}
+ static inline void LEDs_Disable(void)
+ {
+ DDRD &= ~LEDS_ALL_LEDS;
+ PORTD &= ~LEDS_ALL_LEDS;
+ }
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
#if (BOARD == BOARD_TEENSY2)
- PORTD |= LEDMask;
+ PORTD |= LEDMask;
#else
PORTD &= ~LEDMask;
#endif
@@ -106,7 +124,7 @@
static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
{
#if (BOARD == BOARD_TEENSY2)
- PORTD &= ~LEDMask;
+ PORTD &= ~LEDMask;
#else
PORTD |= LEDMask;
#endif
@@ -125,7 +143,7 @@
const uint8_t ActiveMask)
{
#if (BOARD == BOARD_TEENSY2)
- PORTD = ((PORTD & ~LEDMask) | ActiveMask);
+ PORTD = ((PORTD & ~LEDMask) | ActiveMask);
#else
PORTD = ((PORTD | LEDMask) & ~ActiveMask);
#endif
@@ -133,14 +151,14 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{
- PORTD ^= LEDMask;
+ PIND = LEDMask;
}
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
#if (BOARD == BOARD_TEENSY2)
- return (PORTD & LEDS_ALL_LEDS);
+ return (PORTD & LEDS_ALL_LEDS);
#else
return (~PORTD & LEDS_ALL_LEDS);
#endif