@@ -62,6 +62,14 @@ declare_args() {
62
62
show_qr_code = true
63
63
}
64
64
65
+ # Sanity check
66
+ assert (! (chip_enable_wifi && chip_enable_openthread ))
67
+ assert (! (use_rs911x && chip_enable_openthread ))
68
+ assert (! (use_wf200 && chip_enable_openthread ))
69
+ if (chip_enable_wifi ) {
70
+ assert (use_rs911x || use_wf200 )
71
+ }
72
+
65
73
# BRD4166A --> ThunderBoard Sense 2 (No LCD)
66
74
if (efr32_board == " BRD4166A" || efr32_board == " BRD4180A" ) {
67
75
show_qr_code = false
@@ -70,17 +78,10 @@ if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") {
70
78
# Enables LCD on supported devices
71
79
lcd_on = show_qr_code
72
80
73
- if (use_rs911x || use_wf200 ) {
81
+ # WiFi settings
82
+ if (chip_enable_wifi ) {
74
83
wifi_sdk_dir = " ${ chip_root } /third_party/efr32_sdk/repo/matter/wifi"
75
- if (use_rs911x ) {
76
- wiseconnect_sdk_root = " ${ chip_root } /third_party/wiseconnect-wifi-bt-sdk"
77
- import (" ${ wifi_sdk_dir } /rs911x/rs911x.gni" )
78
- } else {
79
- import (" ${ wifi_sdk_dir } /wf200/wf200.gni" )
80
- }
81
- }
82
- efr32_lwip_defs = [ " LWIP_NETIF_API=1" ]
83
- if (use_rs911x || use_wf200 ) {
84
+ efr32_lwip_defs = [ " LWIP_NETIF_API=1" ]
84
85
efr32_lwip_defs += [
85
86
" LWIP_IPV4=1" ,
86
87
" LWIP_ARP=1" ,
@@ -89,6 +90,13 @@ if (use_rs911x || use_wf200) {
89
90
" LWIP_IPV6_ND=1" ,
90
91
" LWIP_IGMP=1" ,
91
92
]
93
+
94
+ if (use_rs911x ) {
95
+ wiseconnect_sdk_root = " ${ chip_root } /third_party/wiseconnect-wifi-bt-sdk"
96
+ import (" ${ wifi_sdk_dir } /rs911x/rs911x.gni" )
97
+ } else {
98
+ import (" ${ wifi_sdk_dir } /wf200/wf200.gni" )
99
+ }
92
100
}
93
101
94
102
efr32_sdk (" sdk" ) {
@@ -117,25 +125,25 @@ efr32_sdk("sdk") {
117
125
" PW_RPC_ENABLED" ,
118
126
]
119
127
}
120
- if (use_rs911x ) {
121
- defines += rs911x_defs
122
- include_dirs += rs911x_plat_incs
123
- } else if (use_wf200 ) {
124
- defines += wf200_defs
125
- include_dirs += wf200_plat_incs
126
- }
127
128
128
- if (use_rs911x_sockets ) {
129
- include_dirs += [ " ${ examples_plat_dir } /wifi/rsi-sockets" ]
130
- defines += rs911x_sock_defs
131
- } else {
132
- # Using LWIP instead of the native TCP/IP stack
133
- # Thread also uses LWIP
134
- #
135
- defines += efr32_lwip_defs
136
- }
129
+ # WiFi Settings
130
+ if (chip_enable_wifi ) {
131
+ if (use_rs911x ) {
132
+ defines += rs911x_defs
133
+ include_dirs += rs911x_plat_incs
134
+ } else if (use_wf200 ) {
135
+ defines += wf200_defs
136
+ include_dirs += wf200_plat_incs
137
+ }
138
+
139
+ if (use_rs911x_sockets ) {
140
+ include_dirs += [ " ${ examples_plat_dir } /wifi/rsi-sockets" ]
141
+ defines += rs911x_sock_defs
142
+ } else {
143
+ # Using LWIP instead of the native TCP/IP stack
144
+ defines += efr32_lwip_defs
145
+ }
137
146
138
- if (use_rs911x || use_wf200 ) {
139
147
if (sl_wfx_config_softap ) {
140
148
defines += [ " SL_WFX_CONFIG_SOFTAP" ]
141
149
}
@@ -171,7 +179,9 @@ efr32_executable("light_switch_app") {
171
179
" ${ chip_root } /src/lib" ,
172
180
" ${ chip_root } /src/setup_payload" ,
173
181
]
174
- if (! use_rs911x && ! use_wf200 ) {
182
+
183
+ # OpenThread Settings
184
+ if (chip_enable_openthread ) {
175
185
deps += [
176
186
" ${ chip_root } /third_party/openthread/platforms:libopenthread-platform" ,
177
187
" ${ chip_root } /third_party/openthread/platforms:libopenthread-platform-utils" ,
@@ -195,30 +205,33 @@ efr32_executable("light_switch_app") {
195
205
sources += [ " ${ examples_plat_dir } /OTAConfig.cpp" ]
196
206
}
197
207
198
- if (use_rs911x ) {
199
- sources += rs911x_src_plat
200
-
201
- # All the stuff from wiseconnect
202
- sources += rs911x_src_sapi
203
-
204
- # Apparently - the rsi library needs this (though we may not use use it)
205
- sources += rs911x_src_sock
206
- include_dirs += rs911x_inc_plat
207
-
208
- if (use_rs911x_sockets ) {
209
- #
210
- # Using native sockets inside RS911x
211
- #
212
- include_dirs += rs911x_sock_inc
213
- } else {
214
- #
215
- # We use LWIP - not built-in sockets
216
- #
217
- sources += rs911x_src_lwip
208
+ # WiFi Settings
209
+ if (chip_enable_wifi ) {
210
+ if (use_rs911x ) {
211
+ sources += rs911x_src_plat
212
+
213
+ # All the stuff from wiseconnect
214
+ sources += rs911x_src_sapi
215
+
216
+ # Apparently - the rsi library needs this (though we may not use use it)
217
+ sources += rs911x_src_sock
218
+ include_dirs += rs911x_inc_plat
219
+
220
+ if (use_rs911x_sockets ) {
221
+ #
222
+ # Using native sockets inside RS911x
223
+ #
224
+ include_dirs += rs911x_sock_inc
225
+ } else {
226
+ #
227
+ # We use LWIP - not built-in sockets
228
+ #
229
+ sources += rs911x_src_lwip
230
+ }
231
+ } else if (use_wf200 ) {
232
+ sources += wf200_plat_src
233
+ include_dirs += wf200_plat_incs
218
234
}
219
- } else if (use_wf200 ) {
220
- sources += wf200_plat_src
221
- include_dirs += wf200_plat_incs
222
235
}
223
236
224
237
if (lcd_on ) {
@@ -285,6 +298,14 @@ efr32_executable("light_switch_app") {
285
298
]
286
299
}
287
300
301
+ # WiFi Settings
302
+ if (chip_enable_wifi ) {
303
+ ldflags += [
304
+ " -Wl,--defsym" ,
305
+ " -Wl,SILABS_WIFI=1" ,
306
+ ]
307
+ }
308
+
288
309
output_dir = root_out_dir
289
310
}
290
311
0 commit comments