We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c390e89 commit 301232eCopy full SHA for 301232e
littlefs/lfs_util.h
@@ -10,6 +10,9 @@
10
#include <stdlib.h>
11
#include <stdint.h>
12
#include <stdio.h>
13
+#ifdef __ICCARM__
14
+#include <intrinsics.h>
15
+#endif
16
17
18
// Builtin functions
@@ -22,11 +25,19 @@ static inline uint32_t lfs_min(uint32_t a, uint32_t b) {
22
25
}
23
26
24
27
static inline uint32_t lfs_ctz(uint32_t a) {
28
29
+ return __CLZ(__REV(a));
30
+#else
31
return __builtin_ctz(a);
32
33
34
35
static inline uint32_t lfs_npw2(uint32_t a) {
36
37
+ return 32 - __CLZ(a-1);
38
39
return 32 - __builtin_clz(a-1);
40
41
42
43
static inline int lfs_scmp(uint32_t a, uint32_t b) {
0 commit comments