Teensy2++ MIDI & Mouse
Yup, you need to edit the USB code to create combinations different than the ones in the menu.
The good news is usb_desc.h was recently improved (Teensy 3.x and LC) to make this much simpler. See the comments in that file for details.
On Teensy 2.0, the process is MUCH harder, and that MSC code for USB Disk is very complex. Sorry. Since then, I've learned from the errors of my earlier ways and I created an easier way for Teensy3.
Thanks. I am on Teensy2++. I have modified my usb_private.h in the hardware\teensy\cores\usb_midi directort as follow, but windows 9 doesn't recognise the USB Composite device, saying "This device cannot start. (Code 10) STATUS_DEVICE_DATA_ERROR". I guess I haven't modified usb_private.h properly?
I believe this file should make windows see a valid mouse. The usb code is a seperate issue???
Excuse my ignorance.......
File below:-
#ifndef usb_serial_h__
#define usb_serial_h__
#include <stdint.h>
#ifdef __cplusplus
extern "C"{
#endif
/**************************************************************************
*
* Configurable Options
*
**************************************************************************/
#define VENDOR_ID 0x16C0
#define PRODUCT_ID 0x0485
#define TRANSMIT_FLUSH_TIMEOUT 4 /* in milliseconds */
#define TRANSMIT_TIMEOUT 25 /* in milliseconds */
/**************************************************************************
*
* Endpoint Buffer Configuration
*
**************************************************************************/
// These buffer sizes are best for most applications, but perhaps if you
// want more buffering on some endpoint at the expense of others, this
// is where you can make such changes. The AT90USB162 has only 176 bytes
// of DPRAM (USB buffers) and only endpoints 3 & 4 can double buffer.
// 0: control
// 1: debug IN
// 2: debug OUT
// 3: midi IN
// 4: midi OUT
// 5: Mouse
#if defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
// 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.
#define STR_PRODUCT L"Teensy MIDI"
#define ENDPOINT0_SIZE 64
#define DEBUG_INTERFACE 1
#define DEBUG_TX_ENDPOINT 1
#define DEBUG_TX_SIZE 64
#define DEBUG_TX_BUFFER EP_DOUBLE_BUFFER
#define DEBUG_TX_INTERVAL 1
#define DEBUG_RX_ENDPOINT 2
#define DEBUG_RX_SIZE 32
#define DEBUG_RX_BUFFER EP_DOUBLE_BUFFER
#define DEBUG_RX_INTERVAL 2
#define MOUSE_INTERFACE 3
#define MOUSE_ENDPOINT 5
#define MOUSE_SIZE 8
#define MOUSE_BUFFER EP_DOUBLE_BUFFER
#define MOUSE_INTERVAL 1
#define MIDI_INTERFACE 0
#define MIDI_TX_ENDPOINT 3
#define MIDI_TX_SIZE 64
#define MIDI_TX_BUFFER EP_DOUBLE_BUFFER
#define MIDI_RX_ENDPOINT 4
#define MIDI_RX_SIZE 64
#define MIDI_RX_BUFFER EP_DOUBLE_BUFFER
#define NUM_ENDPOINTS 6
#define NUM_INTERFACE 3
#endif
// setup
void usb_init(void); // initialize everything
void usb_shutdown(void); // shut off USB
// variables
extern volatile uint8_t usb_configuration;
extern volatile uint8_t usb_suspended;
extern volatile uint8_t debug_flush_timer;
extern uint8_t mouse_buttons;
#ifdef __cplusplus
} // extern "C"
#endif
#endif