Some tricks for old compatibility.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 6 Sep 2011 08:40:36 +0000 (08:40 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 6 Sep 2011 08:40:36 +0000 (08:40 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5021 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/drv/sd.c
bertos/drv/sd.h

index 441ff8b1501cca2233439049efef0f55686887a7..820873eda9478a27cf6fcbcf1b1fbe6804c8655e 100644 (file)
 
 #include <string.h>
 
+
+#ifdef SD_INCLUDE_SPI_SOURCE
+       #include <drv/sd_spi.c>
+#endif
+
 void sd_writeTest(Sd *sd)
 {
        uint8_t buf[SD_DEFAULT_BLOCKLEN];
index d01b56f131582e8360f0e99902e8d379614108a9..3e6ca6f373d5b56a17a34bd30146047bea8a7503 100644 (file)
@@ -182,8 +182,14 @@ INLINE int sd_setBus1bit(Sd *sd)
 
 #endif
 
+// For old compatibility.
+#ifndef CONFIG_SD_MODE
+       #define CONFIG_SD_MODE  SD_SPI_MODE
+       #define SD_INCLUDE_SPI_SOURCE
+#endif
 
 #if CONFIG_SD_OLD_INIT
+
        #if !(ARCH & ARCH_NIGHTTEST)
                #warning "Deprecated: this API will be removed in the next major release,"
                #warning "please disable CONFIG_SD_OLD_INIT and pass explicitly the SD context to sd_init()."