fix(tasoller_v1): swapped air bits

This commit is contained in:
beerpsi 2024-01-16 07:58:37 +07:00
parent c35990b29d
commit e1b285782d

View File

@ -19,12 +19,12 @@
//! - Bits 0..26: ???
//! - Bit 26: FN2 (1 = pressed)
//! - Bit 27: FN1 (1 = pressed)
//! - Bit 28: IR2
//! - Bit 29: IR1
//! - Bit 30: IR4
//! - Bit 31: IR3
//! - Bit 32: IR6
//! - Bit 33: IR5
//! - Bit 28: IR1
//! - Bit 29: IR2
//! - Bit 30: IR3
//! - Bit 31: IR4
//! - Bit 32: IR5
//! - Bit 33: IR6
//! - Bits 34..66: touch sensor 1-32 (1 = held, top -> bottom then left -> right)
//! - Bits 66..88: ???
//!
@ -58,12 +58,8 @@ pub fn jvs_poll(input: &[u8]) -> (u8, u8) {
let opbtn = input[3] >> 3 & 1 | input[3] >> 1 & 2;
// IR1-6 in order
let beams = input[3] >> 5 & 1
| input[3] >> 3 & 2
| input[3] >> 5 & 4
| input[3] >> 3 & 8
| input[4] << 3 & 16
| input[4] << 5 & 32;
let beams = input[3] >> 4
| (input[4] & 3) << 4;
(opbtn, beams)
}