1
0
mirror of https://github.com/4yn/slidershim.git synced 2024-11-12 00:40:49 +01:00

fix some warning and adjust yubideck lights

This commit is contained in:
4yn 2022-07-24 23:32:34 +08:00
parent 9bb2f9da74
commit f4d12e0b7a
4 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,4 @@
#![ allow( dead_code, unused_imports, non_upper_case_globals ) ]
#![ allow( dead_code, unused_imports, non_upper_case_globals, non_snake_case, deref_nullptr ) ]
/* automatically generated by rust-bindgen 0.54.1 */

View File

@ -34,6 +34,7 @@ async fn main() {
.unwrap();
println!("{:?}", config);
#[allow(unused_variables)]
let ctx = Context::new(config);
println!("Press enter to quit");

View File

@ -227,13 +227,16 @@ impl HidJob {
|buf, lights| {
buf.len = 62;
let air_color = lights.get_air_middle();
let lights_nibbles: Vec<u8> = lights
.ground
.chunks(3)
.rev()
.flat_map(|x| x.iter().map(|y| *y >> 4))
.chain([air_color[0] >> 4, air_color[1] >> 4, air_color[2] >> 4])
.chain([
lights.air_left[3] >> 4,
lights.air_left[4] >> 4,
lights.air_left[5] >> 4,
])
.collect();
for (buf_chunk, state_chunk) in buf

View File

@ -22,7 +22,6 @@ fn get_rainbow(phase: f64, desaturate: bool) -> Rgb<SrgbEncoding, u8> {
match desaturate {
false => 1.0,
true => 0.2,
_ => unreachable!(),
},
1.0,
))