From 200821fe827230570e253c1679f00bcdb6c5bd94 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Fri, 24 Jul 2009 01:44:01 +0000 Subject: Added new LEDs_ToggleLEDs() function to the Board LEDs driver. --- LUFA/Drivers/Board/STK525/LEDs.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'LUFA/Drivers/Board/STK525') diff --git a/LUFA/Drivers/Board/STK525/LEDs.h b/LUFA/Drivers/Board/STK525/LEDs.h index a769f16d0..73c03f75a 100644 --- a/LUFA/Drivers/Board/STK525/LEDs.h +++ b/LUFA/Drivers/Board/STK525/LEDs.h @@ -88,26 +88,31 @@ PORTD &= ~LEDS_ALL_LEDS; } - static inline void LEDs_TurnOnLEDs(const uint8_t LedMask) + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { - PORTD |= LedMask; + PORTD |= LEDMask; } - static inline void LEDs_TurnOffLEDs(const uint8_t LedMask) + static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) { - PORTD &= ~LedMask; + PORTD &= ~LEDMask; } - static inline void LEDs_SetAllLEDs(const uint8_t LedMask) + static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) { - PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LedMask); + PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask); } - static inline void LEDs_ChangeLEDs(const uint8_t LedMask, const uint8_t ActiveMask) + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask) { - PORTD = ((PORTD & ~LedMask) | ActiveMask); + PORTD = ((PORTD & ~LEDMask) | ActiveMask); } + static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) + { + PORTD = (PORTD ^ (LEDMask & LEDS_ALL_LEDS)); + } + static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) { -- cgit v1.2.3