File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -56,14 +56,15 @@ void send_movement_packet(void)
5656 int max = 3 ;
5757 int timeout = 0 ;
5858
59-
6059 if (five_button_mode )
6160 max = 4 ;
6261 /* sometimes the host will get behind */
63- while (aux_buffer_available () < max && timeout ++ < 25 )
62+ while (aux_buffer_available () < max && timeout ++ < 25 &&
63+ (* task_get_event_bitmap (emumouse_task_id ) & PS2MOUSE_EVT_AUX_DATA ) == 0 ) {
6464 usleep (10 * MSEC );
65+ }
6566
66- if (timeout == 25 ) {
67+ if (timeout == 25 || ( * task_get_event_bitmap ( emumouse_task_id ) & PS2MOUSE_EVT_AUX_DATA ) ) {
6768 CPRINTS ("PS2M Dropping" );
6869 /*drop mouse packet - host is too far behind */
6970 return ;
@@ -431,9 +432,7 @@ void mouse_interrupt_handler_task(void *p)
431432 if (ec_mode_disabled == false) {
432433 if (evt & PS2MOUSE_EVT_AUX_DATA ) {
433434 process_request (aux_data );
434- }
435-
436- if (evt & PS2MOUSE_EVT_INTERRUPT ) {
435+ } else if (evt & PS2MOUSE_EVT_INTERRUPT ) {
437436 usleep (4 * MSEC );
438437 /* at the expensive of a slight additional latency
439438 * check to see if the soc has grabbed this out from under us
You can’t perform that action at this time.
0 commit comments