Skip to content

Commit

Permalink
Add background event handling for CASE establish (project-chip#24099)
Browse files Browse the repository at this point in the history
* Add background event handling for CASE establish

CASE session establishment has operations which are costly, such as
checking certificate chains. The handshake messages are processed in the
event thread, so while these operations occur, other events cannot be
processed. This delays responses, and can cause the event queue to fill
entirely, which is fatal.

This commit adds support for background event processing, and uses it to
process the most costly operations during CASESesssion::HandleSigma3.

- add platform support for background event processing:
  ScheduleBackgroundWork, RunBackgroundEventLoop, etc.
- add device config flags for enabling/disabling and configuration
- add implementation for FreeRTOS platform
- refactor some CASESession operations so they can be static, avoiding
  use of member variables
- break HandlSigma3 into 3 parts A/B/C:
  - HandleSigma3a (foreground, processes incoming message)
  - HandleSigma3b (background, performs most costly operations)
  - HandleSigma3c (foreground, sends status report)

This breakup of HandleSigma3 was done in a fairly straightforward manner
so it could be clearer, during review, that behaviour has not
substantially changed. A subsequent commit should clean it up further by
introducing helper code for managing the foreground/background work,
lifetime of work object, when to send status report and/or abort pending
establish, etc.

Also still to do is implementation for other platforms, and for other
messages in CASESession (e.g. Sigma2), and for other costly operations
(e.g. PASESession).

Currently, CASE session establishment is simplified:

- only one pairing session is active at a time
- it's always the same CASESession object in CASEServer
- the two classes are higly coupled (e.g. CASEServer relies upon
  CASESession aborting the pending establish if an error occurs)

Therefore, HandleSigma3b can rely upon the lifetime of the CASESession
object, use an additional state and sequence number to synchronize
work across foreground/background, and avoid use of member variables.
If and when CASE session establishment becomes more complex, assumptions
should be revisited.

TESTING

Testing was performed on M5Stack (ESP32) by commissioning using the
Google Home app on Android.

First, baseline behaviour with background events disabled:

- If no errors, commissioning succeeds as before
- If HandleSigma3a fails and sends a status report,
  pairing retries promptly and succeeds
- If HandleSigma3a fails and cannot send a status report,
  pairing retries after about a minute and succeeds
- If HandleSigma3c succeeds but cannot send a status report,
  pairing retries after about a minute and succeeds

Next, improved behaviour with background events enabled:

- If no errors, commissioning succeeds as before
- If HandleSigma3a fails and sends a status report,
  pairing retries promptly and succeeds
  - (this includes failure to schedule HandleSigma3b)
- If HandleSigma3b fails and sends a status report,
  pairing retries promptly and succeeds
- If HandleSigma3c fails and sends a status report,
  pairing retries promptly and succeeds
- If HandleSigma3c succeeds but cannot send a status report,
  pairing retries after about a minute and succeeds
- If HandleSigma3b is starved (scheduled but does not complete),
  after several minutes the failsafe timer fires, then Home app
  allows try again, which then succeeds
- If HandleSigma3b is delayed (completes late), the sequence number
  is unexpected, so no status report is sent, then
  after several minutes the failsafe timer fires, then Home app
  allows try again, which then succeeds

* Remove WIP code

* Address some comments from code review

* Remove cruft from testing.

* Remove some conditional compilation

* Remove some conditional compilation

* Move function back where it was

Had more related changes, but they're all removed, so remove this
change also.

* Add some documentation

Change error code also.

* Use platform new/delete

* Undo changes that are merely reordering

Cleanup can occur in a subsequent commit.

* Undo changes that are merely reordering

Cleanup can occur in a subsequent commit.

* Remove include file fix (C/C++)

* Add documentation to background processing API

* Use alternate fabrics table API

* Improve documentation

* Add assertion

* Undo some unrelated cleanup

* Update src/protocols/secure_channel/CASESession.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Ensure root cert buf keeps span

* Restyled by whitespace

* Restyled by clang-format

* Add new functions to GenericPlatformManagerImpl

So all platforms build and work, even if they don't use the new feature.

* Attempt to fix build errors on some platforms

Apparently initializing structs with anonymous unions is challenging.

* Improving host test environment

This commit has a bunch of extra logging etc. to flush out any more
CI issues.

* Remove log statements and clean up

* Update fake PlatformManagerImpl

* Increase timeout on fake linux CI

* Redo changes to make tests work

Undo previous changes to test/app contexts, and go back to just fixing
the tests more surgically and contained.

Passes Linux host tests and Linux fake platform tests now.

* Undo SetSystemLayerForTesting

nRF/Zephyr tests don't like this not being cleaned up.
May fix Darwin too?

* Change fake linux tests timeout back to 15 mins

* Restyle

* Init/shutdown platform mgr in TestCASESession

Seems needed on Darwin.

---------

Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored and David Lechner committed Mar 22, 2023
1 parent 941cd69 commit 7b8e5d0
Show file tree
Hide file tree
Showing 16 changed files with 669 additions and 169 deletions.
3 changes: 3 additions & 0 deletions examples/platform/esp32/common/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
// this function will happen on the CHIP event loop thread, not the app_main thread.
PlatformMgr().AddEventHandler(CHIPDeviceManager::CommonDeviceEventHandler, reinterpret_cast<intptr_t>(cb));

// Start a task to run the CHIP Device background event loop.
ReturnErrorOnFailure(PlatformMgr().StartBackgroundEventLoopTask());

// Start a task to run the CHIP Device event loop.
return PlatformMgr().StartEventLoopTask();
}
Expand Down
2 changes: 2 additions & 0 deletions src/credentials/FabricTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <lib/support/DefaultStorageKeyAllocator.h>
#include <lib/support/SafeInt.h>
#include <lib/support/ScopedBuffer.h>
#include <platform/LockTracker.h>

