mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-19 13:54:23 +01:00
Fixing SPI double-speed bug.
Bad bit manipulation was causing the double-speed flag to be set incorrectly. http://code.google.com/p/arduino/issues/detail?id=365
This commit is contained in:
parent
224a7bf768
commit
b24895385a
@ -56,6 +56,6 @@ void SPIClass::setDataMode(uint8_t mode)
|
||||
void SPIClass::setClockDivider(uint8_t rate)
|
||||
{
|
||||
SPCR = (SPCR & ~SPI_CLOCK_MASK) | (rate & SPI_CLOCK_MASK);
|
||||
SPSR = (SPSR & ~SPI_2XCLOCK_MASK) | (rate & SPI_2XCLOCK_MASK);
|
||||
SPSR = (SPSR & ~SPI_2XCLOCK_MASK) | ((rate >> 2) & SPI_2XCLOCK_MASK);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user