Set SDCard::_cs pin to be an output.
authorAdam Green <adamgr@foo.bar>
Sat, 2 Feb 2013 07:03:49 +0000 (23:03 -0800)
committerAdam Green <adamgr@foo.bar>
Sat, 2 Feb 2013 07:03:49 +0000 (23:03 -0800)
Smoothie didn't work with my 16GB SD card and it turns out that the
chip select GPIO pin wasn't being set to output mode.

src/libs/USBDevice/USBMSD/SDCard.cpp

index 2f093eb..4cba21c 100644 (file)
@@ -128,7 +128,8 @@ static const uint8_t OXFF = 0xFF;
 \r
 SDCard::SDCard(PinName mosi, PinName miso, PinName sclk, PinName cs) :\r
   _spi(mosi, miso, sclk), _cs(cs) {\r
-      _cs = 0;\r
+    _cs.output();\r
+    _cs = 1;\r
 }\r
 \r
 #define R1_IDLE_STATE           (1 << 0)\r