fix slider LED order

This commit is contained in:
beerpsi 2024-01-02 11:54:08 +07:00
parent 4a28826edb
commit cdf7d49fbe

View File

@ -12,7 +12,6 @@ use std::{
};
use ::log::error;
use anyhow::{anyhow, Result};
use shared_memory::Shmem;
use winapi::{
shared::{
@ -34,6 +33,7 @@ cfg_if::cfg_if! {
time::Duration,
};
use anyhow::{anyhow, Result};
use ::log::info;
use rusb::{DeviceHandle, GlobalContext};
@ -294,7 +294,7 @@ pub unsafe extern "C" fn chuni_io_slider_set_leds(rgb: *const u8) {
for (buf_chunk, state_chunk) in buf[1..61]
.chunks_mut(3)
.zip(ground.chunks(3).skip(11).take(20).rev())
.zip(ground.chunks(3).take(20))
{
buf_chunk[0] = state_chunk[0];
buf_chunk[1] = state_chunk[1];
@ -303,7 +303,7 @@ pub unsafe extern "C" fn chuni_io_slider_set_leds(rgb: *const u8) {
for (buf_chunk, state_chunk) in buf[62..95]
.chunks_mut(3)
.zip(ground.chunks(3).take(11).rev())
.zip(ground.chunks(3).skip(20).take(11))
{
buf_chunk[0] = state_chunk[0];
buf_chunk[1] = state_chunk[1];