RTOS Wrapper
API reference
Loading...
Searching...
No Matches
Functions
Utility.h File Reference

Miscellaneous utility helpers for the RTOS wrapper. More...

#include <stdint.h>
#include <functional>
#include "OsUtility.h"

Go to the source code of this file.

Functions

template<typename Func , typename T >
static bool TestLogicWithTimeout (Func func, T expected, uint32_t timeoutMsec, uint32_t checkIntervalMs)
 Helper to repeatedly check a condition until timeout.
 

Detailed Description

Miscellaneous utility helpers for the RTOS wrapper.

Function Documentation

◆ TestLogicWithTimeout()

template<typename Func , typename T >
static bool TestLogicWithTimeout ( Func  func,
T  expected,
uint32_t  timeoutMsec,
uint32_t  checkIntervalMs 
)
inlinestatic

Helper to repeatedly check a condition until timeout.

Template Parameters
FuncCallable returning a comparable value.
TType of the expected value.
Parameters
funcFunction returning a value to compare.
expectedExpected value from the function.
timeoutMsecMaximum time in milliseconds to wait.
checkIntervalMsDelay between checks in milliseconds.
Returns
true if the expected value was returned before timeout.