namespace chip {
using namespace Credentials;
Expand Down Expand Up @@ -342,6 +343,7 @@ CHIP_ERROR FabricTable::VerifyCredentials(FabricIndex fabricIndex, const ByteSpa
FabricId & outFabricId, NodeId & outNodeId, Crypto::P256PublicKey & outNocPubkey,
Crypto::P256PublicKey * outRootPublicKey) const
{
assertChipStackLockedByCurrentThread();
uint8_t rootCertBuf[kMaxCHIPCertLength];
MutableByteSpan rootCertSpan{ rootCertBuf };
ReturnErrorOnFailure(FetchRootCert(fabricIndex, rootCertSpan));
Expand Down
15 changes: 6 additions & 9 deletions src/credentials/FabricTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -912,13 +912,17 @@ class DLL_EXPORT FabricTable
*/
void RevertPendingOpCertsExceptRoot();

// Verifies credentials, with the fabric's root under fabricIndex, and extract critical bits.
// This call is used for CASE.
// Verifies credentials, using the root certificate of the provided fabric index.
CHIP_ERROR VerifyCredentials(FabricIndex fabricIndex, const ByteSpan & noc, const ByteSpan & icac,
Credentials::ValidationContext & context, CompressedFabricId & outCompressedFabricId,
FabricId & outFabricId, NodeId & outNodeId, Crypto::P256PublicKey & outNocPubkey,
Crypto::P256PublicKey * outRootPublicKey = nullptr) const;

// Verifies credentials, using the provided root certificate.
static CHIP_ERROR VerifyCredentials(const ByteSpan & noc, const ByteSpan & icac, const ByteSpan & rcac,
Credentials::ValidationContext & context, CompressedFabricId & outCompressedFabricId,
FabricId & outFabricId, NodeId & outNodeId, Crypto::P256PublicKey & outNocPubkey,
Crypto::P256PublicKey * outRootPublicKey = nullptr);
/**
* @brief Enables FabricInfo instances to collide and reference the same logical fabric (i.e Root Public Key + FabricId).
*
Expand Down Expand Up @@ -1093,13 +1097,6 @@ class DLL_EXPORT FabricTable
mStateFlags.HasAll(StateFlags::kIsPendingFabricDataPresent, StateFlags::kIsUpdatePending);
}

// Verifies credentials, using the provided root certificate.
// This call is done whenever a fabric is "directly" added
static CHIP_ERROR VerifyCredentials(const ByteSpan & noc, const ByteSpan & icac, const ByteSpan & rcac,
Credentials::ValidationContext & context, CompressedFabricId & outCompressedFabricId,
FabricId & outFabricId, NodeId & outNodeId, Crypto::P256PublicKey & outNocPubkey,
Crypto::P256PublicKey * outRootPublicKey);

// Validate an NOC chain at time of adding/updating a fabric (uses VerifyCredentials with additional checks).
// The `existingFabricId` is passed for UpdateNOC, and must match the Fabric, to make sure that we are
// not trying to change FabricID with UpdateNOC. If set to kUndefinedFabricId, we are doing AddNOC and
Expand Down
49 changes: 47 additions & 2 deletions src/include/platform/CHIPDeviceConfig.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
* The priority of the chip task.
*/
#ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY
#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY 1
#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY 2
#endif

/**
Expand All @@ -91,6 +91,51 @@
#define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 100
#endif

/**
* CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING
*
* Enable support for background event processing.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING
#define CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING 0
#endif

/**
* CHIP_DEVICE_CONFIG_BG_TASK_NAME
*
* The name of the background task.
*/
#ifndef CHIP_DEVICE_CONFIG_BG_TASK_NAME
#define CHIP_DEVICE_CONFIG_BG_TASK_NAME "BG"
#endif

/**
* CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE
*
* The size (in bytes) of the background task stack.
*/
#ifndef CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE
#define CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE (6 * 1024)
#endif

/**
* CHIP_DEVICE_CONFIG_BG_TASK_PRIORITY
*
* The priority of the background task.
*/
#ifndef CHIP_DEVICE_CONFIG_BG_TASK_PRIORITY
#define CHIP_DEVICE_CONFIG_BG_TASK_PRIORITY 1
#endif

/**
* CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE
*
* The maximum number of events that can be held in the chip background event queue.
*/
#ifndef CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE
#define CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE 1
#endif

/**
* CHIP_DEVICE_CONFIG_ENABLE_SED
*
Expand Down Expand Up @@ -648,7 +693,7 @@
* The priority of the OpenThread task.
*/
#ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY
#define CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY 2
#define CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY 3
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion src/include/platform/CHIPDeviceLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
namespace chip {
namespace DeviceLayer {

void SetSystemLayerForTesting(System::LayerImpl * layer);
void SetSystemLayerForTesting(System::Layer * layer);

// These functions are defined in src/platform/Globals.cpp
chip::System::Layer & SystemLayer();
Expand Down
74 changes: 71 additions & 3 deletions src/include/platform/PlatformManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class PlatformManager
* other.
*/
CHIP_ERROR InitChipStack();

CHIP_ERROR AddEventHandler(EventHandlerFunct handler, intptr_t arg = 0);
void RemoveEventHandler(EventHandlerFunct handler, intptr_t arg = 0);
void SetDelegate(PlatformManagerDelegate * delegate) { mDelegate = delegate; }
Expand Down Expand Up @@ -137,7 +138,7 @@ class PlatformManager
* processing, the callback function may be called (on the work item
* processing thread) before ScheduleWork returns.
*/
void ScheduleWork(AsyncWorkFunct workFunct, intptr_t arg = 0);
CHIP_ERROR ScheduleWork(AsyncWorkFunct workFunct, intptr_t arg = 0);

/**
* Process work items until StopEventLoopTask is called. RunEventLoop will
Expand Down Expand Up @@ -183,6 +184,7 @@ class PlatformManager
* returns.
*/
CHIP_ERROR StopEventLoopTask();

void LockChipStack();
bool TryLockChipStack();
void UnlockChipStack();
Expand All @@ -201,6 +203,47 @@ class PlatformManager
[[nodiscard]] CHIP_ERROR PostEvent(const ChipDeviceEvent * event);
void PostEventOrDie(const ChipDeviceEvent * event);

/**
* Generally this function has the same semantics as ScheduleWork
* except it applies to background processing.
*
* Delegates to PostBackgroundEvent (which will delegate to PostEvent if
* CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING is not true).
*/
CHIP_ERROR ScheduleBackgroundWork(AsyncWorkFunct workFunct, intptr_t arg = 0);

/**
* Generally this function has the same semantics as PostEvent
* except it applies to background processing.
*
* If CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING is not true, will delegate
* to PostEvent.
*
* Only accepts events of type kCallWorkFunct or kNoOp.
*
* Returns CHIP_ERROR_INVALID_ARGUMENT if the event type is not acceptable.
* Returns CHIP_ERROR_NO_MEMORY if resources are exhausted.
*/
CHIP_ERROR PostBackgroundEvent(const ChipDeviceEvent * event);

/**
* Generally this function has the same semantics as RunEventLoop
* except it applies to background processing.
*/
void RunBackgroundEventLoop();

/**
* Generally this function has the same semantics as StartEventLoopTask
* except it applies to background processing.
*/
CHIP_ERROR StartBackgroundEventLoopTask();

/**
* Generally this function has the same semantics as StopEventLoopTask
* except it applies to background processing.
*/
CHIP_ERROR StopBackgroundEventLoopTask();

private:
bool mInitialized = false;
PlatformManagerDelegate * mDelegate = nullptr;
Expand Down Expand Up @@ -352,9 +395,9 @@ inline void PlatformManager::HandleServerShuttingDown()
static_cast<ImplClass *>(this)->_HandleServerShuttingDown();
}

inline void PlatformManager::ScheduleWork(AsyncWorkFunct workFunct, intptr_t arg)
inline CHIP_ERROR PlatformManager::ScheduleWork(AsyncWorkFunct workFunct, intptr_t arg)
{
static_cast<ImplClass *>(this)->_ScheduleWork(workFunct, arg);
return static_cast<ImplClass *>(this)->_ScheduleWork(workFunct, arg);
}

inline void PlatformManager::RunEventLoop()
Expand Down Expand Up @@ -432,6 +475,31 @@ inline void PlatformManager::PostEventOrDie(const ChipDeviceEvent * event)
static_cast<int>(event->Type), status.Format());
}

inline CHIP_ERROR PlatformManager::ScheduleBackgroundWork(AsyncWorkFunct workFunct, intptr_t arg)
{
return static_cast<ImplClass *>(this)->_ScheduleBackgroundWork(workFunct, arg);
}

inline CHIP_ERROR PlatformManager::PostBackgroundEvent(const ChipDeviceEvent * event)
{
return static_cast<ImplClass *>(this)->_PostBackgroundEvent(event);
}

inline void PlatformManager::RunBackgroundEventLoop()
{
static_cast<ImplClass *>(this)->_RunBackgroundEventLoop();
}

inline CHIP_ERROR PlatformManager::StartBackgroundEventLoopTask()
{
return static_cast<ImplClass *>(this)->_StartBackgroundEventLoopTask();
}

inline CHIP_ERROR PlatformManager::StopBackgroundEventLoopTask()
{
return static_cast<ImplClass *>(this)->_StopBackgroundEventLoopTask();
}

inline void PlatformManager::DispatchEvent(const ChipDeviceEvent * event)
{
static_cast<ImplClass *>(this)->_DispatchEvent(event);
Expand Down
7 changes: 6 additions & 1 deletion src/include/platform/internal/GenericPlatformManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ class GenericPlatformManagerImpl
void _RemoveEventHandler(PlatformManager::EventHandlerFunct handler, intptr_t arg);
void _HandleServerStarted();
void _HandleServerShuttingDown();
void _ScheduleWork(AsyncWorkFunct workFunct, intptr_t arg);
CHIP_ERROR _ScheduleWork(AsyncWorkFunct workFunct, intptr_t arg);
CHIP_ERROR _ScheduleBackgroundWork(AsyncWorkFunct workFunct, intptr_t arg);
CHIP_ERROR _PostBackgroundEvent(const ChipDeviceEvent * event);
void _RunBackgroundEventLoop(void);
CHIP_ERROR _StartBackgroundEventLoopTask(void);
CHIP_ERROR _StopBackgroundEventLoopTask();
void _DispatchEvent(const ChipDeviceEvent * event);

// ===== Support methods that can be overridden by the implementation subclass.
Expand Down
54 changes: 46 additions & 8 deletions src/include/platform/internal/GenericPlatformManagerImpl.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,56 @@ void GenericPlatformManagerImpl<ImplClass>::_HandleServerShuttingDown()
}

template <class ImplClass>
void GenericPlatformManagerImpl<ImplClass>::_ScheduleWork(AsyncWorkFunct workFunct, intptr_t arg)
CHIP_ERROR GenericPlatformManagerImpl<ImplClass>::_ScheduleWork(AsyncWorkFunct workFunct, intptr_t arg)
{
ChipDeviceEvent event;
event.Type = DeviceEventType::kCallWorkFunct;
event.CallWorkFunct.WorkFunct = workFunct;
event.CallWorkFunct.Arg = arg;
ChipDeviceEvent event{ .Type = DeviceEventType::kCallWorkFunct };
event.CallWorkFunct = { .WorkFunct = workFunct, .Arg = arg };
CHIP_ERROR err = Impl()->PostEvent(&event);
if (err != CHIP_NO_ERROR)
{
ChipLogError(DeviceLayer, "Failed to schedule work: %" CHIP_ERROR_FORMAT, err.Format());
}
return err;
}

CHIP_ERROR status = Impl()->PostEvent(&event);
if (status != CHIP_NO_ERROR)
template <class ImplClass>
CHIP_ERROR GenericPlatformManagerImpl<ImplClass>::_ScheduleBackgroundWork(AsyncWorkFunct workFunct, intptr_t arg)
{
ChipDeviceEvent event{ .Type = DeviceEventType::kCallWorkFunct };
event.CallWorkFunct = { .WorkFunct = workFunct, .Arg = arg };
CHIP_ERROR err = Impl()->PostBackgroundEvent(&event);
if (err != CHIP_NO_ERROR)
{
ChipLogError(DeviceLayer, "Failed to schedule work: %" CHIP_ERROR_FORMAT, status.Format());
ChipLogError(DeviceLayer, "Failed to schedule background work: %" CHIP_ERROR_FORMAT, err.Format());
}
return err;
}

template <class ImplClass>
CHIP_ERROR GenericPlatformManagerImpl<ImplClass>::_PostBackgroundEvent(const ChipDeviceEvent * event)
{
// Impl class must override to implement background event processing
return Impl()->PostEvent(event);
}

template <class ImplClass>
void GenericPlatformManagerImpl<ImplClass>::_RunBackgroundEventLoop(void)
{
// Impl class must override to implement background event processing
}

template <class ImplClass>
CHIP_ERROR GenericPlatformManagerImpl<ImplClass>::_StartBackgroundEventLoopTask(void)
{
// Impl class must override to implement background event processing
return CHIP_NO_ERROR;
}

template <class ImplClass>
CHIP_ERROR GenericPlatformManagerImpl<ImplClass>::_StopBackgroundEventLoopTask(void)
{
// Impl class must override to implement background event processing
return CHIP_NO_ERROR;
}

template <class ImplClass>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,19 @@ class GenericPlatformManagerImpl_FreeRTOS : public GenericPlatformManagerImpl<Im
TaskHandle_t mEventLoopTask = NULL;
bool mChipTimerActive;

#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING
QueueHandle_t mBackgroundEventQueue = NULL;
TaskHandle_t mBackgroundEventLoopTask = NULL;
#endif

// ===== Methods that implement the PlatformManager abstract interface.

CHIP_ERROR _InitChipStack();

void _LockChipStack(void);
bool _TryLockChipStack(void);
void _UnlockChipStack(void);

CHIP_ERROR _PostEvent(const ChipDeviceEvent * event);
void _RunEventLoop(void);
CHIP_ERROR _StartEventLoopTask(void);
Expand All @@ -80,7 +87,12 @@ class GenericPlatformManagerImpl_FreeRTOS : public GenericPlatformManagerImpl<Im

#if CHIP_STACK_LOCK_TRACKING_ENABLED
bool _IsChipStackLockedByCurrentThread() const;
#endif // CHIP_STACK_LOCK_TRACKING_ENABLED
#endif

CHIP_ERROR _PostBackgroundEvent(const ChipDeviceEvent * event);
void _RunBackgroundEventLoop(void);
CHIP_ERROR _StartBackgroundEventLoopTask(void);
CHIP_ERROR _StopBackgroundEventLoopTask();

// ===== Methods available to the implementation subclass.

Expand All @@ -97,11 +109,26 @@ class GenericPlatformManagerImpl_FreeRTOS : public GenericPlatformManagerImpl<Im
uint8_t mEventQueueBuffer[CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE * sizeof(ChipDeviceEvent)];
StaticQueue_t mEventQueueStruct;
#endif
#if defined(CHIP_CONFIG_FREERTOS_USE_STATIC_TASK) && CHIP_CONFIG_FREERTOS_USE_STATIC_TASK
StackType_t mEventLoopStack[CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE / sizeof(StackType_t)];
StaticTask_t mEventLoopTaskStruct;
#endif

std::atomic<bool> mShouldRunEventLoop;

#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING
static void BackgroundEventLoopTaskMain(void * arg);

#if defined(CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE) && CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE
uint8_t mBackgroundQueueBuffer[CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE * sizeof(ChipDeviceEvent)];
StaticQueue_t mBackgroundQueueStruct;
#endif
#if defined(CHIP_CONFIG_FREERTOS_USE_STATIC_TASK) && CHIP_CONFIG_FREERTOS_USE_STATIC_TASK
StackType_t mEventLoopStack[CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE / sizeof(StackType_t)];
StaticTask_t mventLoopTaskStruct;
StackType_t mBackgroundEventLoopStack[CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE / sizeof(StackType_t)];
StaticTask_t mBackgroundEventLoopTaskStruct;
#endif

std::atomic<bool> mShouldRunBackgroundEventLoop;
#endif

#if defined(CHIP_CONFIG_FREERTOS_USE_STATIC_SEMAPHORE) && CHIP_CONFIG_FREERTOS_USE_STATIC_SEMAPHORE
Expand Down
Loading

0 comments on commit 7b8e5d0

Please sign in to comment.