PERFORCE change 166957 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Aug 3 07:09:43 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166957
Change 166957 by hselasky at hselasky_laptop001 on 2009/08/03 07:09:06
USB input:
- patch for cordump slowdown. Use microtime() instead of DELAY().
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/input/ukbd.c#25 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/input/ukbd.c#25 (text+ko) ====
@@ -170,6 +170,7 @@
int32_t sc_state; /* shift/lock key state */
int32_t sc_accents; /* accent key index (> 0) */
+ uint16_t sc_microtime; /* used when polling */
uint16_t sc_inputs;
uint16_t sc_inputhead;
uint16_t sc_inputtail;
@@ -302,18 +303,32 @@
static void
ukbd_do_poll(struct ukbd_softc *sc, uint8_t wait)
{
+ struct timeval tv;
+ uint16_t temp;
+
DPRINTFN(2, "polling\n");
while (sc->sc_inputs == 0) {
usbd_transfer_poll(sc->sc_xfer, UKBD_N_TRANSFER);
- DELAY(1000); /* delay 1 ms */
+ microtime(&tv);
- sc->sc_time_ms++;
+ temp = tv.tv_usec / 25000;
/* support repetition of keys: */
+ if (sc->sc_microtime != temp) {
+
+ /* wait for next delta */
+
+ sc->sc_microtime = temp;
+
+ /* 25 milliseconds have passed */
+
+ sc->sc_time_ms += 25;
+ }
+
ukbd_interrupt(sc);
if (!wait)
More information about the p4-projects
mailing list