如何确定分区的卷标号

zzwfight
Posts: 1
Joined: Sat May 28, 2022 8:26 am

如何确定分区的卷标号

Postby zzwfight » Sun May 29, 2022 12:00 pm

这是partition.csv
# Name, Type, SubType, Offset, Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, , 0x1000,
factory, app, factory, , 2048k,
storage, data, spiffs, , 1024k,
下面的代码,他想显示图片,他是怎么知道卷标号是 S 的
static void btn_event_cb(lv_event_t *event)
{
lv_obj_t *img = (lv_obj_t *) event->user_data;
const char *file_name = lv_list_get_btn_text(lv_obj_get_parent(event->target), event->target);
char *file_name_with_path = (char *) heap_caps_malloc(256, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);

if (NULL != file_name_with_path) {
/* Get full file name with mount point and folder path */
strcpy(file_name_with_path, "S:/spiffs/");
strcat(file_name_with_path, file_name);

/* Set src of image with file name */
lv_img_set_src(img, file_name_with_path);
//ESP_LOGI(TAG, "image object size : %s", sizeof(img));
/* Align object */
lv_obj_align(img, LV_ALIGN_CENTER, 80, 0);

/* Only for debug */
ESP_LOGI(TAG, "Display image file : %s", file_name_with_path);

/* Don't forget to free allocated memory */
free(file_name_with_path);
}
}

ESP_ZhouL
Posts: 15
Joined: Thu Apr 08, 2021 11:50 am

Re: 如何确定分区的卷标号

Postby ESP_ZhouL » Mon May 30, 2022 3:38 am

这是调用 esp_vfs_spiffs_register() 函数时设置的

Who is online

Users browsing this forum: No registered users and 33 guests