Skip to content

Commit b52575b

Browse files
committed
littlefs: Added checks for __CLZ instruction in IAR
1 parent 2cf4715 commit b52575b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

features/filesystem/littlefs/littlefs/lfs_util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static inline uint32_t lfs_min(uint32_t a, uint32_t b) {
3939
static inline uint32_t lfs_ctz(uint32_t a) {
4040
#if defined(__GNUC__) || defined(__CC_ARM)
4141
return __builtin_ctz(a);
42-
#elif defined(__ICCARM__)
42+
#elif defined(__ICCARM__) && defined(__CLZ)
4343
return __CLZ(__RBIT(a));
4444
#else
4545
uint32_t r = 32;
@@ -57,7 +57,7 @@ static inline uint32_t lfs_ctz(uint32_t a) {
5757
static inline uint32_t lfs_npw2(uint32_t a) {
5858
#if defined(__GNUC__) || defined(__CC_ARM)
5959
return 32 - __builtin_clz(a-1);
60-
#elif defined(__ICCARM__)
60+
#elif defined(__ICCARM__) && defined(__CLZ)
6161
return 32 - __CLZ(a-1);
6262
#else
6363
uint32_t r = 0;

0 commit comments

Comments
 (0)