Commit Graph

10 Commits (87265f774444cf2a86ec540751b6c242ce716689)

Author SHA1 Message Date
Martin Kojtal e52bb68f93 tests: astyle fix
All tests should comply to our coding standard now
2018-08-03 10:23:38 +01:00
Przemyslaw Stekiel b1b4f6e2ad tests-mbed_drivers-lp_timer: change delay method
The test sometimes fails on NRF51_DK (test case: "Test: LowPowerTimer - time measurement 1 ms.") in morph tests.

The test verifies if LowPowerTimer class correctly counts elapsed time. Sometimes we got measured ~1600 us for delay 1000 us (delta 550 us).
The delay is performed using `wait_us()` function which for delays greater than or equal to 1 ms (our case) calls `Thread::wait((uint32_t)ms);`. This causes rescheduling and potentially can put board into sleep (deep sleep mode is disabled by `wait_us()`). For our test purposes we don't need rescheduling/sleep since this actions takes extra time and have influence on the time measurement accuracy.
The solution is to implement function for delay which is based on busy loop and uses us ticker. It has been verified that this solves the problem. With this fix when measurement of 1 ms is repeated 1000 times we got usually measured time equal to ~1080 us, and sometimes ~1300us (checked that this is caused by systick interrupt handling). Since this is test for drivers layer and the results are acceptable I decided to not disabling systick in the test).
2018-07-11 11:44:27 +02:00
Przemyslaw Stekiel 500be1fbac Fix tolerance definition in ticker tests. 2018-05-25 13:04:23 -05:00
Przemyslaw Stekiel 06c6db5119 tests-mbed_drivers-lp_timer: modify tolerance to percentage form
Represent tolerance value as it is done in `tests-mbed_drivers_timer`.
Use 5% tolerance for lp ticker.
2018-05-25 12:33:42 -05:00
Bartek Szatkowski 6e9f04bf2f Rename DEVICE_LOWPOWERTIMER to DEVICE_LPTICKER
That's to match DEVICE_USTICKER.
2018-05-25 12:20:09 -05:00
jeromecoutant 9a43912177 lp_timer test : add a minimum delta value 2018-01-03 15:37:19 +01:00
Przemyslaw Stekiel 78e1362ec0 Provide fix for Issue #5468.
Issue: https://github.com/ARMmbed/mbed-os/issues/5468
Increased DELTA value for Timer and Low Power Timer tests.
2017-11-13 11:03:29 +01:00
Przemyslaw Stekiel d962f67ca2 Move Timer test, modify ASERT macros, fix comments.
Move Timer test to TESTS/mbed_drivers/ directory which is more suitable.
Fix few comments which are incorrect.
Use more relevant ASERT macros.
2017-11-13 10:43:26 +01:00
Przemyslaw Stekiel d49899a6e2 Provide fix for Timer and LowPowerTimer tests (time accumulation).
LowPoterTimer test gives sometimes failed result while testing measured time accumulation. The check which verifies if total number of elapsed milliseconds is valid fails. Test assumes that delta value equal to 1 ms is sufficient for all test cases, which is not true since in case where time measurement is performed few times in sequence the measurement error also accumulates and 1 ms might be not enough. To solve this problem delta value for milliseconds tests must be updated.
2017-11-13 10:12:11 +01:00
Przemyslaw Stekiel 34a03267d8 Add Low Power Timer test. 2017-10-11 14:55:34 +02:00