Merge branch 'master' of ssh://git.code.sf.net/p/newrpl/sources

This commit is contained in:
claudiol 2017-12-27 16:53:57 -05:00
commit 45db654dc2
4 changed files with 21 additions and 26 deletions

View file

@ -1088,10 +1088,10 @@ int HID_API_EXPORT hid_read_timeout(hid_device *dev, unsigned char *data, size_t
pthread_cleanup_push(&cleanup_mutex, dev);
/* There's an input report queued up. Return it. */
if (dev->input_reports) {
while(dev->input_reports) {
/* Return the first one */
bytes_read = return_data(dev, data, length);
goto ret;
if(bytes_read) goto ret;
}
if (dev->shutdown_thread) {
@ -1127,7 +1127,7 @@ int HID_API_EXPORT hid_read_timeout(hid_device *dev, unsigned char *data, size_t
if (res == 0) {
if (dev->input_reports) {
bytes_read = return_data(dev, data, length);
break;
if(bytes_read) break;
}
/* If we're here, there was a spurious wake up

View file

@ -253,8 +253,8 @@ LIBS += -L/usr/local/lib
DISTFILES +=
#QMAKE_CFLAGS += -Wno-duplicate-decl-specifier
# Clang doesn't like double const specifiers, but are needed for firmware: disable the warning
clang: QMAKE_CFLAGS += -Wno-duplicate-decl-specifier
@ -273,8 +273,11 @@ HEADERS += external/hidapi/hidapi/hidapi.h
win32: SOURCES += external/hidapi/windows/hid.c
win32: LIBS += -lsetupapi
unix:!macx: SOURCES += external/hidapi/linux/hid.c
unix:!macx: LIBS += -ludev
freebsd: SOURCES += external/hidapi/libusb/hid.c
freebsd: LIBS += -lusb -lthr -liconv
unix:!macx:!freebsd: SOURCES += external/hidapi/linux/hid.c
unix:!macx:!freebsd: LIBS += -ludev
macx: SOURCES += external/hidapi/mac/hid.c
macx: LIBS += -framework CoreFoundation -framework IOKit

View file

@ -295,20 +295,8 @@ RESOURCES += \
#QMAKE_CFLAGS += -Wno-duplicate-decl-specifier
# Clang doesn't like double const specifiers, but are needed for firmware: disable the warning
clang: QMAKE_CFLAGS += -Wno-duplicate-decl-specifier
@ -331,8 +319,12 @@ HEADERS += external/hidapi/hidapi/hidapi.h
win32: SOURCES += external/hidapi/windows/hid.c
win32: LIBS += -lsetupapi
unix:!macx: SOURCES += external/hidapi/linux/hid.c
unix:!macx: LIBS += -ludev
freebsd: SOURCES += external/hidapi/libusb/hid.c
freebsd: LIBS += -lusb -lthr -liconv
unix:!macx:!freebsd: SOURCES += external/hidapi/linux/hid.c
unix:!macx:!freebsd: LIBS += -ludev
macx: SOURCES += external/hidapi/mac/hid.c
macx: LIBS += -framework CoreFoundation -framework IOKit

View file

@ -191,11 +191,11 @@ void USBSelector::RefreshList()
int res=hid_write(thisdev,((const unsigned char *)getversion)+3,(getversion[1]>>8)+9);
int res=hid_write(thisdev,((const unsigned char *)getversion)+3,RAWHID_TX_SIZE+1);//(getversion[1]>>8)+9);
int available=0;
if(res>0) {
unsigned char buffer[1024];
res=hid_read_timeout(thisdev,buffer,1024,100);
res=hid_read_timeout(thisdev,buffer,1024,500);
if(res>0) {
// WE GOT A RESPONSE, THE DEVICE IS ALIVE!
@ -211,7 +211,7 @@ void USBSelector::RefreshList()
res=hid_write(thisdev,buffer,RAWHID_TX_SIZE+1);
if(res>0) {
res=hid_read_timeout(thisdev,buffer,1024,100);
res=hid_read_timeout(thisdev,buffer,1024,2000);
if(res>0) {
// WE GOT A RESPONSE, THE DEVICE IS ALIVE!