Skip to content

Commit

Permalink
Add module support (#24650)
Browse files Browse the repository at this point in the history
  • Loading branch information
jepenven-silabs authored Jan 25, 2023
1 parent 583e976 commit 14dada3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
2 changes: 1 addition & 1 deletion examples/lighting-app/silabs/efr32/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <platform/CHIPDeviceLayer.h>

#ifdef ENABLE_WSTK_LEDS
#if SL_STATUS_LED
#if defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
#define LIGHT_LED &sl_led_led1
#else
#define LIGHT_LED &sl_led_led0
Expand Down
30 changes: 15 additions & 15 deletions examples/platform/silabs/efr32/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "AppEvent.h"
#include "AppTask.h"

#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
#include "LEDWidget.h"
#include "sl_simple_led_instances.h"
#endif // ENABLE_WSTK_LEDS
Expand Down Expand Up @@ -74,7 +74,7 @@
#define APP_EVENT_QUEUE_SIZE 10
#define EXAMPLE_VENDOR_ID 0xcafe

#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
#define SYSTEM_STATE_LED &sl_led_led0
#endif // ENABLE_WSTK_LEDS
#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT
Expand All @@ -96,7 +96,7 @@ TimerHandle_t sLightTimer;
TaskHandle_t sAppTaskHandle;
QueueHandle_t sAppEventQueue;

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

Expand Down Expand Up @@ -212,7 +212,7 @@ CHIP_ERROR BaseApplication::Init(Identify * identifyObj)

SILABS_LOG("Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING);

#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#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 @@ -273,7 +273,7 @@ void BaseApplication::FunctionEventHandler(AppEvent * aEvent)

mFunction = kFunction_FactoryReset;

#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#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 @@ -334,27 +334,27 @@ void BaseApplication::LightEventHandler()
{
if ((gIdentifyptr != nullptr) && (gIdentifyptr->mActive))
{
#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
sStatusLED.Blink(250, 250);
#endif // ENABLE_WSTK_LEDS
}
else if (sIdentifyEffect != EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT)
{
if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK)
{
#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
sStatusLED.Blink(50, 50);
#endif // ENABLE_WSTK_LEDS
}
if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE)
{
#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
sStatusLED.Blink(1000, 1000);
#endif // ENABLE_WSTK_LEDS
}
if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY)
{
#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
sStatusLED.Blink(300, 700);
#endif // ENABLE_WSTK_LEDS
}
Expand All @@ -364,33 +364,33 @@ void BaseApplication::LightEventHandler()
{
if (sIsAttached)
{
#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
sStatusLED.Set(true);
#endif // ENABLE_WSTK_LEDS
}
else
{
#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
sStatusLED.Blink(950, 50);
#endif
}
}
else if (sHaveBLEConnections)
{
#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
sStatusLED.Blink(100, 100);
#endif // ENABLE_WSTK_LEDS
}
else
{
#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
sStatusLED.Blink(50, 950);
#endif // ENABLE_WSTK_LEDS
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_SED
}

#if defined(ENABLE_WSTK_LEDS) && SL_STATUS_LED
#if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
sStatusLED.Animate();
#endif // ENABLE_WSTK_LEDS
}
Expand Down Expand Up @@ -504,7 +504,7 @@ void BaseApplication::StartStatusLEDTimer()

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

Expand Down
16 changes: 12 additions & 4 deletions third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ template("efr32_sdk") {
"${efr32_sdk_root}/platform/radio/rail_lib/common",
"${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32",
"${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/rf/common/cortex",
"${efr32_sdk_root}/platform/radio/rail_lib/hal",
"${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32",
"${efr32_sdk_root}/platform/radio/rail_lib/protocol/ieee802154",
"${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions",
"${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti",
Expand Down Expand Up @@ -177,6 +175,13 @@ template("efr32_sdk") {
"${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen",
]

if (silabs_family != "mgm24") {
_include_dirs += [
"${efr32_sdk_root}/platform/radio/rail_lib/hal",
"${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32",
]
}

# Note that we're setting the mbedTLS and PSA configuration files through a
# define. This means the build system by default does not pick up changes in
# the content of these, only when changing the filename itself.
Expand Down Expand Up @@ -476,7 +481,6 @@ template("efr32_sdk") {
"${efr32_sdk_root}/platform/emlib/src/em_system.c",
"${efr32_sdk_root}/platform/emlib/src/em_timer.c",
"${efr32_sdk_root}/platform/peripheral/src/peripheral_sysrtc.c",
"${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32/hal_efr.c",
"${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_conversions_efr32.c",
"${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti/sl_rail_util_pti.c",
"${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/aes_aes.c",
Expand Down Expand Up @@ -625,6 +629,11 @@ template("efr32_sdk") {
"${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_event_handler.c",
]

if (silabs_family != "mgm24") {
sources +=
[ "${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32/hal_efr.c" ]
}

if (use_wstk_buttons) {
sources += [
"${efr32_sdk_root}/platform/driver/button/src/sl_button.c",
Expand Down Expand Up @@ -815,7 +824,6 @@ template("efr32_sdk") {
sources += [
"${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Source/startup_mgm24.c",
"${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Source/system_mgm24.c",
"${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_curves_efr32.c",
"${efr32_sdk_root}/platform/security/sl_component/se_manager/src/sl_se_manager.c",
"${efr32_sdk_root}/platform/security/sl_component/se_manager/src/sl_se_manager_attestation.c",
"${efr32_sdk_root}/platform/security/sl_component/se_manager/src/sl_se_manager_cipher.c",
Expand Down
2 changes: 1 addition & 1 deletion third_party/silabs/matter_support
Submodule matter_support updated 111 files

0 comments on commit 14dada3

Please sign in to comment.