From f5f275c8e9e6144e75a6c9a63932160e123bee6b Mon Sep 17 00:00:00 2001 From: Dniel97 Date: Mon, 25 Dec 2023 15:12:25 +0100 Subject: [PATCH] chuniio: fixed individual IR notes --- chuniio/chuniio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chuniio/chuniio.c b/chuniio/chuniio.c index c5d81e5..27fe7b0 100644 --- a/chuniio/chuniio.c +++ b/chuniio/chuniio.c @@ -91,12 +91,12 @@ void chuni_io_jvs_poll(uint8_t *opbtn, uint8_t *beams) } } else { // Use actual AIR - // IR format is beams[5:0] = {b5,b6,b3,b4,b1,b2}; - for (i = 0 ; i < 3 ; i++) { - if (GetAsyncKeyState(chuni_io_cfg.vk_ir[i*2]) & 0x8000) - *beams |= (1 << (i*2+1)); - if (GetAsyncKeyState(chuni_io_cfg.vk_ir[i*2+1]) & 0x8000) - *beams |= (1 << (i*2)); + for (i = 0; i < 6; i++) { + if(GetAsyncKeyState(chuni_io_cfg.vk_ir[i]) & 0x8000) { + *beams |= (1 << i); + } else { + *beams &= ~(1 << i); + } } } }