Commit 9207e8b2 authored by Dean Camera's avatar Dean Camera
Browse files

Changed board LED driver implementations of LEDs_ToggleLEDs() for the AVR8...

Changed board LED driver implementations of LEDs_ToggleLEDs() for the AVR8 architecture to use the fast PIN register toggle alternative function for speed.
parent 395e4287
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
* - Added support for various assert and debugging macros for the UC3 devices * - Added support for various assert and debugging macros for the UC3 devices
* - Changed MIDI event structure MIDI_EventPacket_t to use a single field for the combined virtual cable index and command ID, to prevent bitfield packing issues * - Changed MIDI event structure MIDI_EventPacket_t to use a single field for the combined virtual cable index and command ID, to prevent bitfield packing issues
* on some architectures (thanks to Darren Gibbs) * on some architectures (thanks to Darren Gibbs)
* - Changed board LED driver implementations of LEDs_ToggleLEDs() for the AVR8 architecture to use the fast PIN register toggle alternative function for speed
* - Library Applications: * - Library Applications:
* - Raised the guard bits in the AVRISP-MKII clone project when in PDI and TPI to 32, to prevent communication errors on low quality connections to a target * - Raised the guard bits in the AVRISP-MKII clone project when in PDI and TPI to 32, to prevent communication errors on low quality connections to a target
* - Added additional bootloader API data to expose the bootloader start address and class to the DFU and CDC class bootloaders * - Added additional bootloader API data to expose the bootloader start address and class to the DFU and CDC class bootloaders
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
PORTE ^= LEDMask; PINE = LEDMask;
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) 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) ATTR_WARN_UNUSED_RESULT;
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
PORTC ^= LEDMask; PINC = LEDMask;
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
...@@ -139,8 +139,8 @@ ...@@ -139,8 +139,8 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
PORTF ^= (LEDMask & LEDS_PORTF_LEDS); PINF = (LEDMask & LEDS_PORTF_LEDS);
PORTE ^= (LEDMask & LEDS_PORTE_LEDS); PINE = (LEDMask & LEDS_PORTE_LEDS);
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) 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) ATTR_WARN_UNUSED_RESULT;
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
PORTC ^= LEDMask; PINC = LEDMask;
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
PORTB ^= LEDMask; PINB = LEDMask;
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
PORTE ^= LEDMask; PINE = LEDMask;
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
PORTC ^= LEDMask; PINC = LEDMask;
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) 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) ATTR_WARN_UNUSED_RESULT;
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) 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) ATTR_WARN_UNUSED_RESULT;
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
PORTB ^= LEDMask; PINB = LEDMask;
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
#define _BOARD_LED_CONCAT(Reg, Letter) _BOARD_LED_CONCAT2(Reg, Letter) #define _BOARD_LED_CONCAT(Reg, Letter) _BOARD_LED_CONCAT2(Reg, Letter)
#define _BOARD_LED_PORT _BOARD_LED_CONCAT(PORT, _BOARD_LED_PORTLETTER) #define _BOARD_LED_PORT _BOARD_LED_CONCAT(PORT, _BOARD_LED_PORTLETTER)
#define _BOARD_LED_PIN _BOARD_LED_CONCAT(PIN, _BOARD_LED_PORTLETTER)
#define _BOARD_LED_DDR _BOARD_LED_CONCAT(DDR, _BOARD_LED_PORTLETTER) #define _BOARD_LED_DDR _BOARD_LED_CONCAT(DDR, _BOARD_LED_PORTLETTER)
#endif #endif
...@@ -155,7 +156,7 @@ ...@@ -155,7 +156,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
_BOARD_LED_PORT ^= LEDMask; _BOARD_LED_PIN = LEDMask;
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) 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) ATTR_WARN_UNUSED_RESULT;
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) 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) ATTR_WARN_UNUSED_RESULT;
......
...@@ -139,8 +139,8 @@ ...@@ -139,8 +139,8 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
PORTD ^= (LEDMask & LEDS_PORTD_LEDS); PIND = (LEDMask & LEDS_PORTD_LEDS);
PORTC ^= (LEDMask & LEDS_PORTC_LEDS); PINC = (LEDMask & LEDS_PORTC_LEDS);
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) 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) ATTR_WARN_UNUSED_RESULT;
......
...@@ -154,9 +154,9 @@ ...@@ -154,9 +154,9 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
PORTB ^= (LEDMask & LEDS_PORTB_LEDS); PINB = (LEDMask & LEDS_PORTB_LEDS);
PORTD ^= ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT); PIND = ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT);
PORTE ^= (LEDMask & LEDS_PORTE_LEDS); PINE = (LEDMask & LEDS_PORTE_LEDS);
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
...@@ -146,9 +146,9 @@ ...@@ -146,9 +146,9 @@
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
{ {
PORTB ^= (LEDMask & LEDS_PORTB_LEDS); PINB = (LEDMask & LEDS_PORTB_LEDS);
PORTD ^= (LEDMask & LEDS_PORTD_LEDS); PIND = (LEDMask & LEDS_PORTD_LEDS);
PORTE ^= (LEDMask & LEDS_PORTE_LEDS); PINE = (LEDMask & LEDS_PORTE_LEDS);
} }
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment