Trying to create only mouse + serial menu option

tomwithoutjerry

New member
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:

Code:
#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:
Code:
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.
 
You might want to look at some other examples, like the current USB_MTPDISK_SERIAL
Which is reasonably similar, other than obviously Mouse is not the same as MTP...

Things like Endpoint 1 is reserved for some undisclosed future stuff. So should update count of endpoints to 4 and change your end points to start at 2...

There are also comments on usb_desc.h:
Code:
Some operating systems, especially Windows, may cache USB device
info.  Changes to the device name may not update on the same
computer unless the vendor or product ID numbers change, or the
"bcdDevice" revision code is increased.
So potentially since you are reusing the PID of the mutliple HID devices, it could be possible that OS has that information cached.
 
Back
Top