diff --git a/src/lv_misc/lv_fs.c b/src/lv_misc/lv_fs.c index 6d0a01188..ddf8f3810 100644 --- a/src/lv_misc/lv_fs.c +++ b/src/lv_misc/lv_fs.c @@ -37,7 +37,6 @@ * STATIC PROTOTYPES **********************/ static const char * lv_fs_get_real_path(const char * path); -static lv_fs_drv_t * lv_fs_get_drv(char letter); /********************** * STATIC VARIABLES @@ -493,6 +492,24 @@ void lv_fs_drv_register(lv_fs_drv_t * drv_p) memcpy(new_drv, drv_p, sizeof(lv_fs_drv_t)); } +/** + * Give a pointer to a driver from its letter + * @param letter the driver letter + * @return pointer to a driver or NULL if not found + */ +lv_fs_drv_t * lv_fs_get_drv(char letter) +{ + lv_fs_drv_t * drv; + + LV_LL_READ(LV_GC_ROOT(_lv_drv_ll), drv) + { + if(drv->letter == letter) { + return drv; + } + } + + return NULL; +} /** * Fill a buffer with the letters of existing drivers * @param buf buffer to store the letters ('\0' added after the last letter) @@ -621,23 +638,4 @@ static const char * lv_fs_get_real_path(const char * path) return path; } -/** - * Give a pointer to a driver from its letter - * @param letter the driver letter - * @return pointer to a driver or NULL if not found - */ -static lv_fs_drv_t * lv_fs_get_drv(char letter) -{ - lv_fs_drv_t * drv; - - LV_LL_READ(LV_GC_ROOT(_lv_drv_ll), drv) - { - if(drv->letter == letter) { - return drv; - } - } - - return NULL; -} - #endif /*LV_USE_FILESYSTEM*/ diff --git a/src/lv_misc/lv_fs.h b/src/lv_misc/lv_fs.h index e4a84b9e4..5b86b8efd 100644 --- a/src/lv_misc/lv_fs.h +++ b/src/lv_misc/lv_fs.h @@ -126,6 +126,13 @@ void lv_fs_drv_init(lv_fs_drv_t * drv); */ void lv_fs_drv_register(lv_fs_drv_t * drv_p); +/** + * Give a pointer to a driver from its letter + * @param letter the driver letter + * @return pointer to a driver or NULL if not found + */ +lv_fs_drv_t * lv_fs_get_drv(char letter); + /** * Test if a drive is rady or not. If the `ready` function was not initialized `true` will be * returned.