Skip to content

Commit eaf6f81

Browse files
authored
Merge pull request #6225 from studavekar/measure-drift-longer
Flash test: fix the time over a longer range
2 parents 8cc6d6c + efe4600 commit eaf6f81

File tree

1 file changed

+3
-3
lines changed
  • TESTS/mbed_hal/flash/functional_tests

1 file changed

+3
-3
lines changed

TESTS/mbed_hal/flash/functional_tests/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
using namespace utest::v1;
2929

30-
#define TEST_CYCLES 1000000
31-
#define ALLOWED_DRIFT_PPM 5000 //0.5%
30+
#define TEST_CYCLES 10000000
31+
#define ALLOWED_DRIFT_PPM (1000000/5000) //0.5%
3232

3333
/*
3434
return values to be checked are documented at:
@@ -269,7 +269,7 @@ void flash_buffer_alignment_test()
269269
void flash_clock_and_cache_test()
270270
{
271271
const int timer_diff_end = time_cpu_cycles(TEST_CYCLES);
272-
const int acceptable_range = timer_diff_start / (1000000 / ALLOWED_DRIFT_PPM);
272+
const int acceptable_range = timer_diff_start / (ALLOWED_DRIFT_PPM);
273273
TEST_ASSERT_UINT32_WITHIN(acceptable_range, timer_diff_start, timer_diff_end);
274274
}
275275

0 commit comments

Comments
 (0)