diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-01-07 12:38:32 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-01-07 12:38:32 +0000 |
commit | a56d95e8c2f77e0099014689221ca6881ef5563d (patch) | |
tree | 46049b4db2c06fb9e124c7b99c6b459539f21972 /LUFA/Drivers/Board/XPLAIN | |
parent | efb6c357784af2293a50b3fca9503c3a4c13a9e1 (diff) | |
download | lufa-a56d95e8c2f77e0099014689221ca6881ef5563d.tar.gz lufa-a56d95e8c2f77e0099014689221ca6881ef5563d.tar.bz2 lufa-a56d95e8c2f77e0099014689221ca6881ef5563d.zip |
Fix XPLAIN Dataflash and LED drivers.
Diffstat (limited to 'LUFA/Drivers/Board/XPLAIN')
-rw-r--r-- | LUFA/Drivers/Board/XPLAIN/Dataflash.h | 6 | ||||
-rw-r--r-- | LUFA/Drivers/Board/XPLAIN/LEDs.h | 14 |
2 files changed, 9 insertions, 11 deletions
diff --git a/LUFA/Drivers/Board/XPLAIN/Dataflash.h b/LUFA/Drivers/Board/XPLAIN/Dataflash.h index d793d306f..de71f29ed 100644 --- a/LUFA/Drivers/Board/XPLAIN/Dataflash.h +++ b/LUFA/Drivers/Board/XPLAIN/Dataflash.h @@ -72,7 +72,7 @@ /** Mask for the first dataflash chip selected. */
#define DATAFLASH_CHIP1 (1 << 5)
- #if BOAD == XPLAIN_REV1
+ #if (BOARD == BOARD_XPLAIN_REV1)
#define DATAFLASH_PAGE_SIZE 256
#define DATAFLASH_PAGES 2048
@@ -111,9 +111,7 @@ * \param[in] BufferByte Address within the dataflash's buffer
*/
static inline void Dataflash_SendAddressBytes(uint16_t PageAddress, const uint16_t BufferByte)
- {
- PageAddress >>= 1;
-
+ {
Dataflash_SendByte(PageAddress >> 5);
Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));
Dataflash_SendByte(BufferByte);
diff --git a/LUFA/Drivers/Board/XPLAIN/LEDs.h b/LUFA/Drivers/Board/XPLAIN/LEDs.h index 6951ce763..600be9f26 100644 --- a/LUFA/Drivers/Board/XPLAIN/LEDs.h +++ b/LUFA/Drivers/Board/XPLAIN/LEDs.h @@ -75,28 +75,28 @@ #if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
{
- DDRB |= LEDS_ALL_LEDS;
- PORTB &= ~LEDS_ALL_LEDS;
+ DDRB |= LEDS_ALL_LEDS;
+ PORTB |= LEDS_ALL_LEDS;
}
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
- PORTB |= LEDMask;
+ PORTB &= ~LEDMask;
}
static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
{
- PORTB &= ~LEDMask;
+ PORTB |= LEDMask;
}
static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
{
- PORTB = ((PORTB & ~LEDS_ALL_LEDS) | LEDMask);
+ PORTB = ((PORTB | LEDS_ALL_LEDS) & ~LEDMask);
}
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask)
{
- PORTB = ((PORTB & ~(LEDMask & LEDS_ALL_LEDS)) | (ActiveMask & LEDS_ALL_LEDS));
+ PORTB = ((PORTB | (LEDMask & LEDS_ALL_LEDS)) & (~ActiveMask & LEDS_ALL_LEDS));
}
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
@@ -107,7 +107,7 @@ static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
- return (PORTB & LEDS_ALL_LEDS);
+ return (~PORTB & LEDS_ALL_LEDS);
}
#endif
|