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:
parent
9bb2f9da74
commit
f4d12e0b7a
@ -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 */
|
/* automatically generated by rust-bindgen 0.54.1 */
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ async fn main() {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
println!("{:?}", config);
|
println!("{:?}", config);
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
let ctx = Context::new(config);
|
let ctx = Context::new(config);
|
||||||
|
|
||||||
println!("Press enter to quit");
|
println!("Press enter to quit");
|
||||||
|
@ -227,13 +227,16 @@ impl HidJob {
|
|||||||
|buf, lights| {
|
|buf, lights| {
|
||||||
buf.len = 62;
|
buf.len = 62;
|
||||||
|
|
||||||
let air_color = lights.get_air_middle();
|
|
||||||
let lights_nibbles: Vec<u8> = lights
|
let lights_nibbles: Vec<u8> = lights
|
||||||
.ground
|
.ground
|
||||||
.chunks(3)
|
.chunks(3)
|
||||||
.rev()
|
.rev()
|
||||||
.flat_map(|x| x.iter().map(|y| *y >> 4))
|
.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();
|
.collect();
|
||||||
|
|
||||||
for (buf_chunk, state_chunk) in buf
|
for (buf_chunk, state_chunk) in buf
|
||||||
|
@ -22,7 +22,6 @@ fn get_rainbow(phase: f64, desaturate: bool) -> Rgb<SrgbEncoding, u8> {
|
|||||||
match desaturate {
|
match desaturate {
|
||||||
false => 1.0,
|
false => 1.0,
|
||||||
true => 0.2,
|
true => 0.2,
|
||||||
_ => unreachable!(),
|
|
||||||
},
|
},
|
||||||
1.0,
|
1.0,
|
||||||
))
|
))
|
||||||
|
Loading…
Reference in New Issue
Block a user