Skip to content

Commit f7c0434

Browse files
committed
HAL ticker tests fix u64
(1000000 * LP/US_TICKER_PERIOD_DEN) > U32
1 parent 016d725 commit f7c0434

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void lp_ticker_info_test()
112112
TEST_ASSERT(p_ticker_info->bits >= 12);
113113

114114
#ifdef LP_TICKER_PERIOD_NUM
115-
TEST_ASSERT_UINT32_WITHIN(1, 1000000 * LP_TICKER_PERIOD_DEN / LP_TICKER_PERIOD_NUM, p_ticker_info->frequency);
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void us_ticker_info_test()
4747
TEST_ASSERT(p_ticker_info->bits >= 16);
4848

4949
#ifdef US_TICKER_PERIOD_NUM
50-
TEST_ASSERT_UINT32_WITHIN(1, 1000000 * US_TICKER_PERIOD_DEN / US_TICKER_PERIOD_NUM, p_ticker_info->frequency);
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)