From 746173558ee044bc5920da1c5b49b0cd63fa49e0 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Thu, 18 Jul 2024 11:10:48 -0400 Subject: [PATCH] Grouped extern C statements --- examples/platform/silabs/BaseApplication.h | 4 ++-- ...GenericThreadStackManagerImpl_OpenThread.hpp | 2 +- .../silabs/efr32/ThreadStackManagerImpl.cpp | 17 +++++++---------- third_party/silabs/efr32_sdk.gni | 2 ++ 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/examples/platform/silabs/BaseApplication.h b/examples/platform/silabs/BaseApplication.h index ed233246ec8ee5..161f1cdc9eb2fd 100644 --- a/examples/platform/silabs/BaseApplication.h +++ b/examples/platform/silabs/BaseApplication.h @@ -165,8 +165,8 @@ class BaseApplication static void UpdateCommissioningStatus(bool newState); /** - * @brief Called when the last Fabric is removed, clears all Fabric related data and Thread Wifi provision. - * @note This function preserves some NVM3 data that is not Fabric scoped like Attribute Value or Boot Count. + * @brief Called when the last Fabric is removed, clears all Fabric related data, including Thread and Wifi provision. + * @note This function preserves some NVM3 data that is not Fabric scoped, like Attribute Value or Boot Count. */ static void DoProvisioningReset(); diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp index 3fe20c2cf6a804..61452f5ff0ec90 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp @@ -1090,7 +1090,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_GetPollPeriod(u /** * @brief Helper that sets callbacks for OpenThread state changes and configures the Thread stack. - * Assigns mOTInst to and instance and configures the OT stack on a device by setting state change callbacks enabling features + * Assigns mOTInst to an instance, and configures the OT stack on a device by setting state change callbacks enabling features * for IPv6 address configuration, enabling the Thread network if necessary, and handling SRP if enabled. * Allows for the configuration of the Thread stack on a device where the instance and the otCLI are already initialised. * diff --git a/src/platform/silabs/efr32/ThreadStackManagerImpl.cpp b/src/platform/silabs/efr32/ThreadStackManagerImpl.cpp index ae44ed09fc7a18..d2ae058a8a03f1 100644 --- a/src/platform/silabs/efr32/ThreadStackManagerImpl.cpp +++ b/src/platform/silabs/efr32/ThreadStackManagerImpl.cpp @@ -41,14 +41,11 @@ extern "C" { #include "platform-efr32.h" -} - -// Forward declaration -extern "C" otInstance * otGetInstance(void); - +otInstance * otGetInstance(void); #if CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI -extern "C" void otAppCliInit(otInstance * aInstance); -#endif +void otAppCliInit(otInstance * aInstance); +#endif // CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI +} namespace chip { namespace DeviceLayer { @@ -56,21 +53,21 @@ namespace { otInstance * sOTInstance = NULL; // Network commissioning -#ifndef _NO_NETWORK_COMMISSIONING_DRIVER_ +#ifndef _NO_GENERIC_THREAD_NETWORK_COMMISSIONING_DRIVER_ NetworkCommissioning::GenericThreadDriver sGenericThreadDriver; app::Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(0 /* Endpoint Id */, &sGenericThreadDriver); #endif void initStaticNetworkCommissioningThreadDriver(void) { -#ifndef _NO_NETWORK_COMMISSIONING_DRIVER_ +#ifndef _NO_GENERIC_THREAD_NETWORK_COMMISSIONING_DRIVER_ sThreadNetworkCommissioningInstance.Init(); #endif } void shutdownStaticNetworkCommissioningThreadDriver(void) { -#ifndef _NO_NETWORK_COMMISSIONING_DRIVER_ +#ifndef _NO_GENERIC_THREAD_NETWORK_COMMISSIONING_DRIVER_ sThreadNetworkCommissioningInstance.Shutdown(); #endif } diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index f22f82d464a240..08695af1fc3800 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -916,6 +916,8 @@ template("efr32_sdk") { sources += [ "${efr32_sdk_root}/hardware/driver/configuration_over_swo/src/sl_cos.c", "${efr32_sdk_root}/platform/driver/debug/src/sl_debug_swo.c", + "${efr32_sdk_root}/util/third_party/mbedtls/library/hmac_drbg.c", + "${efr32_sdk_root}/util/third_party/mbedtls/library/psa_crypto_ecp.c", ] }