From 6fc33f4d9c860e07ba286154ba6ec22c1b19e620 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Mon, 16 Oct 2017 17:52:35 -0500 Subject: [PATCH] Fixed incorrect instruction in IAR ctz implementation The RBIT instruction reverses the bits of a word, not REV --- littlefs/lfs_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/littlefs/lfs_util.h b/littlefs/lfs_util.h index 3ca878c089..73e9d03ebe 100644 --- a/littlefs/lfs_util.h +++ b/littlefs/lfs_util.h @@ -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) { #ifdef __ICCARM__ - return __CLZ(__REV(a)); + return __CLZ(__RBIT(a)); #else return __builtin_ctz(a); #endif