Skip to content

Commit

Permalink
chore: tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex4386 committed Jun 4, 2024
1 parent 6f353a5 commit 429190f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/scenes/mtp/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ enum UsbDevDescStr {
UsbDevManuf = 1,
UsbDevProduct = 2,
UsbDevSerial = 3,
UsbDevHighSpeed = 4,
UsbDevLowSpeed = 5,
};
/* === END furi_hal_usb_i.h === */

Expand Down
10 changes: 5 additions & 5 deletions src/scenes/mtp/usb_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const struct usb_device_descriptor usb_mtp_dev_descr = {
.bDescriptorType = USB_DTYPE_DEVICE,
.bcdUSB = VERSION_BCD(2, 0, 0),
.bDeviceClass = USB_CLASS_STILL_IMAGE, // MTP falls under Still Image class
.bDeviceSubClass = 1, // Subclass for MTP
.bDeviceProtocol = 1, // Protocol for MTP
.bMaxPacketSize0 = USB_EP0_SIZE,
.bDeviceSubClass = USB_SUBCLASS_MTP, // Subclass for MTP
.bDeviceProtocol = USB_PROTO_MTP, // Protocol for MTP
.bMaxPacketSize0 = MTP_MAX_PACKET_SIZE,
.idVendor = 0x0483, // STMicroelectronics
.idProduct = 0x5741, // Custom Product ID
.bcdDevice = VERSION_BCD(1, 0, 0),
Expand All @@ -31,8 +31,8 @@ const struct MtpDescriptor usb_mtp_cfg_descr = {
.bDescriptorType = USB_DTYPE_CONFIGURATION,
.wTotalLength = sizeof(struct MtpDescriptor),
.bNumInterfaces = 1,
.bConfigurationValue = 1,
.iConfiguration = NO_DESCRIPTOR,
.bConfigurationValue = USB_CONF_VAL_MTP,
.iConfiguration = UsbDevHighSpeed,
.bmAttributes = USB_CFG_ATTR_RESERVED | USB_CFG_ATTR_SELFPOWERED,
.bMaxPower = USB_CFG_POWER_MA(100),
},
Expand Down
6 changes: 6 additions & 0 deletions src/scenes/mtp/usb_desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
#include <furi_hal.h>
#include <furi_hal_usb.h>

#define USB_SUBCLASS_MTP 0x01
#define USB_PROTO_MTP 0x01
#define USB_CONF_VAL_MTP 1

#define MTP_MAX_PACKET_SIZE 512

struct MtpDescriptor {
struct usb_config_descriptor config;
struct usb_interface_descriptor intf;
Expand Down

0 comments on commit 429190f

Please sign in to comment.