Przeglądaj źródła

update(class/mtp): support obj remove & add event

Signed-off-by: sakumisu <1203593632@qq.com>
sakumisu 6 miesięcy temu
rodzic
commit
8e0ff856fe

+ 3 - 0
class/mtp/usbd_mtp.h

@@ -36,6 +36,9 @@ struct usbd_interface *usbd_mtp_init_intf(struct usbd_interface *intf,
                                           const uint8_t in_ep,
                                           const uint8_t in_ep,
                                           const uint8_t int_ep);
                                           const uint8_t int_ep);
 
 
+int usbd_mtp_notify_object_add(const char *path);
+int usbd_mtp_notify_object_remove(const char *path);
+
 const char *usbd_mtp_fs_root_path(void);
 const char *usbd_mtp_fs_root_path(void);
 const char *usbd_mtp_fs_description(void);
 const char *usbd_mtp_fs_description(void);
 
 

+ 1 - 1
docs/source/support/index.rst

@@ -20,7 +20,7 @@
 
 
 - 主机 UVC & UAC 类 MUSB IP 中 ISO 驱动和 UAC/UVC 框架, MUSB 需要为 mentor 公司制定的标准 IP
 - 主机 UVC & UAC 类 MUSB IP 中 ISO 驱动和 UAC/UVC 框架, MUSB 需要为 mentor 公司制定的标准 IP
 
 
-- 从机 MTP 类驱动, 支持多文件和多文件夹
+- 从机 MTP 类驱动, 支持多文件和多文件夹,支持 MCU 端增删文件并与 PC 同步
 
 
 .. figure:: img/mtpdev.png
 .. figure:: img/mtpdev.png
 
 

+ 1 - 1
platform/fatfs/usbd_fatfs_mtp.c

@@ -13,7 +13,7 @@ FATFS s_sd_disk;
 FIL s_file;
 FIL s_file;
 BYTE work[FF_MAX_SS];
 BYTE work[FF_MAX_SS];
 
 
-const TCHAR driver_num_buf[4] = { '0', ':', '/', '\0' };
+const TCHAR driver_num_buf[3] = { '0', ':', '\0' };
 
 
 const char *show_error_string(FRESULT fresult);
 const char *show_error_string(FRESULT fresult);