-
Notifications
You must be signed in to change notification settings - Fork 6
/
Sconscript
204 lines (180 loc) · 8.12 KB
/
Sconscript
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
Import('RTT_ROOT')
Import('rtconfig')
from building import *
import os
# get current directory
cwd = GetCurrentDir()
if GetDepend(['PKG_USING_NRF5X_SDK']):
if GetDepend('SOC_NRF52840') == True:
source = cwd + r'\templete_project\pca10056\template.*'
elif GetDepend('SOC_NRF52832') == True:
source = cwd + r'\templete_project\pca10040\template.*'
elif GetDepend('SOC_NRF52833') == True:
source = cwd + r'\templete_project\pca10100\template.*'
target = cwd + r'"\..\..\"'
copy_command = 'copy "' + source + r'" "' + target + r'"'
print(copy_command)
os.system(copy_command)
path = []
CPPDEFINES = []
NRF_BLE_SRC = Split('''
./components/ble/ble_db_discovery/ble_db_discovery.c
./components/ble/common/ble_advdata.c
./components/ble/common/ble_srv_common.c
./components/ble/common/ble_conn_state.c
./components/ble/nrf_ble_gatt/nrf_ble_gatt.c
./components/ble/nrf_ble_gq/nrf_ble_gq.c
./components/ble/nrf_ble_scan/nrf_ble_scan.c
./components/ble/nrf_ble_qwr/nrf_ble_qwr.c
./components/ble/ble_link_ctx_manager/ble_link_ctx_manager.c
./components/ble/ble_advertising/ble_advertising.c
./rtt_adapter/ble_conn_params_rtt.c
./integration/nrfx/legacy/nrf_drv_clock.c
''')
path += [cwd + '/components/ble/ble_db_discovery']
path += [cwd + '/components/ble/common']
path += [cwd + '/components/ble/nrf_ble_gatt']
path += [cwd + '/components/ble/nrf_ble_gq']
path += [cwd + '/components/ble/nrf_ble_scan']
path += [cwd + '/components/ble/nrf_ble_qwr']
path += [cwd + '/components/ble/ble_link_ctx_manager']
path += [cwd + '/components/ble/ble_advertising']
NRF_SOFTDEVICE_SRC = Split('''
./components/softdevice/common/nrf_sdh.c
./components/softdevice/common/nrf_sdh_ble.c
./components/softdevice/common/nrf_sdh_soc.c
''')
path += [cwd + '/components/softdevice/common']
NRF_LIBRARIES_SRC = Split('''
./components/libraries/util/app_error.c
./components/libraries/util/app_error_handler_keil.c
./components/libraries/util/app_error_weak.c
./components/libraries/scheduler/app_scheduler.c
./components/libraries/fifo/app_fifo.c
./components/libraries/util/app_util_platform.c
./components/libraries/hardfault/hardfault_implementation.c
./components/libraries/util/nrf_assert.c
./components/libraries/atomic/nrf_atomic.c
./components/libraries/atomic_fifo/nrf_atfifo.c
./components/libraries/atomic_flags/nrf_atflags.c
./components/libraries/balloc/nrf_balloc.c
./components/libraries/memobj/nrf_memobj.c
./components/libraries/queue/nrf_queue.c
./components/libraries/ringbuf/nrf_ringbuf.c
./components/libraries/experimental_section_vars/nrf_section_iter.c
./components/libraries/sortlist/nrf_sortlist.c
./components/libraries/strerror/nrf_strerror.c
./components/libraries/sensorsim/sensorsim.c
''')
path += [cwd + '/components/libraries/util']
path += [cwd + '/components/libraries/scheduler']
path += [cwd + '/components/libraries/timer']
path += [cwd + '/components/libraries/fifo']
path += [cwd + '/components/libraries/hardfault']
path += [cwd + '/components/libraries/atomic']
path += [cwd + '/components/libraries/atomic_fifo']
path += [cwd + '/components/libraries/atomic_flags']
path += [cwd + '/components/libraries/balloc']
path += [cwd + '/components/libraries/memobj']
path += [cwd + '/components/libraries/queue']
path += [cwd + '/components/libraries/ringbuf']
path += [cwd + '/components/libraries/experimental_section_vars']
path += [cwd + '/components/libraries/sortlist']
path += [cwd + '/components/libraries/strerror']
path += [cwd + '/components/libraries/log']
path += [cwd + '/components/libraries/log/src']
path += [cwd + '/components/libraries/sensorsim']
# ./integration/nrfx/legacy/nrf_drv_clock.c
NRF_NRFX_SRC = Split('''
''')
path += [cwd + '/components/softdevice/common']
if GetDepend('SOC_NRF52840') == True:
path += [cwd + '/components/softdevice/s140/headers']
path += [cwd + '/components/softdevice/s140/headers/nrf52']
if GetDepend('SOC_NRF52832') == True:
path += [cwd + '/components/softdevice/s132/headers']
path += [cwd + '/components/softdevice/s132/headers/nrf52']
if GetDepend('SOC_NRF52833') == True:
path += [cwd + '/components/softdevice/s140/headers']
path += [cwd + '/components/softdevice/s140/headers/nrf52']
path += [cwd + '/integration/nrfx/legacy']
CPPDEFINES = ['SOFTDEVICE_PRESENT', 'CONFIG_GPIO_AS_PINRESET']
NRF_BLE_SERVICE_SRC = []
if GetDepend('SD_BLE_APP_UART_C') == True:
NRF_BLE_SERVICE_SRC += Split('''
./rtt_adapter/ble_app_uart_c.c
''')
NRF_BLE_SERVICE_SRC += Split('''
./components/ble/ble_services/ble_nus_c/ble_nus_c.c
''')
path += [cwd + '/components/ble/ble_services/ble_nus_c']
if GetDepend('SD_BLE_APP_BEACON') == True:
NRF_BLE_SERVICE_SRC += Split('''
./rtt_adapter/ble_app_beacon.c
''')
if GetDepend('SD_BLE_APP_BLINKY') == True:
NRF_BLE_SERVICE_SRC += Split('''
./rtt_adapter/ble_app_blinky.c
''')
NRF_BLE_SERVICE_SRC += Split('''
./components/ble/ble_services/ble_lbs/ble_lbs.c
''')
path += [cwd + '/components/ble/ble_services/ble_lbs']
if GetDepend('SD_BLE_APP_UART') == True:
NRF_BLE_SERVICE_SRC += Split('''
./rtt_adapter/ble_app_uart.c
''')
NRF_BLE_SERVICE_SRC += Split('''
./components/ble/ble_services/ble_nus/ble_nus.c
''')
path += [cwd + '/components/ble/ble_services/ble_nus']
if GetDepend('SD_BLE_APP_HRS') == True:
NRF_BLE_SERVICE_SRC += Split('''
./rtt_adapter/ble_app_hrs.c
''')
NRF_BLE_SERVICE_SRC += Split('''
./components/ble/ble_services/ble_hrs/ble_hrs.c
''')
path += [cwd + '/components/ble/ble_services/ble_hrs']
NRF_BLE_SERVICE_SRC += Split('''
./components/ble/ble_services/ble_dis/ble_dis.c
''')
path += [cwd + '/components/ble/ble_services/ble_dis']
NRF_BLE_SERVICE_SRC += Split('''
./components/ble/ble_services/ble_bas/ble_bas.c
''')
path += [cwd + '/components/ble/ble_services/ble_bas']
NRF_BLE_SERVICE_SRC += Split('''
./components/ble/ble_services/ble_lbs/ble_lbs.c
''')
path += [cwd + '/components/ble/ble_services/ble_lbs']
if GetDepend('SD_BLE_APP_BAS') == True:
NRF_BLE_SERVICE_SRC += Split('''
./rtt_adapter/ble_app_bas.c
''')
NRF_BLE_SERVICE_SRC += Split('''
./components/ble/ble_services/ble_bas/ble_bas.c
''')
path += [cwd + '/components/ble/ble_services/ble_bas']
group = DefineGroup('nRF_NRFX', NRF_NRFX_SRC, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('nRF_BLE', NRF_BLE_SRC, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('nRF_BLE_Services', NRF_BLE_SERVICE_SRC, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('nRF_SoftDevice', NRF_SOFTDEVICE_SRC, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
group = DefineGroup('nRF_Libraries', NRF_LIBRARIES_SRC, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
else:
NRF_NRFX_SRC = Split('''
''')
NRF_BLE_SRC = Split('''
''')
NRF_BLE_SERVICE_SRC = Split('''
''')
NRF_SOFTDEVICE_SRC = Split('''
''')
NRF_LIBRARIES_SRC = Split('''
''')
group = DefineGroup('nRF_NRFX', NRF_NRFX_SRC, depend = [''])
group = DefineGroup('nRF_BLE', NRF_BLE_SRC, depend = [''])
group = DefineGroup('nRF_BLE_Services', NRF_BLE_SERVICE_SRC, depend = [''])
group = DefineGroup('nRF_SoftDevice', NRF_SOFTDEVICE_SRC, depend = [''])
group = DefineGroup('nRF_Libraries', NRF_LIBRARIES_SRC, depend = [''])
Return('group')