fix hid regression on yubideck

pull/13/head
4yn 2022-08-08 22:58:24 +08:00
parent 0b75d1c62e
commit e285bdb999
1 changed files with 2 additions and 1 deletions

View File

@ -211,11 +211,12 @@ impl HidJob {
0x02, // Need to confirm 0x02, // Need to confirm
*disable_air, *disable_air,
|buf, input| { |buf, input| {
if buf.len != 45 { if buf.len != 45 && buf.len != 46 {
return; return;
} }
input.ground.copy_from_slice(&buf.data[2..34]); input.ground.copy_from_slice(&buf.data[2..34]);
input.flip_vert();
for i in 0..6 { for i in 0..6 {
input.air[i ^ 1] = (buf.data[0] >> i) & 1; input.air[i ^ 1] = (buf.data[0] >> i) & 1;
} }