Changeset 470 in flair-src for trunk/tools/Controller
- Timestamp:
- Mar 10, 2022, 2:18:58 PM (3 years ago)
- Location:
- trunk/tools/Controller/DualShock3/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/Controller/DualShock3/src/DualShock3.cpp
r467 r470 382 382 return parse_report_sixaxis_ds3(report, nr); 383 383 } else if (connectionType == UsbEvent) { 384 return parse_input_event( );384 return parse_input_event(100); 385 385 } 386 386 return false; … … 391 391 } 392 392 393 bool DualShock3::parse_input_event( void) {393 bool DualShock3::parse_input_event(int timeout_ms) { 394 394 struct input_event ev[64]; 395 int i, rd; 396 395 int i, rd; 396 fd_set set; 397 struct timeval timeout; 398 399 FD_ZERO(&set); // clear the set 400 FD_SET(usb_fd, &set); // add our file descriptor to the set 401 402 timeout.tv_sec = 0; 403 timeout.tv_usec = timeout_ms * 1000; 404 405 int rv = select(FD_SETSIZE, &set, NULL, NULL, &timeout); 406 407 if (rv <=0) { 408 return false; 409 } 410 397 411 rd = read(usb_fd, ev, sizeof(struct input_event) * 64); 398 412 -
trunk/tools/Controller/DualShock3/src/DualShock3.h
r467 r470 79 79 void setup_device(struct motion_dev *dev); 80 80 bool parse_report_sixaxis_ds3(unsigned char *r, int len); 81 bool parse_input_event( void);81 bool parse_input_event(int timeout_ms); 82 82 int mystr2ba(const char *s, bdaddr_t *ba); 83 83 char *myba2str(const bdaddr_t *ba);
Note:
See TracChangeset
for help on using the changeset viewer.