From cd4812e81f31f423d7a82c80e223df7d6c267025 Mon Sep 17 00:00:00 2001 From: CuRahman <111998767+CuRahman@users.noreply.github.com> Date: Tue, 8 Nov 2022 15:59:56 -0500 Subject: [PATCH] Added necessary changes to comply with SLC/GSDK integration (#23478) --- examples/platform/efr32/LEDWidget.cpp | 3 +++ examples/platform/efr32/OTAConfig.cpp | 9 ++++++++- examples/platform/efr32/matter_config.cpp | 4 ++++ src/platform/EFR32/OTAImageProcessorImpl.cpp | 4 ++-- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/examples/platform/efr32/LEDWidget.cpp b/examples/platform/efr32/LEDWidget.cpp index 960995545e6efb..10ffcac363520d 100644 --- a/examples/platform/efr32/LEDWidget.cpp +++ b/examples/platform/efr32/LEDWidget.cpp @@ -18,7 +18,10 @@ */ #include "LEDWidget.h" + +extern "C" { #include "sl_simple_led_instances.h" +} #include diff --git a/examples/platform/efr32/OTAConfig.cpp b/examples/platform/efr32/OTAConfig.cpp index 8f42f6951e1cdc..1056cf5a3533b4 100644 --- a/examples/platform/efr32/OTAConfig.cpp +++ b/examples/platform/efr32/OTAConfig.cpp @@ -18,9 +18,15 @@ #include "OTAConfig.h" -#include "platform/bootloader/api/application_properties.h" +#include "application_properties.h" #include +#if defined(SL_COMPONENT_CATALOG_PRESENT) +#include "sl_component_catalog.h" +#endif + +// Only include app properties if the Gecko SDK component that does it automatically isn't present +#if !defined(SL_CATALOG_GECKO_BOOTLOADER_INTERFACE_PRESENT) // Header used for building the image GBL file #define APP_PROPERTIES_VERSION 1 #define APP_PROPERTIES_ID \ @@ -65,6 +71,7 @@ __attribute__((used)) ApplicationProperties_t sl_app_properties = { /// Pointer to Long Token Data Section .longTokenSectionAddress = NULL, }; +#endif // SL_CATALOG_GECKO_BOOTLOADER_INTERFACE_PRESENT // Global OTA objects chip::DefaultOTARequestor gRequestorCore; diff --git a/examples/platform/efr32/matter_config.cpp b/examples/platform/efr32/matter_config.cpp index d4d651f73ab5d2..1102db5465f430 100644 --- a/examples/platform/efr32/matter_config.cpp +++ b/examples/platform/efr32/matter_config.cpp @@ -105,10 +105,12 @@ CHIP_ERROR EFR32MatterConfig::InitOpenThread(void) } #endif // CHIP_ENABLE_OPENTHREAD +#if EFR32_OTA_ENABLED void EFR32MatterConfig::InitOTARequestorHandler(System::Layer * systemLayer, void * appState) { OTAConfig::Init(); } +#endif void EFR32MatterConfig::ConnectivityEventCallback(const ChipDeviceEvent * event, intptr_t arg) { @@ -118,9 +120,11 @@ void EFR32MatterConfig::ConnectivityEventCallback(const ChipDeviceEvent * event, ((event->Type == DeviceEventType::kInternetConnectivityChange) && (event->InternetConnectivityChange.IPv6 == kConnectivity_Established))) { +#if EFR32_OTA_ENABLED EFR32_LOG("Scheduling OTA Requestor initialization") chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(OTAConfig::kInitOTARequestorDelaySec), InitOTARequestorHandler, nullptr); +#endif } } diff --git a/src/platform/EFR32/OTAImageProcessorImpl.cpp b/src/platform/EFR32/OTAImageProcessorImpl.cpp index c8c717e191837a..70b1349ce378b6 100644 --- a/src/platform/EFR32/OTAImageProcessorImpl.cpp +++ b/src/platform/EFR32/OTAImageProcessorImpl.cpp @@ -21,8 +21,8 @@ #include extern "C" { -#include "platform/bootloader/api/btl_interface.h" -#include "platform/emlib/inc/em_bus.h" // For CORE_CRITICAL_SECTION +#include "btl_interface.h" +#include "em_bus.h" // For CORE_CRITICAL_SECTION } #include "EFR32Config.h"