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

[EFR32] Miscellaneous platform cleanup items #23478

Merged
merged 2 commits into from
Nov 8, 2022
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
3 changes: 3 additions & 0 deletions examples/platform/efr32/LEDWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
*/

#include "LEDWidget.h"

extern "C" {
#include "sl_simple_led_instances.h"
}

#include <platform/CHIPDeviceLayer.h>

Expand Down
9 changes: 8 additions & 1 deletion examples/platform/efr32/OTAConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@

#include "OTAConfig.h"

#include "platform/bootloader/api/application_properties.h"
#include "application_properties.h"
#include <app/server/Server.h>

#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 \
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions examples/platform/efr32/matter_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/platform/EFR32/OTAImageProcessorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <app/clusters/ota-requestor/OTARequestorInterface.h>

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"
Expand Down