Added new LEDs_ToggleLEDs() function to the Board LEDs driver.

This commit is contained in:
Dean Camera 2009-07-24 01:44:01 +00:00
parent 3991c94b38
commit 200821fe82
12 changed files with 74 additions and 42 deletions

View file

@ -88,24 +88,29 @@
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;