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] Adds bugfix for building applications on SiWx917 SoC #28468

Merged
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(BRD4325B))
#if (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917))
#define LIGHT_LED 1
#else
#define LIGHT_LED 0
Expand Down
17 changes: 8 additions & 9 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
#include "AppEvent.h"
#include "AppTask.h"

#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
#include "LEDWidget.h"
#include "sl_simple_led_instances.h"
#endif // ENABLE_WSTK_LEDS

#ifdef DISPLAY_ENABLED
Expand Down Expand Up @@ -74,7 +73,7 @@
#define APP_EVENT_QUEUE_SIZE 10
#define EXAMPLE_VENDOR_ID 0xcafe

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

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

Expand Down Expand Up @@ -215,7 +214,7 @@ CHIP_ERROR BaseApplication::Init()
SILABS_LOG("Current Software Version String: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING);
SILABS_LOG("Current Software Version: %d", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION);

#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
LEDWidget::InitGpio();
sStatusLED.Init(SYSTEM_STATE_LED);
#endif // ENABLE_WSTK_LEDS
Expand Down Expand Up @@ -267,7 +266,7 @@ void BaseApplication::FunctionEventHandler(AppEvent * aEvent)

mFunction = kFunction_FactoryReset;

#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
// Turn off all LEDs before starting blink to make sure blink is
// co-ordinated.
sStatusLED.Set(false);
Expand All @@ -290,7 +289,7 @@ void BaseApplication::FunctionEventHandler(AppEvent * aEvent)
bool BaseApplication::ActivateStatusLedPatterns()
{
bool isPatternSet = false;
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
#ifdef EMBER_AF_PLUGIN_IDENTIFY_SERVER
if (gIdentify.mActive)
{
Expand Down Expand Up @@ -392,7 +391,7 @@ void BaseApplication::LightEventHandler()
}
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER

#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
// 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 @@ -531,7 +530,7 @@ void BaseApplication::StartStatusLEDTimer()

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

Expand Down
2 changes: 1 addition & 1 deletion examples/platform/silabs/MatterConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)

// WiFi needs to be initialized after Memory Init for some reason
#ifdef SL_WIFI
InitWiFi();
ReturnErrorOnFailure(InitWiFi());
#endif

ReturnErrorOnFailure(PlatformMgr().InitChipStack());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ void IRQ021_Handler(void)
RSI_NPSSGPIO_ClrIntr(NPSS_GPIO_0_INTR);
RSI_NPSSGPIO_ClrIntr(NPSS_GPIO_2_INTR);
// if the btn is not pressed setting the state to 1
if (RSI_NPSSGPIO_GetPin(NPSS_GPIO_2))
if (RSI_NPSSGPIO_GetPin(NPSS_GPIO_2) && (!btn1))
{
btn1 = 1;
sl_button_on_change(1, 0);
}
// geting the state of the gpio 2 pin and checking if the btn is already pressed or not
if (!RSI_NPSSGPIO_GetPin(NPSS_GPIO_2) && btn1)
Expand Down
4 changes: 4 additions & 0 deletions src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#include <FreeRTOS.h>
#include <task.h>

#if SILABS_LOG_ENABLED
#include "silabs_utils.h"
#endif

// TODO add includes ?
extern "C" void RSI_Board_LED_Set(int, bool);
extern "C" void RSI_Board_LED_Toggle(int);
Expand Down
Loading