Skip to content

Commit d2df5a0

Browse files
committed
Increase wait_ns test tolerance
1 parent 91b22f8 commit d2df5a0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

TESTS/mbed_platform/wait_ns/main.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@ using namespace utest::v1;
3131
*/
3232

3333
/*
34-
* Define tolerance as follows:
35-
* Timer might be +/-5% out; wait_ns is permitted 20% slow, but not fast.
36-
* Therefore minimum measured time should be 95% of requested, maximum should
37-
* be 125%. Unity doesn't let us specify an asymmetric error though.
38-
*/
34+
* Define tolerance as follows:
35+
* Timer might be +/-5% out; wait_ns is permitted 40% slow, but not fast.
36+
* Therefore minimum measured time should be 95% of requested, maximum should
37+
* be 145%. Unity doesn't let us specify an asymmetric error though.
38+
*
39+
* Would be nice to have tighter upper tolerance, but in practice we've seen
40+
* a few devices unable to sustain theoretical throughput - flash wait states?
41+
*/
3942
#define TOLERANCE_MIN 0.95f
40-
#define TOLERANCE_MAX 1.25f
43+
#define TOLERANCE_MAX 1.45f
4144
#define MIDPOINT ((TOLERANCE_MIN+TOLERANCE_MAX)/2)
4245
#define DELTA (MIDPOINT-TOLERANCE_MIN)
4346

0 commit comments

Comments
 (0)