Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Silabs] Bugfix/redundant 917 ifdef #32470

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_SI91X_MCU_INTERFACE
#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_SI91X_MCU_INTERFACE
#ifdef __NVIC_PRIO_BITS
#undef __NVIC_PRIO_BITS
#endif
#define configPRIO_BITS 6 /* 6 priority levels. */
#endif // SIWX_917
#endif // SLI_SI91X_MCU_INTERFACE

/* 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_SI91X_MCU_INTERFACE
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 20
#else
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 48
#endif // SIWX_917
#endif // SLI_SI91X_MCU_INTERFACE

#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_SI91X_MCU_INTERFACE
#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_SI91X_MCU_INTERFACE
#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_SI91X_MCU_INTERFACE
#include "wfx_rsi.h"
#endif /* SIWX_917 */
#endif /* SLI_SI91X_MCU_INTERFACE */

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_SI91X_MCU_INTERFACE))
#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_SI91X_MCU_INTERFACE))
// 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_SI91X_MCU_INTERFACE
sl_status_t status;
if ((status = wfx_wifi_rsi_init()) != SL_STATUS_OK)
{
ReturnErrorOnFailure((CHIP_ERROR) status);
}
#endif // SIWX_917
#endif // SLI_SI91X_MCU_INTERFACE

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_SI91X_MCU_INTERFACE && 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_SI91X_MCU_INTERFACE

#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_SI91X_MCU_INTERFACE

// Global OTA objects
chip::DefaultOTARequestor gRequestorCore;
Expand Down
18 changes: 9 additions & 9 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 && SIWX_917
lpbeliveau-silabs marked this conversation as resolved.
Show resolved Hide resolved
#if SL_ICD_ENABLED && SLI_SI91X_MCU_INTERFACE
#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 && SIWX_917
#endif // SL_ICD_ENABLED && SLI_SI91X_MCU_INTERFACE

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

#ifdef SIWX_917
#if SLI_SI91X_MCU_INTERFACE
#include "sl_si91x_trng.h"
#define TRNGKEY_SIZE 4
#endif // SIWX_917
#endif // SLI_SI91X_MCU_INTERFACE

struct wfx_rsi wfx_rsi;

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

#if SL_ICD_ENABLED

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

/******************************************************************
* @fn wfx_rsi_power_save()
Expand Down Expand Up @@ -373,7 +373,7 @@ static sl_status_t wfx_rsi_init(void)
SILABS_LOG("sl_wifi_get_mac_address failed: %x", status);
return status;
}
#ifdef SIWX_917

const uint32_t trngKey[TRNGKEY_SIZE] = { 0x16157E2B, 0xA6D2AE28, 0x8815F7AB, 0x3C4FCF09 };

// To check the Entropy of TRNG and verify TRNG functioning.
Expand All @@ -391,7 +391,7 @@ static sl_status_t wfx_rsi_init(void)
SILABS_LOG("TRNG Key Programming Failed");
return status;
}
#endif // SIWX_917

wfx_rsi.events = xEventGroupCreateStatic(&rsiDriverEventGroup);
wfx_rsi.dev_state |= WFX_RSI_ST_DEV_READY;
osSemaphoreRelease(sl_rs_ble_init_sem);
Expand Down Expand Up @@ -697,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
16 changes: 3 additions & 13 deletions examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,11 @@ static const sl_wifi_device_configuration_t config = {
#endif
| SL_SI91X_TCP_IP_FEAT_ICMP | SL_SI91X_TCP_IP_FEAT_EXTENSION_VALID),
.custom_feature_bit_map = (SL_SI91X_CUSTOM_FEAT_EXTENTION_VALID | RSI_CUSTOM_FEATURE_BIT_MAP),
.ext_custom_feature_bit_map = (
#ifdef SLI_SI917
lpbeliveau-silabs marked this conversation as resolved.
Show resolved Hide resolved
(RSI_EXT_CUSTOM_FEATURE_BIT_MAP)
#else // defaults
#ifdef SLI_SI91X_MCU_INTERFACE
lpbeliveau-silabs marked this conversation as resolved.
Show resolved Hide resolved
(SL_SI91X_EXT_FEAT_256K_MODE | RSI_EXT_CUSTOM_FEATURE_BIT_MAP)
#else
(SL_SI91X_EXT_FEAT_384K_MODE | RSI_EXT_CUSTOM_FEATURE_BIT_MAP)
#endif
#endif // SLI_SI917
| (SL_SI91X_EXT_FEAT_BT_CUSTOM_FEAT_ENABLE)
.ext_custom_feature_bit_map = (RSI_EXT_CUSTOM_FEATURE_BIT_MAP | (SL_SI91X_EXT_FEAT_BT_CUSTOM_FEAT_ENABLE)
#if (defined A2DP_POWER_SAVE_ENABLE)
| SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(2)
| SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(2)
#endif
),
),
.bt_feature_bit_map = (RSI_BT_FEATURE_BITMAP
#if (RSI_BT_GATT_ON_CLASSIC)
| SL_SI91X_BT_ATT_OVER_CLASSIC_ACL /* to support att over classic acl link */
Expand Down
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_SI91X_MCU_INTERFACE
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_SI91X_MCU_INTERFACE
#include "spi_multiplex.h"
#endif // SL_WIFI && !SIWX_917
#endif // SL_WIFI && !SLI_SI91X_MCU_INTERFACE
#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_SI91X_MCU_INTERFACE && SL_ICD_ENABLED && DISPLAY_ENABLED
sl_memlcd_post_wakeup_init();
#endif // SIWX_917 && SL_ICD_ENABLED && DISPLAY_ENABLED
#endif // SLI_SI91X_MCU_INTERFACE && 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_SI91X_MCU_INTERFACE)
#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_SI91X_MCU_INTERFACE)
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_SI91X_MCU_INTERFACE | 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_SI91X_MCU_INTERFACE | 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
Loading