Skip to content

Commit f31c1c5

Browse files
[Silabs] Bugfix/redundant 917 ifdef (project-chip#32470)
* SIWX_917 * SI917 * Renamed SiWx917 to SLI_917_SOC for clarity, removed unused defines from SiWx917.gni file * Using SLI_SI91X_MCU_INTERFACE instead of SIWX_917
1 parent 9d2f350 commit f31c1c5

21 files changed

+631
-644
lines changed

examples/lighting-app/silabs/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
#include <platform/CHIPDeviceLayer.h>
4242

43-
#if (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917))
43+
#ifdef SL_CATALOG_SIMPLE_LED_LED1_PRESENT
4444
#define LIGHT_LED 1
4545
#else
4646
#define LIGHT_LED 0

examples/platform/silabs/BaseApplication.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
#define APP_EVENT_QUEUE_SIZE 10
8383
#define EXAMPLE_VENDOR_ID 0xcafe
8484

85-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
85+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
8686
#define SYSTEM_STATE_LED 0
8787
#endif // ENABLE_WSTK_LEDS
8888
#define APP_FUNCTION_BUTTON 0
@@ -104,7 +104,7 @@ TimerHandle_t sLightTimer;
104104
TaskHandle_t sAppTaskHandle;
105105
QueueHandle_t sAppEventQueue;
106106

107-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
107+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
108108
LEDWidget sStatusLED;
109109
#endif // ENABLE_WSTK_LEDS
110110

@@ -270,7 +270,7 @@ CHIP_ERROR BaseApplication::Init()
270270
ConfigurationMgr().LogDeviceConfig();
271271

272272
OutputQrCode(true /*refreshLCD at init*/);
273-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
273+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
274274
LEDWidget::InitGpio();
275275
sStatusLED.Init(SYSTEM_STATE_LED);
276276
#endif // ENABLE_WSTK_LEDS
@@ -321,7 +321,7 @@ void BaseApplication::FunctionEventHandler(AppEvent * aEvent)
321321
bool BaseApplication::ActivateStatusLedPatterns()
322322
{
323323
bool isPatternSet = false;
324-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
324+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
325325
#ifdef MATTER_DM_PLUGIN_IDENTIFY_SERVER
326326
if (gIdentify.mActive)
327327
{
@@ -427,7 +427,7 @@ void BaseApplication::LightEventHandler()
427427
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
428428

429429
#if defined(ENABLE_WSTK_LEDS)
430-
#if (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917))
430+
#ifdef SL_CATALOG_SIMPLE_LED_LED1_PRESENT
431431
// Update the status LED if factory reset has not been initiated.
432432
//
433433
// If system has "full connectivity", keep the LED On constantly.
@@ -563,7 +563,7 @@ void BaseApplication::StartFactoryResetSequence()
563563
StartStatusLEDTimer();
564564
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
565565

566-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
566+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
567567
// Turn off all LEDs before starting blink to make sure blink is
568568
// co-ordinated.
569569
sStatusLED.Set(false);
@@ -596,7 +596,7 @@ void BaseApplication::StartStatusLEDTimer()
596596

597597
void BaseApplication::StopStatusLEDTimer()
598598
{
599-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
599+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
600600
sStatusLED.Set(false);
601601
#endif // ENABLE_WSTK_LEDS
602602

examples/platform/silabs/FreeRTOSConfig.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ extern "C" {
107107

108108
#include <stdint.h>
109109

110-
#ifdef SIWX_917
110+
#ifdef SLI_SI91X_MCU_INTERFACE
111111
#include "si91x_device.h"
112112
extern uint32_t SystemCoreClock;
113113
#else // For EFR32
@@ -169,23 +169,23 @@ extern uint32_t SystemCoreClock;
169169
#define configTIMER_QUEUE_LENGTH (10)
170170
#define configTIMER_TASK_STACK_DEPTH (1024)
171171

172-
#ifdef SIWX_917
172+
#ifdef SLI_SI91X_MCU_INTERFACE
173173
#ifdef __NVIC_PRIO_BITS
174174
#undef __NVIC_PRIO_BITS
175175
#endif
176176
#define configPRIO_BITS 6 /* 6 priority levels. */
177-
#endif // SIWX_917
177+
#endif // SLI_SI91X_MCU_INTERFACE
178178

179179
/* Interrupt priorities used by the kernel port layer itself. These are generic
180180
to all Cortex-M ports, and do not rely on any particular library functions. */
181181
#define configKERNEL_INTERRUPT_PRIORITY (255)
182182
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
183183
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
184-
#ifdef SIWX_917
184+
#ifdef SLI_SI91X_MCU_INTERFACE
185185
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 20
186186
#else
187187
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 48
188-
#endif // SIWX_917
188+
#endif // SLI_SI91X_MCU_INTERFACE
189189

190190
#define configENABLE_FPU 0
191191
#define configENABLE_MPU 0
@@ -232,11 +232,11 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
232232
#ifndef configTOTAL_HEAP_SIZE
233233
#ifdef SL_WIFI
234234
#ifdef DIC_ENABLE
235-
#ifdef SIWX_917
235+
#ifdef SLI_SI91X_MCU_INTERFACE
236236
#define configTOTAL_HEAP_SIZE ((size_t) ((75 + EXTRA_HEAP_k) * 1024))
237237
#else
238238
#define configTOTAL_HEAP_SIZE ((size_t) ((68 + EXTRA_HEAP_k) * 1024))
239-
#endif // SIWX_917
239+
#endif // SLI_SI91X_MCU_INTERFACE
240240
#else
241241
#define configTOTAL_HEAP_SIZE ((size_t) ((42 + EXTRA_HEAP_k) * 1024))
242242
#endif // DIC

examples/platform/silabs/MatterConfig.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
#include "MemMonitoring.h"
4343
#endif
4444

45-
#ifdef SIWX_917
45+
#ifdef SLI_SI91X_MCU_INTERFACE
4646
#include "wfx_rsi.h"
47-
#endif /* SIWX_917 */
47+
#endif /* SLI_SI91X_MCU_INTERFACE */
4848

4949
using namespace ::chip;
5050
using namespace ::chip::Inet;
@@ -53,7 +53,7 @@ using namespace ::chip::DeviceLayer;
5353
#include <crypto/CHIPCryptoPAL.h>
5454
// If building with the EFR32-provided crypto backend, we can use the
5555
// opaque keystore
56-
#if CHIP_CRYPTO_PLATFORM && !(defined(SIWX_917))
56+
#if CHIP_CRYPTO_PLATFORM && !(defined(SLI_SI91X_MCU_INTERFACE))
5757
#include <platform/silabs/efr32/Efr32PsaOperationalKeystore.h>
5858
static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeystore;
5959
#endif
@@ -229,7 +229,7 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
229229
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
230230
#endif // SILABS_TEST_EVENT_TRIGGER_ENABLED
231231

232-
#if CHIP_CRYPTO_PLATFORM && !(defined(SIWX_917))
232+
#if CHIP_CRYPTO_PLATFORM && !(defined(SLI_SI91X_MCU_INTERFACE))
233233
// When building with EFR32 crypto, use the opaque key store
234234
// instead of the default (insecure) one.
235235
gOperationalKeystore.Init();
@@ -289,13 +289,13 @@ CHIP_ERROR SilabsMatterConfig::InitWiFi(void)
289289
#endif // SL_WFX_USE_SECURE_LINK
290290
#endif /* WF200_WIFI */
291291

292-
#ifdef SIWX_917
292+
#ifdef SLI_SI91X_MCU_INTERFACE
293293
sl_status_t status;
294294
if ((status = wfx_wifi_rsi_init()) != SL_STATUS_OK)
295295
{
296296
ReturnErrorOnFailure((CHIP_ERROR) status);
297297
}
298-
#endif // SIWX_917
298+
#endif // SLI_SI91X_MCU_INTERFACE
299299

300300
return CHIP_NO_ERROR;
301301
}
@@ -306,7 +306,7 @@ CHIP_ERROR SilabsMatterConfig::InitWiFi(void)
306306
// ================================================================================
307307
extern "C" void vApplicationIdleHook(void)
308308
{
309-
#if SIWX_917 && CHIP_CONFIG_ENABLE_ICD_SERVER
309+
#if SLI_SI91X_MCU_INTERFACE && CHIP_CONFIG_ENABLE_ICD_SERVER
310310
sl_wfx_host_si91x_sleep_wakeup();
311311
#endif
312312
}

examples/platform/silabs/OTAConfig.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "silabs_utils.h"
2121
#include <app/server/Server.h>
2222

23-
#ifndef SIWX_917
23+
#ifndef SLI_SI91X_MCU_INTERFACE
2424

2525
#include "application_properties.h"
2626

@@ -75,7 +75,7 @@ __attribute__((used)) ApplicationProperties_t sl_app_properties = {
7575
.longTokenSectionAddress = NULL,
7676
};
7777
#endif // SL_CATALOG_GECKO_BOOTLOADER_INTERFACE_PRESENT
78-
#endif // SIWX_917
78+
#endif // SLI_SI91X_MCU_INTERFACE
7979

8080
// Global OTA objects
8181
chip::DefaultOTARequestor gRequestorCore;

examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
#include "ble_config.h"
4343

44-
#if SL_ICD_ENABLED && SIWX_917
44+
#if SL_ICD_ENABLED && SLI_SI91X_MCU_INTERFACE
4545
#include "rsi_rom_power_save.h"
4646
#include "sl_si91x_button_pin_config.h"
4747
#include "sl_si91x_driver.h"
@@ -50,7 +50,7 @@
5050
// TODO: should be removed once we are getting the press interrupt for button 0 with sleep
5151
#define BUTTON_PRESSED 1
5252
bool btn0_pressed = false;
53-
#endif // SL_ICD_ENABLED && SIWX_917
53+
#endif // SL_ICD_ENABLED && SLI_SI91X_MCU_INTERFACE
5454

5555
#include "dhcp_client.h"
5656
#include "sl_wifi.h"
@@ -63,10 +63,10 @@ bool btn0_pressed = false;
6363
#define ADV_MULTIPROBE 1
6464
#define ADV_SCAN_PERIODICITY 10
6565

66-
#ifdef SIWX_917
66+
#if SLI_SI91X_MCU_INTERFACE
6767
#include "sl_si91x_trng.h"
6868
#define TRNGKEY_SIZE 4
69-
#endif // SIWX_917
69+
#endif // SLI_SI91X_MCU_INTERFACE
7070

7171
struct wfx_rsi wfx_rsi;
7272

@@ -215,7 +215,7 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t
215215

216216
#if SL_ICD_ENABLED
217217

218-
#if SIWX_917
218+
#if SLI_SI91X_MCU_INTERFACE
219219
/******************************************************************
220220
* @fn sl_wfx_host_si91x_sleep_wakeup()
221221
* @brief
@@ -250,7 +250,7 @@ void sl_wfx_host_si91x_sleep_wakeup()
250250
}
251251
}
252252
}
253-
#endif /* SIWX_917 */
253+
#endif // SLI_SI91X_MCU_INTERFACE
254254

255255
/******************************************************************
256256
* @fn wfx_rsi_power_save()
@@ -373,7 +373,7 @@ static sl_status_t wfx_rsi_init(void)
373373
SILABS_LOG("sl_wifi_get_mac_address failed: %x", status);
374374
return status;
375375
}
376-
#ifdef SIWX_917
376+
377377
const uint32_t trngKey[TRNGKEY_SIZE] = { 0x16157E2B, 0xA6D2AE28, 0x8815F7AB, 0x3C4FCF09 };
378378

379379
// To check the Entropy of TRNG and verify TRNG functioning.
@@ -391,7 +391,7 @@ static sl_status_t wfx_rsi_init(void)
391391
SILABS_LOG("TRNG Key Programming Failed");
392392
return status;
393393
}
394-
#endif // SIWX_917
394+
395395
wfx_rsi.events = xEventGroupCreateStatic(&rsiDriverEventGroup);
396396
wfx_rsi.dev_state |= WFX_RSI_ST_DEV_READY;
397397
osSemaphoreRelease(sl_rs_ble_init_sem);
@@ -697,7 +697,7 @@ void wfx_rsi_task(void * arg)
697697
#ifdef SL_WFX_CONFIG_SCAN
698698
| WFX_EVT_SCAN
699699
#endif /* SL_WFX_CONFIG_SCAN */
700-
| 0,
700+
,
701701
pdTRUE, /* Clear the bits */
702702
pdFALSE, /* Wait for any bit */
703703
pdMS_TO_TICKS(250)); /* 250 mSec */

examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h

+3-13
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,11 @@ static const sl_wifi_device_configuration_t config = {
4848
#endif
4949
| SL_SI91X_TCP_IP_FEAT_ICMP | SL_SI91X_TCP_IP_FEAT_EXTENSION_VALID),
5050
.custom_feature_bit_map = (SL_SI91X_CUSTOM_FEAT_EXTENTION_VALID | RSI_CUSTOM_FEATURE_BIT_MAP),
51-
.ext_custom_feature_bit_map = (
52-
#ifdef SLI_SI917
53-
(RSI_EXT_CUSTOM_FEATURE_BIT_MAP)
54-
#else // defaults
55-
#ifdef SLI_SI91X_MCU_INTERFACE
56-
(SL_SI91X_EXT_FEAT_256K_MODE | RSI_EXT_CUSTOM_FEATURE_BIT_MAP)
57-
#else
58-
(SL_SI91X_EXT_FEAT_384K_MODE | RSI_EXT_CUSTOM_FEATURE_BIT_MAP)
59-
#endif
60-
#endif // SLI_SI917
61-
| (SL_SI91X_EXT_FEAT_BT_CUSTOM_FEAT_ENABLE)
51+
.ext_custom_feature_bit_map = (RSI_EXT_CUSTOM_FEATURE_BIT_MAP | (SL_SI91X_EXT_FEAT_BT_CUSTOM_FEAT_ENABLE)
6252
#if (defined A2DP_POWER_SAVE_ENABLE)
63-
| SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(2)
53+
| SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(2)
6454
#endif
65-
),
55+
),
6656
.bt_feature_bit_map = (RSI_BT_FEATURE_BITMAP
6757
#if (RSI_BT_GATT_ON_CLASSIC)
6858
| SL_SI91X_BT_ATT_OVER_CLASSIC_ACL /* to support att over classic acl link */

examples/platform/silabs/SilabsDeviceAttestationCreds.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class DeviceAttestationCredsSilabs : public DeviceAttestationCredentialsProvider
101101
if (SilabsConfig::ConfigValueExists(SilabsConfig::kConfigKey_Creds_KeyId))
102102
{
103103
// Provisioned DAC key
104-
#ifdef SIWX_917
104+
#ifdef SLI_SI91X_MCU_INTERFACE
105105
return CHIP_ERROR_NOT_IMPLEMENTED;
106106
#else
107107
uint32_t key_id = SILABS_CREDENTIALS_DAC_KEY_ID;

examples/platform/silabs/display/demo-ui.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
#include "glib.h"
2626
#include "sl_component_catalog.h"
2727
#include "sl_memlcd.h"
28-
#if SL_WIFI && !SIWX_917
28+
#if SL_WIFI && !SLI_SI91X_MCU_INTERFACE
2929
#include "spi_multiplex.h"
30-
#endif // SL_WIFI && !SIWX_917
30+
#endif // SL_WIFI && !SLI_SI91X_MCU_INTERFACE
3131
#include <stdio.h>
3232
#include <string.h>
3333

@@ -106,9 +106,9 @@ void demoUIInit(GLIB_Context_t * context)
106106
sl_status_t updateDisplay(void)
107107
{
108108
sl_status_t status = SL_STATUS_OK;
109-
#if SIWX_917 && SL_ICD_ENABLED && DISPLAY_ENABLED
109+
#if SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED && DISPLAY_ENABLED
110110
sl_memlcd_post_wakeup_init();
111-
#endif // SIWX_917 && SL_ICD_ENABLED && DISPLAY_ENABLED
111+
#endif // SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED && DISPLAY_ENABLED
112112
#if SL_LCDCTRL_MUX
113113
status = sl_wfx_host_pre_lcd_spi_transfer();
114114
if (status != SL_STATUS_OK)

examples/platform/silabs/display/lcd.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "dmd.h"
2626
#include "glib.h"
2727

28-
#if (SIWX_917)
28+
#if (SLI_SI91X_MCU_INTERFACE)
2929
#include "rsi_chip.h"
3030
#endif
3131

@@ -66,7 +66,7 @@ CHIP_ERROR SilabsLCD::Init(uint8_t * name, bool initialState)
6666
}
6767

6868
/* Enable the memory lcd */
69-
#if (SIWX_917)
69+
#if (SLI_SI91X_MCU_INTERFACE)
7070
RSI_NPSSGPIO_InputBufferEn(SL_BOARD_ENABLE_DISPLAY_PIN, 1U);
7171
RSI_NPSSGPIO_SetPinMux(SL_BOARD_ENABLE_DISPLAY_PIN, 0);
7272
RSI_NPSSGPIO_SetDir(SL_BOARD_ENABLE_DISPLAY_PIN, 0);

examples/platform/silabs/efr32/rs911x/hal/rsi_hal_mcu_interrupt.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "wfx_host_events.h"
3939
#include "wfx_rsi.h"
4040

41-
#if (SIWX_917 | EXP_BOARD)
41+
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
4242
#include "sl_board_configuration.h"
4343

4444
#include "sl_rsi_utility.h"
@@ -61,7 +61,7 @@ void rsi_gpio_irq_cb(uint8_t irqnum)
6161
{
6262
if (irqnum != SL_WFX_HOST_PINOUT_SPI_IRQ)
6363
return;
64-
#if (SIWX_917 | EXP_BOARD)
64+
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
6565
sl_si91x_host_set_bus_event(NCP_HOST_BUS_RX_EVENT);
6666
#else
6767
GPIO_IntClear(1 << SL_WFX_HOST_PINOUT_SPI_IRQ);

0 commit comments

Comments
 (0)