]> git.zarvox.org Git - libtouchmouse.git/commitdiff
touchmouse.c: reset the decoder state when a decode error arises.
authorDrew Fisher <drew.m.fisher@gmail.com>
Fri, 11 Nov 2011 08:29:02 +0000 (00:29 -0800)
committerDrew Fisher <drew.m.fisher@gmail.com>
Fri, 11 Nov 2011 08:29:02 +0000 (00:29 -0800)
Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
src/touchmouse.c

index 30c0189ff3f1e03ad65c7832849d69f12adf62d0..765802d5d167d67df643941c0c74ca3b000033b6 100644 (file)
@@ -395,6 +395,7 @@ int touchmouse_process_events_timeout(touchmouse_device *dev, int milliseconds)
                                        }
                                        if (res == DECODER_ERROR) {
                                                fprintf(stderr, "Caught error in decoder, aborting!\n");
+                                               reset_decoder(dev);
                                                return -1;
                                        }
                                        res = process_nybble(dev, (r->data[t] & 0xf0) >> 4);
@@ -410,6 +411,7 @@ int touchmouse_process_events_timeout(touchmouse_device *dev, int milliseconds)
                                        }
                                        if (res == DECODER_ERROR) {
                                                fprintf(stderr, "Caught error in decoder, aborting!\n");
+                                               reset_decoder(dev);
                                                return -1;
                                        }
                                }