Browse Source

Do not send Contact Count (HID Usage 0x54) with USB Touchscreen

main
PaulStoffregen 6 years ago
parent
commit
6e50efa1d3
3 changed files with 11 additions and 11 deletions
  1. +5
    -5
      teensy3/usb_desc.c
  2. +3
    -3
      teensy3/usb_desc.h
  3. +3
    -3
      teensy3/usb_touch.c

+ 5
- 5
teensy3/usb_desc.c View File

0x95, 0x01, // Report Count (1) 0x95, 0x01, // Report Count (1)
0x09, 0x56, // Usage (Scan Time) 0x09, 0x56, // Usage (Scan Time)
0x81, 0x02, // Input (variable,absolute) 0x81, 0x02, // Input (variable,absolute)
0x09, 0x54, // Usage (Contact Count)
0x25, MULTITOUCH_FINGERS, // Logical Maximum (10)
0x75, 0x08, // Report Size (8)
0x95, 0x01, // Report Count (1)
0x81, 0x02, // Input (variable,absolute)
//0x09, 0x54, // Usage (Contact Count)
//0x25, MULTITOUCH_FINGERS, // Logical Maximum (10)
//0x75, 0x08, // Report Size (8)
//0x95, 0x01, // Report Count (1)
//0x81, 0x02, // Input (variable,absolute)
0x05, 0x0D, // Usage Page (Digitizers) 0x05, 0x0D, // Usage Page (Digitizers)
0x09, 0x55, // Usage (Contact Count Maximum) 0x09, 0x55, // Usage (Contact Count Maximum)
0x25, MULTITOUCH_FINGERS, // Logical Maximum (10) 0x25, MULTITOUCH_FINGERS, // Logical Maximum (10)

+ 3
- 3
teensy3/usb_desc.h View File

#define KEYMEDIA_INTERVAL 4 #define KEYMEDIA_INTERVAL 4
#define MULTITOUCH_INTERFACE 3 // Touchscreen #define MULTITOUCH_INTERFACE 3 // Touchscreen
#define MULTITOUCH_ENDPOINT 5 #define MULTITOUCH_ENDPOINT 5
#define MULTITOUCH_SIZE 9
#define MULTITOUCH_SIZE 8
#define MULTITOUCH_FINGERS 10 #define MULTITOUCH_FINGERS 10
#define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY #define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
#define MOUSE_INTERVAL 2 #define MOUSE_INTERVAL 2
#define MULTITOUCH_INTERFACE 4 // Touchscreen #define MULTITOUCH_INTERFACE 4 // Touchscreen
#define MULTITOUCH_ENDPOINT 5 #define MULTITOUCH_ENDPOINT 5
#define MULTITOUCH_SIZE 9
#define MULTITOUCH_SIZE 8
#define MULTITOUCH_FINGERS 10 #define MULTITOUCH_FINGERS 10
#define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY #define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
#define AUDIO_SYNC_ENDPOINT 14 #define AUDIO_SYNC_ENDPOINT 14
#define MULTITOUCH_INTERFACE 12 // Touchscreen #define MULTITOUCH_INTERFACE 12 // Touchscreen
#define MULTITOUCH_ENDPOINT 15 #define MULTITOUCH_ENDPOINT 15
#define MULTITOUCH_SIZE 9
#define MULTITOUCH_SIZE 8
#define MULTITOUCH_FINGERS 10 #define MULTITOUCH_FINGERS 10
#define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY #define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE #define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE

+ 3
- 3
teensy3/usb_touch.c View File

// 5: Y msb // 5: Y msb
// 6: scan time lsb // 6: scan time lsb
// 7: scan time msb // 7: scan time msb
// 8: contact count
// (no longer used) 8: contact count


static int usb_touchscreen_transmit(int index, int count) static int usb_touchscreen_transmit(int index, int count)
{ {
*(tx_packet->buf + 5) = ypos[index] >> 8; *(tx_packet->buf + 5) = ypos[index] >> 8;
*(tx_packet->buf + 6) = scan_timestamp; *(tx_packet->buf + 6) = scan_timestamp;
*(tx_packet->buf + 7) = scan_timestamp >> 8; *(tx_packet->buf + 7) = scan_timestamp >> 8;
*(tx_packet->buf + 8) = count;
tx_packet->len = 9;
//*(tx_packet->buf + 8) = count;
tx_packet->len = 8;
usb_tx(MULTITOUCH_ENDPOINT, tx_packet); usb_tx(MULTITOUCH_ENDPOINT, tx_packet);
return 1; return 1;
} }

Loading…
Cancel
Save