Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jul 2009 17:45:49 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 166592 for review
Message-ID:  <200907261745.n6QHjnvr027109@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=166592

Change 166592 by hselasky@hselasky_laptop001 on 2009/07/26 17:45:02

	
	USB input:
	 - improve last patch

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/input/ums.c#22 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/input/ums.c#22 (text+ko) ====

@@ -190,6 +190,7 @@
 	struct usb_page_cache *pc;
 	uint8_t *buf = sc->sc_temp;
 	int32_t buttons = 0;
+	int32_t buttons_found = 0;
 	int32_t dw = 0;
 	int32_t dx = 0;
 	int32_t dy = 0;
@@ -268,19 +269,21 @@
 			uint32_t mask;
 			mask = 1UL << UMS_BUT(i);
 			/* check for correct button ID */
-			if (id != info->sc_iid_btn[i]) {
-				/* keep old button value */
-				buttons |= sc->sc_status.button & mask;
+			if (id != info->sc_iid_btn[i])
 				continue;
-			}
 			/* check for button pressed */
 			if (hid_get_data(buf, len, &info->sc_loc_btn[i]))
 				buttons |= mask;
+			/* register button mask */
+			buttons_found |= mask;
 		}
 
 		if (++info != &sc->sc_info[UMS_INFO_MAX])
 			goto repeat;
 
+		/* keep old button value(s) for non-detected buttons */
+		buttons |= sc->sc_status.button & ~buttons_found;
+
 		if (dx || dy || dz || dt || dw ||
 		    (buttons != sc->sc_status.button)) {
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907261745.n6QHjnvr027109>