瀏覽代碼

[DeviceDriver] Add RT_USING_QSPI macro.

armink 6 年之前
父節點
當前提交
7a6034fdf7
共有 2 個文件被更改,包括 10 次插入2 次删除
  1. 6 1
      components/drivers/Kconfig
  2. 4 1
      components/drivers/spi/SConscript

+ 6 - 1
components/drivers/Kconfig

@@ -168,7 +168,11 @@ config RT_USING_SPI
     bool "Using SPI Bus/Device device drivers"
     default n
 
-    if RT_USING_SPI
+    if RT_USING_SPI  
+        config RT_USING_QSPI
+            bool "Enable QSPI mode"
+            default n
+
         config RT_USING_SPI_MSD
             bool "Using SD/TF card driver with spi"
             select RT_USING_DFS
@@ -188,6 +192,7 @@ config RT_USING_SPI
                 
                 config RT_SFUD_USING_QSPI
                 bool "Using QSPI mode support"
+                select RT_USING_QSPI
                 default n
 
                 config RT_DEBUG_SFUD

+ 4 - 1
components/drivers/spi/SConscript

@@ -2,10 +2,13 @@ from building import *
 import rtconfig
 
 cwd = GetCurrentDir()
-src = ['spi_core.c', 'spi_dev.c', 'qspi_core.c']
+src = ['spi_core.c', 'spi_dev.c']
 CPPPATH = [cwd, cwd + '/../include']
 LOCAL_CCFLAGS = ''
 
+if GetDepend('RT_USING_QSPI'):
+    src += ['qspi_core.c']
+
 src_device = []
 
 if GetDepend('RT_USING_SPI_WIFI'):