X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/5563da6a626a7301e5064a8df8b3a9b03421f8aa..77c0786f90ce57651d9039b9dedde0e9a3c9da9d:/LUFA/Drivers/Board/AVR8/UNO/LEDs.h diff --git a/LUFA/Drivers/Board/AVR8/UNO/LEDs.h b/LUFA/Drivers/Board/AVR8/UNO/LEDs.h index 579a1b20b..04b94e7e9 100644 --- a/LUFA/Drivers/Board/AVR8/UNO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/UNO/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 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 @@ -18,7 +18,7 @@ advertising or publicity pertaining to distribution of the software without specific, written prior permission. - The author disclaim all warranties with regard to this + The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages @@ -42,6 +42,12 @@ * * Board specific LED driver header for the Arduino Uno (http://arduino.cc/en/Main/ArduinoBoardUno). * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowRXLowPORTD.5
LEDS_LED2YellowTXLowPORTD.4
+ * * @{ */ @@ -64,10 +70,10 @@ /* Public Interface - May be used in end-application: */ /* Macros: */ /** LED mask for the first LED on the board. */ - #define LEDS_LED1 (1 << 4) + #define LEDS_LED1 (1 << 5) /** LED mask for the second LED on the board. */ - #define LEDS_LED2 (1 << 5) + #define LEDS_LED2 (1 << 4) /** LED mask for all the LEDs on the board. */ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2) @@ -75,6 +81,12 @@ /** LED mask for none of the board LEDs. */ #define LEDS_NO_LEDS 0 + /** LED mask for the library LED driver, to indicate TX activity. */ + #define LEDMASK_TX LEDS_LED1 + + /** LED mask for the library LED driver, to indicate RX activity. */ + #define LEDMASK_RX LEDS_LED2 + /* Inline Functions: */ #if !defined(__DOXYGEN__) static inline void LEDs_Init(void) @@ -86,7 +98,7 @@ static inline void LEDs_Disable(void) { DDRD &= ~LEDS_ALL_LEDS; - PORTD &= ~LEDS_ALL_LEDS; + PORTD |= LEDS_ALL_LEDS; } static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) @@ -112,13 +124,13 @@ 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) { - return (PORTD & LEDS_ALL_LEDS); + return (~PORTD & LEDS_ALL_LEDS); } #endif