PaulStoffregen / USBHost_t36

USB Host Library for Teensy 3.6 and 4.0
166 stars 85 forks source link

Trying to create only mouse + serial menu option #121

Open TomWithoutJerry opened 1 year ago

TomWithoutJerry commented 1 year ago

Hello, I tried to create an option for only mouse and serial by editing the usb_desc.h and boards.txt, however the issue is I still see two HID-compliant mouse

Here's what I changed in usb_desc.h:


#elif defined(USB_SERIAL_MOUSE)
  #define VENDOR_ID             0x16C0
  #define PRODUCT_ID            0x0487
  #define DEVICE_CLASS          0xEF
  #define DEVICE_SUBCLASS       0x02
  #define DEVICE_PROTOCOL       0x01
  #define MANUFACTURER_NAME     {'T','e','e','n','s','y','d','u','i','n','o'}
  #define MANUFACTURER_NAME_LEN 11
  #define PRODUCT_NAME          {'S','e','r','i','a','l','/','M','o','u','s','e'}
  #define PRODUCT_NAME_LEN      12
  #define EP0_SIZE              64
  #define NUM_ENDPOINTS         4
  #define NUM_INTERFACE         3
  #define CDC_IAD_DESCRIPTOR    1
  #define CDC_STATUS_INTERFACE  0
  #define CDC_DATA_INTERFACE    1   // Serial
  #define CDC_ACM_ENDPOINT      1
  #define CDC_RX_ENDPOINT       2
  #define CDC_TX_ENDPOINT       2
  #define CDC_ACM_SIZE          16
  #define CDC_RX_SIZE_480       512
  #define CDC_TX_SIZE_480       512
  #define CDC_RX_SIZE_12        64
  #define CDC_TX_SIZE_12        64
  #define MOUSE_INTERFACE       2   // Mouse
  #define MOUSE_ENDPOINT        3
  #define MOUSE_SIZE            8
  #define MOUSE_INTERVAL        2
  #define ENDPOINT1_CONFIG      ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
  #define ENDPOINT2_CONFIG      ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK
  #define ENDPOINT3_CONFIG      ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT

for boards.txt:

teensy41.menu.usb.mouse=Mouse
teensy41.menu.usb.mouse.build.usbtype=USB_SERIAL_MOUSE
teensy41.menu.usb.mouse.upload_port.usbtype=USB_SERIAL_MOUSE

I could upload the code and everything is working but I still two HID in device manager, I want to disable the one I'm not using.