Skip to content

Commit

Permalink
separate trait bounds needed to run via and vial tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Univa committed Apr 11, 2024
1 parent 3582267 commit 3ef4990
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions rumcake-macros/src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ pub(crate) fn keyboard_main(

spawning.extend(quote! {
spawner
.spawn(::rumcake::via_process_task!(#id))
.spawn(::rumcake::via_process_task!(#id, #kb_name))
.unwrap();
});
} else if let Some(args) = keyboard.vial {
Expand All @@ -427,7 +427,7 @@ pub(crate) fn keyboard_main(

spawning.extend(quote! {
spawner
.spawn(::rumcake::vial_process_task!(#id))
.spawn(::rumcake::vial_process_task!(#id, #kb_name))
.unwrap();
});
}
Expand Down
6 changes: 3 additions & 3 deletions rumcake/src/via/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ pub(crate) const VIA_REPORT_DESCRIPTOR: &[u8] = &[
];

#[rumcake_macros::task]
pub async fn via_process_task<K: ViaKeyboard + HIDDevice + 'static>(_k: K)
pub async fn via_process_task<K: ViaKeyboard + 'static, T: HIDDevice + 'static>(_k: K, _t: T)
where
[(); <<K::StorageType as StorageDevice>::FlashStorageType as FlashStorage>::ERASE_SIZE]:,
[(); K::DYNAMIC_KEYMAP_LAYER_COUNT * K::Layout::LAYOUT_COLS * K::Layout::LAYOUT_ROWS * 2]:,
Expand Down Expand Up @@ -204,8 +204,8 @@ where
}

let via_state: Mutex<RawMutex, protocol::ViaState<K>> = Mutex::new(Default::default());
let receive_channel = K::get_via_hid_receive_channel();
let send_channel = K::get_via_hid_send_channel();
let receive_channel = T::get_via_hid_receive_channel();
let send_channel = T::get_via_hid_send_channel();

let report_fut = async {
loop {
Expand Down
6 changes: 3 additions & 3 deletions rumcake/src/vial/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub trait VialKeyboard: ViaKeyboard {
pub(crate) static VIAL_DIRECT_SET_CHANNEL: Channel<RawMutex, (u8, RGB8), 4> = Channel::new();

#[rumcake_macros::task]
pub async fn vial_process_task<K: VialKeyboard + HIDDevice + 'static>(_k: K)
pub async fn vial_process_task<K: VialKeyboard + 'static, T: HIDDevice + 'static>(_k: K, _t: T)
where
[(); <<K::StorageType as StorageDevice>::FlashStorageType as FlashStorage>::ERASE_SIZE]:,
[(); K::DYNAMIC_KEYMAP_LAYER_COUNT * K::Layout::LAYOUT_COLS * K::Layout::LAYOUT_ROWS * 2]:,
Expand Down Expand Up @@ -102,8 +102,8 @@ where

let vial_state: Mutex<RawMutex, protocol::VialState> = Mutex::new(Default::default());
let via_state: Mutex<RawMutex, protocol::via::ViaState<K>> = Mutex::new(Default::default());
let receive_channel = K::get_via_hid_receive_channel();
let send_channel = K::get_via_hid_send_channel();
let receive_channel = T::get_via_hid_receive_channel();
let send_channel = T::get_via_hid_send_channel();

if K::VIAL_INSECURE {
vial_state.lock().await.unlocked = true;
Expand Down

0 comments on commit 3ef4990

Please sign in to comment.