tests/lib/gui/lvgl: use littlefs
Switch to using LittleFS instead of NFFS, which will be removed. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
parent
04b2c170c1
commit
7402297b20
2 changed files with 8 additions and 15 deletions
|
@ -8,9 +8,9 @@ CONFIG_DUMMY_DISPLAY_DEV_NAME="DISPLAY"
|
||||||
CONFIG_LOG=y
|
CONFIG_LOG=y
|
||||||
|
|
||||||
CONFIG_FLASH=y
|
CONFIG_FLASH=y
|
||||||
|
CONFIG_FLASH_MAP=y
|
||||||
CONFIG_FILE_SYSTEM=y
|
CONFIG_FILE_SYSTEM=y
|
||||||
CONFIG_FILE_SYSTEM_NFFS=y
|
CONFIG_FILE_SYSTEM_LITTLEFS=y
|
||||||
CONFIG_FS_NFFS_FLASH_DEV_NAME="flash_ctrl"
|
|
||||||
|
|
||||||
CONFIG_LVGL=y
|
CONFIG_LVGL=y
|
||||||
# Make sure that the rendering task is always executed if we call
|
# Make sure that the rendering task is always executed if we call
|
||||||
|
|
|
@ -9,19 +9,20 @@
|
||||||
#include <zephyr.h>
|
#include <zephyr.h>
|
||||||
#include <device.h>
|
#include <device.h>
|
||||||
#include <fs/fs.h>
|
#include <fs/fs.h>
|
||||||
#include <nffs/nffs.h>
|
#include <fs/littlefs.h>
|
||||||
#include <ztest.h>
|
#include <ztest.h>
|
||||||
|
|
||||||
#include <lvgl.h>
|
#include <lvgl.h>
|
||||||
|
|
||||||
#define IMG_FILE_PATH "/mnt/img.bin"
|
#define IMG_FILE_PATH "/mnt/img.bin"
|
||||||
|
|
||||||
static struct nffs_flash_desc flash_desc;
|
FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(cstorage);
|
||||||
|
|
||||||
static struct fs_mount_t mnt = {
|
static struct fs_mount_t mnt = {
|
||||||
.type = FS_NFFS,
|
.type = FS_LITTLEFS,
|
||||||
.mnt_point = "/mnt",
|
.fs_data = &cstorage,
|
||||||
.fs_data = &flash_desc,
|
.storage_dev = (void *)DT_FLASH_AREA_STORAGE_ID,
|
||||||
|
.mnt_point = "/mnt"
|
||||||
};
|
};
|
||||||
|
|
||||||
void test_get_default_screen(void)
|
void test_get_default_screen(void)
|
||||||
|
@ -73,19 +74,11 @@ void test_add_img(void)
|
||||||
|
|
||||||
void setup_fs(void)
|
void setup_fs(void)
|
||||||
{
|
{
|
||||||
struct device *flash_dev;
|
|
||||||
struct fs_file_t img;
|
struct fs_file_t img;
|
||||||
struct fs_dirent info;
|
struct fs_dirent info;
|
||||||
int ret;
|
int ret;
|
||||||
const lv_img_dsc_t *c_img = get_lvgl_img();
|
const lv_img_dsc_t *c_img = get_lvgl_img();
|
||||||
|
|
||||||
flash_dev = device_get_binding(CONFIG_FS_NFFS_FLASH_DEV_NAME);
|
|
||||||
if (flash_dev == NULL) {
|
|
||||||
TC_PRINT("Could not get flash device \"%s\"\n",
|
|
||||||
CONFIG_FS_NFFS_FLASH_DEV_NAME);
|
|
||||||
ztest_test_fail();
|
|
||||||
}
|
|
||||||
mnt.storage_dev = flash_dev;
|
|
||||||
ret = fs_mount(&mnt);
|
ret = fs_mount(&mnt);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
TC_PRINT("Failed to mount file system: %d\n", ret);
|
TC_PRINT("Failed to mount file system: %d\n", ret);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue