Fixed SPI driver init function not clearing SPI2X bit when not needed.
[pub/USBasp.git] / LUFA / Drivers / Peripheral / SPI.h
index d8d60ed..66cdaf5 100644 (file)
                                          (PrescalerMask & ~SPI_USE_DOUBLESPEED));\r
                                \r
                                if (PrescalerMask & SPI_USE_DOUBLESPEED)\r
                                          (PrescalerMask & ~SPI_USE_DOUBLESPEED));\r
                                \r
                                if (PrescalerMask & SPI_USE_DOUBLESPEED)\r
-                                 SPSR = (1 << SPI2X);\r
+                                 SPSR |= (1 << SPI2X);\r
+                               else\r
+                                 SPSR &= ~(1 << SPI2X);\r
                        }\r
                        \r
                        /** Sends and receives a byte through the SPI interface, blocking until the transfer is complete.\r
                        }\r
                        \r
                        /** Sends and receives a byte through the SPI interface, blocking until the transfer is complete.\r