Skip to content

Commit

Permalink
update for via/vial compatibility, fix volume provider
Browse files Browse the repository at this point in the history
  • Loading branch information
zzeneg committed Aug 14, 2023
1 parent 7143f0d commit d9eb532
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file modified dist/qmk-hid-host.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion src/data_type.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub enum DataType {
Time,
Time = 0xAA, // random value that does not conflict with VIA/VIAL, must match firmware
Volume,
Layout,
MediaArtist,
Expand Down
2 changes: 1 addition & 1 deletion src/providers/volume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ unsafe fn get_volume_endpoint() -> IAudioEndpointVolume {
}

fn send_data(value: &f32, push_sender: &mpsc::Sender<Vec<u8>>) {
let volume = (value * 100.0) as u8;
let volume = (value * 100.0).round() as u8;
let data = vec![DataType::Volume as u8, volume];
push_sender.try_send(data).unwrap_or_else(|e| tracing::error!("{}", e));
}
Expand Down

0 comments on commit d9eb532

Please sign in to comment.