Making Teensy appear as joystick only

Tabbourg

New member
I am trying to make a custom joystick using a Teensy 4.0 but the device I want to use my joystick with(A wheelchair with a LUCI Mobility setup) doesn't work correctly with composite devices. It recognizes the hat switch and nothing else when I use keyboard+mouse+joystick or flight sim+joystick. I tried to configure my Teensy to use only the joystick interface, but when I remove the serial interface from my definition I get a compilation error. Am I doing something wrong? Is there another way I can achieve this?

Error:
Code:
C:\Users\USER\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy4\usb.c: In function 'endpoint0_complete':
C:\Users\USER\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy4\usb.c:802:17: warning: variable 'setup' set but not used [-Wunused-but-set-variable]
  802 |         setup_t setup;
      |                 ^~~~~
At top level:
C:\Users\USER\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy4\usb.c:93:16: warning: 'endpoint0_buffer' defined but not used [-Wunused-variable]
   93 | static uint8_t endpoint0_buffer[8];
      |                ^~~~~~~~~~~~~~~~
c:/users/user/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\USER\AppData\Local\Temp\arduino\sketches\2007355DAE745057341C3CB281868ED1/core\core.a(yield.cpp.o): in function `usb_seremu_class::available()':
C:\Users\USER\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy4/usb_seremu.h:83: undefined reference to `usb_seremu_available'
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

My custom joystick definition:
Code:
#elif defined(USB_CUSTOM_CONTROLLER)
  #define VENDOR_ID        0x16C0
  #define PRODUCT_ID        0x0488
  #define BCD_DEVICE        0x0211
  #define MANUFACTURER_NAME    {'T','o','m','m','y',' ','B','o','u','r','g','e','o','i','s'}
  #define MANUFACTURER_NAME_LEN    15
  #define PRODUCT_NAME        {'J','o','y','s','t','i','c','k'}
  #define PRODUCT_NAME_LEN    8
  #define EP0_SIZE        64
  #define NUM_ENDPOINTS         2
  #define NUM_INTERFACE        1
  #define JOYSTICK_INTERFACE    0    // Joystick
  #define JOYSTICK_ENDPOINT     2
  #define JOYSTICK_SIZE         12    //  12 = normal, 64 = extreme joystick
  #define JOYSTICK_INTERVAL     1
  #define ENDPOINT2_CONFIG    ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
 
Last edited:
Well, I never got rid of the emuserial interface, but my original problem was solved by changing the joystick hid descriptor to gamepad mode.
 
Back
Top