Fix typos in the XMEGA board LED drivers, use a cleaner change and set implementation.
This commit is contained in:
parent
1eae43da0c
commit
6d58628e85
4 changed files with 30 additions and 14 deletions
|
|
@ -140,14 +140,21 @@
|
|||
|
||||
static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
|
||||
{
|
||||
PORTR_OUT = ((PORTR.OUT & ~LEDS_PORTR_LEDS) | (LEDMask & LEDS_PORTR_LEDS));
|
||||
PORTD_OUT = ((PORTD.OUT & ~LEDS_PORTD_LEDS) | (LEDMask & LEDS_PORTD_LEDS));
|
||||
PORTR_OUTCLR = LEDS_PORTR_LEDS;
|
||||
PORTD_OUTCLR = LEDS_PORTD_LEDS;
|
||||
|
||||
PORTR_OUTSET = (LEDMask & LEDS_PORTR_LEDS);
|
||||
PORTD_OUTSET = (LEDMask & LEDS_PORTD_LEDS);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
PORTR_OUT = (PORTR.OUT & ~(LEDMask & LEDS_PORTR_LEDS)) | (Active & LEDS_PORTR_LEDS);
|
||||
PORTD_OUT = (PORTD.OUT & ~(LEDMask & LEDS_PORTD_LEDS)) | (Active & LEDS_PORTD_LEDS);
|
||||
PORTR_OUTCLR = (LEDMask & LEDS_PORTR_LEDS);
|
||||
PORTD_OUTCLR = (LEDMask & LEDS_PORTD_LEDS);
|
||||
|
||||
PORTR_OUTSET = (ActiveMask & LEDS_PORTR_LEDS);
|
||||
PORTD_OUTSET = (ActiveMask & LEDS_PORTD_LEDS);
|
||||
}
|
||||
|
||||
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@
|
|||
{
|
||||
PORTB.DIRCLR = LEDS_PORTB_LEDS;
|
||||
PORTB.OUTCLR = LEDS_PORTB_LEDS;
|
||||
|
||||
|
||||
PORTCFG.MPCMASK = 0;
|
||||
PORTB.PIN0CTRL = LEDS_PORTB_LEDS;
|
||||
|
||||
|
|
@ -149,11 +149,12 @@
|
|||
PORTE_OUTSET = ((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
PORTB_OUTCLR = (LEDMask & LEDS_PORTB_LEDS);
|
||||
PORTE_OUTCLR = ((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT);
|
||||
|
||||
|
||||
PORTB_OUTSET = (ActiveMask & LEDS_PORTB_LEDS);
|
||||
PORTE_OUTSET = ((ActiveMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,14 +140,21 @@
|
|||
|
||||
static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
|
||||
{
|
||||
PORTR_OUT = ((PORTR.OUT & ~LEDS_PORTR_LEDS) | (LEDMask & LEDS_PORTR_LEDS));
|
||||
PORTD_OUT = ((PORTD.OUT & ~LEDS_PORTD_LEDS) | (LEDMask & LEDS_PORTD_LEDS));
|
||||
PORTR_OUTCLR = LEDS_PORTR_LEDS;
|
||||
PORTD_OUTCLR = LEDS_PORTD_LEDS;
|
||||
|
||||
PORTR_OUTSET = (LEDMask & LEDS_PORTR_LEDS);
|
||||
PORTD_OUTSET = (LEDMask & LEDS_PORTD_LEDS);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
PORTR_OUT = (PORTR.OUT & ~(LEDMask & LEDS_PORTR_LEDS)) | (Active & LEDS_PORTR_LEDS);
|
||||
PORTD_OUT = (PORTD.OUT & ~(LEDMask & LEDS_PORTD_LEDS)) | (Active & LEDS_PORTD_LEDS);
|
||||
PORTR_OUTCLR = (LEDMask & LEDS_PORTR_LEDS);
|
||||
PORTD_OUTCLR = (LEDMask & LEDS_PORTD_LEDS);
|
||||
|
||||
PORTR_OUTSET = (ActiveMask & LEDS_PORTR_LEDS);
|
||||
PORTD_OUTSET = (ActiveMask & LEDS_PORTD_LEDS);
|
||||
}
|
||||
|
||||
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue