Skip to content

Commit

Permalink
Renamed SiWx917 to SLI_917_SOC for clarity, removed unused defines fr…
Browse files Browse the repository at this point in the history
…om SiWx917.gni file
  • Loading branch information
lpbeliveau-silabs committed Mar 11, 2024
1 parent 9bf24bd commit 06f8a0b
Show file tree
Hide file tree
Showing 20 changed files with 177 additions and 176 deletions.
2 changes: 1 addition & 1 deletion examples/lighting-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

#include <platform/CHIPDeviceLayer.h>

#if (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917))
#ifdef SL_CATALOG_SIMPLE_LED_LED1_PRESENT
#define LIGHT_LED 1
#else
#define LIGHT_LED 0
Expand Down
14 changes: 7 additions & 7 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
#define APP_EVENT_QUEUE_SIZE 10
#define EXAMPLE_VENDOR_ID 0xcafe

#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
#define SYSTEM_STATE_LED 0
#endif // ENABLE_WSTK_LEDS
#define APP_FUNCTION_BUTTON 0
Expand All @@ -104,7 +104,7 @@ TimerHandle_t sLightTimer;
TaskHandle_t sAppTaskHandle;
QueueHandle_t sAppEventQueue;

#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
LEDWidget sStatusLED;
#endif // ENABLE_WSTK_LEDS

Expand Down Expand Up @@ -270,7 +270,7 @@ CHIP_ERROR BaseApplication::Init()
ConfigurationMgr().LogDeviceConfig();

OutputQrCode(true /*refreshLCD at init*/);
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
LEDWidget::InitGpio();
sStatusLED.Init(SYSTEM_STATE_LED);
#endif // ENABLE_WSTK_LEDS
Expand Down Expand Up @@ -321,7 +321,7 @@ void BaseApplication::FunctionEventHandler(AppEvent * aEvent)
bool BaseApplication::ActivateStatusLedPatterns()
{
bool isPatternSet = false;
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
#ifdef MATTER_DM_PLUGIN_IDENTIFY_SERVER
if (gIdentify.mActive)
{
Expand Down Expand Up @@ -427,7 +427,7 @@ void BaseApplication::LightEventHandler()
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER

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

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

void BaseApplication::StopStatusLEDTimer()
{
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
sStatusLED.Set(false);
#endif // ENABLE_WSTK_LEDS

Expand Down
14 changes: 7 additions & 7 deletions examples/platform/silabs/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ extern "C" {

#include <stdint.h>

#ifdef SIWX_917
#ifdef SLI_917_SOC
#include "si91x_device.h"
extern uint32_t SystemCoreClock;
#else // For EFR32
Expand Down Expand Up @@ -169,23 +169,23 @@ extern uint32_t SystemCoreClock;
#define configTIMER_QUEUE_LENGTH (10)
#define configTIMER_TASK_STACK_DEPTH (1024)

#ifdef SIWX_917
#ifdef SLI_917_SOC
#ifdef __NVIC_PRIO_BITS
#undef __NVIC_PRIO_BITS
#endif
#define configPRIO_BITS 6 /* 6 priority levels. */
#endif // SIWX_917
#endif // SLI_917_SOC

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

#define configENABLE_FPU 0
#define configENABLE_MPU 0
Expand Down Expand Up @@ -232,11 +232,11 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#ifndef configTOTAL_HEAP_SIZE
#ifdef SL_WIFI
#ifdef DIC_ENABLE
#ifdef SIWX_917
#ifdef SLI_917_SOC
#define configTOTAL_HEAP_SIZE ((size_t) ((75 + EXTRA_HEAP_k) * 1024))
#else
#define configTOTAL_HEAP_SIZE ((size_t) ((68 + EXTRA_HEAP_k) * 1024))
#endif // SIWX_917
#endif // SLI_917_SOC
#else
#define configTOTAL_HEAP_SIZE ((size_t) ((42 + EXTRA_HEAP_k) * 1024))
#endif // DIC
Expand Down
14 changes: 7 additions & 7 deletions examples/platform/silabs/MatterConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
#include "MemMonitoring.h"
#endif

#ifdef SIWX_917
#ifdef SLI_917_SOC
#include "wfx_rsi.h"
#endif /* SIWX_917 */
#endif /* SLI_917_SOC */

using namespace ::chip;
using namespace ::chip::Inet;
Expand All @@ -53,7 +53,7 @@ using namespace ::chip::DeviceLayer;
#include <crypto/CHIPCryptoPAL.h>
// If building with the EFR32-provided crypto backend, we can use the
// opaque keystore
#if CHIP_CRYPTO_PLATFORM && !(defined(SIWX_917))
#if CHIP_CRYPTO_PLATFORM && !(defined(SLI_917_SOC))
#include <platform/silabs/efr32/Efr32PsaOperationalKeystore.h>
static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeystore;
#endif
Expand Down Expand Up @@ -229,7 +229,7 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
#endif // SILABS_TEST_EVENT_TRIGGER_ENABLED

#if CHIP_CRYPTO_PLATFORM && !(defined(SIWX_917))
#if CHIP_CRYPTO_PLATFORM && !(defined(SLI_917_SOC))
// When building with EFR32 crypto, use the opaque key store
// instead of the default (insecure) one.
gOperationalKeystore.Init();
Expand Down Expand Up @@ -289,13 +289,13 @@ CHIP_ERROR SilabsMatterConfig::InitWiFi(void)
#endif // SL_WFX_USE_SECURE_LINK
#endif /* WF200_WIFI */

#ifdef SIWX_917
#ifdef SLI_917_SOC
sl_status_t status;
if ((status = wfx_wifi_rsi_init()) != SL_STATUS_OK)
{
ReturnErrorOnFailure((CHIP_ERROR) status);
}
#endif // SIWX_917
#endif // SLI_917_SOC

return CHIP_NO_ERROR;
}
Expand All @@ -306,7 +306,7 @@ CHIP_ERROR SilabsMatterConfig::InitWiFi(void)
// ================================================================================
extern "C" void vApplicationIdleHook(void)
{
#if SIWX_917 && CHIP_CONFIG_ENABLE_ICD_SERVER
#if SLI_917_SOC && CHIP_CONFIG_ENABLE_ICD_SERVER
sl_wfx_host_si91x_sleep_wakeup();
#endif
}
4 changes: 2 additions & 2 deletions examples/platform/silabs/OTAConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "silabs_utils.h"
#include <app/server/Server.h>

#ifndef SIWX_917
#ifndef SLI_917_SOC

#include "application_properties.h"

Expand Down Expand Up @@ -75,7 +75,7 @@ __attribute__((used)) ApplicationProperties_t sl_app_properties = {
.longTokenSectionAddress = NULL,
};
#endif // SL_CATALOG_GECKO_BOOTLOADER_INTERFACE_PRESENT
#endif // SIWX_917
#endif // SLI_917_SOC

// Global OTA objects
chip::DefaultOTARequestor gRequestorCore;
Expand Down
10 changes: 7 additions & 3 deletions examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

#include "ble_config.h"

#if SL_ICD_ENABLED
#if SL_ICD_ENABLED && SLI_917_SOC
#include "rsi_rom_power_save.h"
#include "sl_si91x_button_pin_config.h"
#include "sl_si91x_driver.h"
Expand All @@ -50,7 +50,7 @@
// TODO: should be removed once we are getting the press interrupt for button 0 with sleep
#define BUTTON_PRESSED 1
bool btn0_pressed = false;
#endif // SL_ICD_ENABLED
#endif // SL_ICD_ENABLED && SLI_917_SOC

#include "dhcp_client.h"
#include "sl_wifi.h"
Expand All @@ -63,8 +63,10 @@ bool btn0_pressed = false;
#define ADV_MULTIPROBE 1
#define ADV_SCAN_PERIODICITY 10

#if SLI_917_SOC
#include "sl_si91x_trng.h"
#define TRNGKEY_SIZE 4
#endif // SLI_917_SOC

struct wfx_rsi wfx_rsi;

Expand Down Expand Up @@ -213,6 +215,7 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t

#if SL_ICD_ENABLED

#if SLI_917_SOC
/******************************************************************
* @fn sl_wfx_host_si91x_sleep_wakeup()
* @brief
Expand Down Expand Up @@ -247,6 +250,7 @@ void sl_wfx_host_si91x_sleep_wakeup()
}
}
}
#endif // SLI_917_SOC

/******************************************************************
* @fn wfx_rsi_power_save()
Expand Down Expand Up @@ -693,7 +697,7 @@ void wfx_rsi_task(void * arg)
#ifdef SL_WFX_CONFIG_SCAN
| WFX_EVT_SCAN
#endif /* SL_WFX_CONFIG_SCAN */
| 0,
,
pdTRUE, /* Clear the bits */
pdFALSE, /* Wait for any bit */
pdMS_TO_TICKS(250)); /* 250 mSec */
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static const sl_wifi_device_configuration_t config = {
#endif
//! ENABLE_BLE_PROTOCOL in bt_feature_bit_map
.ble_feature_bit_map =
((SL_SI91X_BLE_MAX_NBR_PERIPHERALS(RSI_BLE_MAX_NBR_PERIPHERALS) |
((RSI_BLE_MAX_NBR_PERIPHERALS(RSI_BLE_MAX_NBR_PERIPHERALS) |
SL_SI91X_BLE_MAX_NBR_CENTRALS(RSI_BLE_MAX_NBR_CENTRALS) |
SL_SI91X_BLE_MAX_NBR_ATT_SERV(RSI_BLE_MAX_NBR_ATT_SERV) |
SL_SI91X_BLE_MAX_NBR_ATT_REC(RSI_BLE_MAX_NBR_ATT_REC)) |
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/silabs/SilabsDeviceAttestationCreds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class DeviceAttestationCredsSilabs : public DeviceAttestationCredentialsProvider
if (SilabsConfig::ConfigValueExists(SilabsConfig::kConfigKey_Creds_KeyId))
{
// Provisioned DAC key
#ifdef SIWX_917
#ifdef SLI_917_SOC
return CHIP_ERROR_NOT_IMPLEMENTED;
#else
uint32_t key_id = SILABS_CREDENTIALS_DAC_KEY_ID;
Expand Down
8 changes: 4 additions & 4 deletions examples/platform/silabs/display/demo-ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include "glib.h"
#include "sl_component_catalog.h"
#include "sl_memlcd.h"
#if SL_WIFI && !SIWX_917
#if SL_WIFI && !SLI_917_SOC
#include "spi_multiplex.h"
#endif // SL_WIFI && !SIWX_917
#endif // SL_WIFI && !SLI_917_SOC
#include <stdio.h>
#include <string.h>

Expand Down Expand Up @@ -106,9 +106,9 @@ void demoUIInit(GLIB_Context_t * context)
sl_status_t updateDisplay(void)
{
sl_status_t status = SL_STATUS_OK;
#if SIWX_917 && SL_ICD_ENABLED && DISPLAY_ENABLED
#if SLI_917_SOC && SL_ICD_ENABLED && DISPLAY_ENABLED
sl_memlcd_post_wakeup_init();
#endif // SIWX_917 && SL_ICD_ENABLED && DISPLAY_ENABLED
#endif // SLI_917_SOC && SL_ICD_ENABLED && DISPLAY_ENABLED
#if SL_LCDCTRL_MUX
status = sl_wfx_host_pre_lcd_spi_transfer();
if (status != SL_STATUS_OK)
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/silabs/display/lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "dmd.h"
#include "glib.h"

#if (SIWX_917)
#if (SLI_917_SOC)
#include "rsi_chip.h"
#endif

Expand Down Expand Up @@ -66,7 +66,7 @@ CHIP_ERROR SilabsLCD::Init(uint8_t * name, bool initialState)
}

/* Enable the memory lcd */
#if (SIWX_917)
#if (SLI_917_SOC)
RSI_NPSSGPIO_InputBufferEn(SL_BOARD_ENABLE_DISPLAY_PIN, 1U);
RSI_NPSSGPIO_SetPinMux(SL_BOARD_ENABLE_DISPLAY_PIN, 0);
RSI_NPSSGPIO_SetDir(SL_BOARD_ENABLE_DISPLAY_PIN, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "wfx_host_events.h"
#include "wfx_rsi.h"

#if (SIWX_917 | EXP_BOARD)
#if (SLI_917_SOC | EXP_BOARD)
#include "sl_board_configuration.h"

#include "sl_rsi_utility.h"
Expand All @@ -61,7 +61,7 @@ void rsi_gpio_irq_cb(uint8_t irqnum)
{
if (irqnum != SL_WFX_HOST_PINOUT_SPI_IRQ)
return;
#if (SIWX_917 | EXP_BOARD)
#if (SLI_917_SOC | EXP_BOARD)
sl_si91x_host_set_bus_event(NCP_HOST_BUS_RX_EVENT);
#else
GPIO_IntClear(1 << SL_WFX_HOST_PINOUT_SPI_IRQ);
Expand Down
Loading

0 comments on commit 06f8a0b

Please sign in to comment.