Skip to content

Commit

Permalink
[Silabs] Adds bugfix for building applications on SiWx917 SoC (#28468)
Browse files Browse the repository at this point in the history
* Build Error fix for Window app on CSA for 917 SOC

* Added Conditions for 917 SOC

* Adds fix for 917SoC button and LED0 issue

* Restyled by clang-format

* Removed not required ifndef condition for 917 SOC

* Removed OTA Requestor changes from scripts file

* using release interrupt for button 1

* Restyled by clang-format

---------

Co-authored-by: srningap <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Mar 8, 2024
1 parent 38304d1 commit 2649921
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 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(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 @@ -79,7 +78,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 @@ -101,7 +100,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 @@ -236,7 +235,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 @@ -292,7 +291,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 @@ -315,7 +314,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 @@ -417,7 +416,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 @@ -556,7 +555,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

0 comments on commit 2649921

Please sign in to comment.