Skip to content

Commit 8306331

Browse files
authored
Merge pull request ARMmbed#14554 from jeromecoutant/PR_TICKER_OPTIM
HAL ticker tests update
2 parents 6f43f03 + 3b64279 commit 8306331

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

hal/tests/TESTS/mbed_hal/lp_ticker/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ void lp_ticker_info_test()
111111
TEST_ASSERT(p_ticker_info->frequency <= 64000);
112112
TEST_ASSERT(p_ticker_info->bits >= 12);
113113

114-
#ifdef LP_TICKER_PERIOD_NUM
115-
TEST_ASSERT_UINT32_WITHIN(1, 1000000 * LP_TICKER_PERIOD_DEN / LP_TICKER_PERIOD_NUM, p_ticker_info->frequency);
114+
#if defined(LP_TICKER_PERIOD_NUM) || defined(CHECK_TICKER_OPTIM)
115+
TEST_ASSERT_UINT32_WITHIN(1, (uint64_t)1000000 * LP_TICKER_PERIOD_DEN / LP_TICKER_PERIOD_NUM, p_ticker_info->frequency);
116116
TEST_ASSERT_EQUAL_UINT32(LP_TICKER_MASK, ((uint64_t)1 << p_ticker_info->bits) - 1);
117117
#endif
118118

hal/tests/TESTS/mbed_hal/us_ticker/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ void us_ticker_info_test()
4646

4747
TEST_ASSERT(p_ticker_info->bits >= 16);
4848

49-
#ifdef US_TICKER_PERIOD_NUM
50-
TEST_ASSERT_UINT32_WITHIN(1, 1000000 * US_TICKER_PERIOD_DEN / US_TICKER_PERIOD_NUM, p_ticker_info->frequency);
49+
#if defined(US_TICKER_PERIOD_NUM) || defined(CHECK_TICKER_OPTIM)
50+
TEST_ASSERT_UINT32_WITHIN(1, (uint64_t)1000000 * US_TICKER_PERIOD_DEN / US_TICKER_PERIOD_NUM, p_ticker_info->frequency);
5151
TEST_ASSERT_EQUAL_UINT32(US_TICKER_MASK, ((uint64_t)1 << p_ticker_info->bits) - 1);
5252
#endif
5353
}

0 commit comments

Comments
 (0)