mirror of
https://github.com/espressif/openthread.git
synced 2026-10-10 17:57:48 +00:00
[code-utils] adding helper macro OT_ARRAY_LENGTH() (#2743)
This commit adds helper macro `OT_ARRAY_LENGTH()` to get the number of elements in an array.
This commit is contained in:
committed by
Jonathan Hui
parent
ae7984d3a7
commit
2abd7a2822
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <openthread/openthread.h>
|
||||
|
||||
#include "common/code_utils.hpp"
|
||||
#include "thread/link_quality.hpp"
|
||||
#include "utils/wrap_string.h"
|
||||
|
||||
@@ -427,7 +428,7 @@ void TestSuccessRateTracker(void)
|
||||
|
||||
// Adding success/failure at different rates and checking the RateTracker rate for every sample
|
||||
|
||||
for (uint16_t testRound = 0; testRound < sizeof(kWeightLimit) / sizeof(kWeightLimit[0]) * 2; testRound++)
|
||||
for (uint16_t testRound = 0; testRound < OT_ARRAY_LENGTH(kWeightLimit) * 2; testRound++)
|
||||
{
|
||||
uint16_t weightLimit;
|
||||
bool reverseLogic;
|
||||
|
||||
Reference in New Issue
Block a user