Skip to content

Commit bfdd916

Browse files
authored
Merge pull request #14532 from kjbracey-arm/ticker_log1
Make ticker computation use shift-by-0
2 parents 291beda + 904d4e4 commit bfdd916

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hal/source/mbed_ticker_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static inline uint32_t gcd(uint32_t a, uint32_t b)
110110

111111
static int exact_log2(uint32_t n)
112112
{
113-
for (int i = 31; i > 0; --i) {
113+
for (int i = 31; i >= 0; --i) {
114114
if ((1U << i) == n) {
115115
return i;
116116
}

0 commit comments

Comments
 (0)