Fixed incorrect instruction in IAR ctz implementation

The RBIT instruction reverses the bits of a word, not REV
pull/5538/head
Christopher Haster 2017-10-16 17:52:35 -05:00
parent 383677f604
commit 6fc33f4d9c
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ static inline uint32_t lfs_min(uint32_t a, uint32_t b) {
static inline uint32_t lfs_ctz(uint32_t a) { static inline uint32_t lfs_ctz(uint32_t a) {
#ifdef __ICCARM__ #ifdef __ICCARM__
return __CLZ(__REV(a)); return __CLZ(__RBIT(a));
#else #else
return __builtin_ctz(a); return __builtin_ctz(a);
#endif #endif