diff --git a/src/backends/tasoller_v1.rs b/src/backends/tasoller_v1.rs index 67d1c9c..19021a5 100644 --- a/src/backends/tasoller_v1.rs +++ b/src/backends/tasoller_v1.rs @@ -135,13 +135,14 @@ pub fn set_led_colors( let air_rgb = if board == 0 { 0x96 } else { 0xB4 }; let output_start = if board == 0 { 96 } else { 168 }; - for buf_chunk in output[output_start..output_start + 72] + for (buf_chunk, state_chunk) in output[output_start..output_start + 72] .chunks_mut(3) .take(24) + .zip(rgb[air_rgb..air_rgb + 9].chunks(3).cycle().take(24)) { - buf_chunk[0] = rgb[air_rgb + 1]; - buf_chunk[1] = rgb[air_rgb]; - buf_chunk[2] = rgb[air_rgb + 2]; + buf_chunk[0] = state_chunk[1]; + buf_chunk[1] = state_chunk[0]; + buf_chunk[2] = state_chunk[2]; } device.write_bulk(0x03, output, TIMEOUT)?; diff --git a/src/backends/tasoller_v2.rs b/src/backends/tasoller_v2.rs index 7789685..18bb3eb 100644 --- a/src/backends/tasoller_v2.rs +++ b/src/backends/tasoller_v2.rs @@ -107,13 +107,15 @@ pub fn set_led_colors( let air_rgb = if board == 0 { 0x96 } else { 0xB4 }; let output_start = if board == 0 { 96 } else { 168 }; - for buf_chunk in output[output_start..output_start + 72] + + for (buf_chunk, state_chunk) in output[output_start..output_start + 72] .chunks_mut(3) .take(24) + .zip(rgb[air_rgb..air_rgb + 9].chunks(3).cycle().take(24)) { - buf_chunk[0] = rgb[air_rgb + 1]; - buf_chunk[1] = rgb[air_rgb]; - buf_chunk[2] = rgb[air_rgb + 2]; + buf_chunk[0] = state_chunk[1]; + buf_chunk[1] = state_chunk[0]; + buf_chunk[2] = state_chunk[2]; } device.write_bulk(0x03, output, TIMEOUT)?;