fix(tasoller_v2): swap opbtn bits

This commit is contained in:
beerpsi 2024-01-16 07:42:41 +07:00
parent ade1b8644d
commit c35990b29d

View File

@ -42,6 +42,7 @@ pub const OUTPUT_MEMORY_SIZE: usize = 240;
#[inline(always)]
pub fn jvs_poll(input: &[u8]) -> (u8, u8) {
let opbtn = input[3] >> 6;
let opbtn = (opbtn & 1) << 1 | (opbtn & 2) >> 1;
let beams = input[3] & 63; // mask for last 6 bits
(opbtn, beams)