mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
roccat: break infinite loops
When waiting for a status, the mouse sometimes answers 0x02, which seems to be EINVAL (though it can be an ACK too). Treat this answer so we do not end up in some infinite loops. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
@@ -277,6 +277,9 @@ roccat_is_ready(struct ratbag_device *device)
|
||||
if (buf[1] == 0x03)
|
||||
msleep(100);
|
||||
|
||||
if (buf[1] == 0x02)
|
||||
return -EINVAL;
|
||||
|
||||
return buf[1] == 0x01;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user