summaryrefslogtreecommitdiff
path: root/components/drivers/spi/SConscript
blob: a48767cb25da5f86b47e654b5df7e9a4093c3a6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from building import *
from gcc import *
import rtconfig

cwd = GetCurrentDir()
src = ['dev_spi_core.c', 'dev_spi.c']
CPPPATH = [cwd, cwd + '/../include']
LOCAL_CFLAGS = ''

if GetDepend('RT_USING_SPI_BITOPS'):
    src += ['dev_spi_bit_ops.c']

if GetDepend('RT_USING_SOFT_SPI'):
    src += ['dev_soft_spi.c']

if GetDepend('RT_USING_QSPI'):
    src += ['dev_qspi_core.c']

src_device = []

if GetDepend('RT_USING_SPI_WIFI'):
    src_device += ['dev_spi_wifi_rw009.c']

if GetDepend('RT_USING_ENC28J60'):
    src_device += ['enc28j60.c']

if GetDepend('RT_USING_SPI_MSD'):
    src_device += ['dev_spi_msd.c']

if GetDepend('RT_USING_SFUD'):
    src_device += ['dev_spi_flash_sfud.c', 'sfud/src/sfud.c']
    CPPPATH += [cwd + '/sfud/inc']
    if GetDepend('RT_SFUD_USING_SFDP'):
        src_device += ['sfud/src/sfud_sfdp.c']

    if not GetDepend('RT_USING_DM'):
        if rtconfig.PLATFORM in GetGCCLikePLATFORM():
            LOCAL_CFLAGS += ' -std=c99'
        elif rtconfig.PLATFORM in ['armcc']:
            LOCAL_CFLAGS += ' --c99'

if GetDepend('RT_USING_DM'):
    src += ['dev_spi_dm.c', 'dev_spi_bus.c']

src += src_device

group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SPI'], CPPPATH = CPPPATH, LOCAL_CFLAGS = LOCAL_CFLAGS)

Return('group')