Implement storedevs, prepare to port littlefs

This commit is contained in:
2025-08-16 12:34:36 +02:00
parent c936910199
commit 2b0566c56f
91 changed files with 54963 additions and 37 deletions

View File

@ -6,4 +6,34 @@
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define LEN(X) (sizeof(X)/sizeof(X[0]))
#define LL_APPEND(head, new) \
do { \
if ((head) != NULL) { \
typeof((head)) __tmp; \
(new)->next = NULL; \
__tmp = (head); \
while (__tmp->next != NULL) { \
__tmp = __tmp->next; \
} \
__tmp->next = (new); \
} else { \
(head) = (new); \
} \
} while(0)
#define LL_REMOVE(head, ele) \
do { \
typeof((head)) __cur = (head); \
typeof((head)) __prev = NULL; \
while (__cur != (ele)) { \
__prev = __cur; \
__cur = __cur->next; \
} \
if (__prev != NULL) { \
__prev->next = __cur->next; \
} \
} while(0)
char *util_get_filename(char *path);
#endif // UTIL_UTIL_H_