Skip to content

Commit

Permalink
support for via over bluetooth
Browse files Browse the repository at this point in the history
this requires updating the via/vial app to send a report ID of 3
  • Loading branch information
Univa committed Jan 2, 2024
1 parent 21988e5 commit 524d1bb
Show file tree
Hide file tree
Showing 7 changed files with 423 additions and 185 deletions.
27 changes: 13 additions & 14 deletions rumcake-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,20 @@ pub fn main(
}
}

if keyboard.via.is_some() || keyboard.vial.is_some() {
if keyboard.usb && (keyboard.via.is_some() || keyboard.vial.is_some()) {
initialization.extend(quote! {
// Via HID setup
let (via_reader, via_writer) =
rumcake::via::setup_usb_via_hid_reader_writer(&mut builder).split();
rumcake::usb::setup_usb_via_hid_reader_writer(&mut builder).split();
});
spawning.extend(quote! {
// HID raw report (for VIA) reading and writing
spawner
.spawn(rumcake::usb_hid_via_read_task!(via_reader))
.unwrap();
});
spawning.extend(quote! {
spawner.spawn(rumcake::usb_hid_via_write_task!(via_writer)).unwrap();
});
}

Expand All @@ -497,14 +506,10 @@ pub fn main(
}

spawning.extend(quote! {
// HID raw report (for VIA) reading and writing
spawner
.spawn(rumcake::usb_hid_via_read_task!(via_reader))
.spawn(rumcake::via_process_task!(#kb_name))
.unwrap();
});
spawning.extend(quote! {
spawner.spawn(rumcake::usb_hid_via_write_task!(#kb_name, via_writer)).unwrap();
});
} else if let Some(args) = keyboard.vial {
let args = args.unwrap_or_default();

Expand All @@ -520,15 +525,9 @@ pub fn main(
});
}

spawning.extend(quote! {
// HID raw report (for VIA) reading and writing
spawner
.spawn(rumcake::usb_hid_via_read_task!(via_reader))
.unwrap();
});
spawning.extend(quote! {
spawner
.spawn(rumcake::usb_hid_vial_write_task!(#kb_name, via_writer))
.spawn(rumcake::vial_process_task!(#kb_name))
.unwrap();
});
}
Expand Down
Loading

0 comments on commit 524d1bb

Please sign in to comment.