硬汉嵌入式论坛

 找回密码
 立即注册
查看: 220|回复: 1
收起左侧

[ThreadX全家桶] USBX PIMA MTP

[复制链接]

12

主题

36

回帖

72

积分

初级会员

积分
72
发表于 2025-10-21 17:53:28 | 显示全部楼层 |阅读模式
使用USBX PIMA MTP ,PC端可以发现单片机的盘符。

通过以下代码只能发现默认目录下面的文件

/* Get the first directory entry in the default directory with full information */
  status = fx_directory_first_full_entry_find(&mmc_disk, file_name, &attributes, &size,
                                              &year, &month, &day, &hour, &minute, &second);

  while (status == FX_SUCCESS)
  {
    if ((attributes == FX_DIRECTORY) || (attributes == FX_ARCHIVE ))
    {
      /* Increment total object number counter */
      object_handles_counter += 1;

      /* Set handle info */
      Object_SetHandleInfo(&object_handle_index_num, file_name, size);

      /* Reset file name array */
      _fx_utility_memory_set((UCHAR*)file_name, 0, FX_MAX_LONG_NAME_LEN);
    }

    /* Get the next directory entry in the default directory with full information */
    status = fx_directory_next_full_entry_find(&mmc_disk, file_name, &attributes, &size,
                                               &year, &month, &day, &hour, &minute, &second);
  }


PC端怎么发现盘符下的所有文件,文件夹等信息

回复

使用道具 举报

1万

主题

7万

回帖

11万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
119430
QQ
发表于 2025-10-22 12:21:17 | 显示全部楼层
帮顶,这个没有研究过
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2025-11-22 08:28 , Processed in 0.036427 second(s), 24 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表