/** Mask for the first dataflash chip selected. */\r
#define DATAFLASH_CHIP1 (1 << 5)\r
\r
- #if BOAD == XPLAIN_REV1\r
+ #if (BOARD == BOARD_XPLAIN_REV1)\r
#define DATAFLASH_PAGE_SIZE 256\r
\r
#define DATAFLASH_PAGES 2048 \r
* \param[in] BufferByte Address within the dataflash's buffer\r
*/\r
static inline void Dataflash_SendAddressBytes(uint16_t PageAddress, const uint16_t BufferByte)\r
- { \r
- PageAddress >>= 1;\r
- \r
+ {\r
Dataflash_SendByte(PageAddress >> 5);\r
Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));\r
Dataflash_SendByte(BufferByte);\r
#if !defined(__DOXYGEN__)\r
static inline void LEDs_Init(void)\r
{\r
- DDRB |= LEDS_ALL_LEDS;\r
- PORTB &= ~LEDS_ALL_LEDS;\r
+ DDRB |= LEDS_ALL_LEDS;\r
+ PORTB |= LEDS_ALL_LEDS;\r
}\r
\r
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)\r
{\r
- PORTB |= LEDMask;\r
+ PORTB &= ~LEDMask;\r
}\r
\r
static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)\r
{\r
- PORTB &= ~LEDMask;\r
+ PORTB |= LEDMask;\r
}\r
\r
static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)\r
{\r
- PORTB = ((PORTB & ~LEDS_ALL_LEDS) | LEDMask);\r
+ PORTB = ((PORTB | LEDS_ALL_LEDS) & ~LEDMask);\r
}\r
\r
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask)\r
{\r
- PORTB = ((PORTB & ~(LEDMask & LEDS_ALL_LEDS)) | (ActiveMask & LEDS_ALL_LEDS));\r
+ PORTB = ((PORTB | (LEDMask & LEDS_ALL_LEDS)) & (~ActiveMask & LEDS_ALL_LEDS));\r
}\r
\r
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)\r
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;\r
static inline uint8_t LEDs_GetLEDs(void)\r
{\r
- return (PORTB & LEDS_ALL_LEDS);\r
+ return (~PORTB & LEDS_ALL_LEDS);\r
}\r
#endif\r
\r
#if (defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__) || \\r
defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega8U2__))\r
#define USB_SERIES_2_AVR\r
- #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))\r
+ #elif (defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__))\r
#define USB_SERIES_4_AVR\r
#elif (defined(__AVR_ATmega32U6__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__))\r
#define USB_SERIES_6_AVR\r
* - Fixed AVRISP PDI race condition where the guard time between direction changes could be interpreted as a start bit\r
* - Fixed ADC_IsReadingComplete() returning an inverted result\r
* - Fixed blocking CDC streams not aborting when the host is disconnected\r
+ * - Fixed XPLAIN board Dataflash driver broken due to incorrect preprocessor commands\r
+ * - Fixed inverted XPLAIN LED driver output (LED turned on when it was supposed to be turned off, and vice-versa)\r
*\r
* \section Sec_ChangeLog091223 Version 091223\r
*\r