From 3ef49906f5b3719988a72ba4a06627723dbb938e Mon Sep 17 00:00:00 2001 From: Univa <41708691+Univa@users.noreply.github.com> Date: Thu, 11 Apr 2024 10:14:40 -0400 Subject: [PATCH] separate trait bounds needed to run via and vial tasks --- rumcake-macros/src/keyboard.rs | 4 ++-- rumcake/src/via/mod.rs | 6 +++--- rumcake/src/vial/mod.rs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rumcake-macros/src/keyboard.rs b/rumcake-macros/src/keyboard.rs index c1fc6ca..de3e497 100644 --- a/rumcake-macros/src/keyboard.rs +++ b/rumcake-macros/src/keyboard.rs @@ -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 { @@ -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(); }); } diff --git a/rumcake/src/via/mod.rs b/rumcake/src/via/mod.rs index fd484da..e915484 100644 --- a/rumcake/src/via/mod.rs +++ b/rumcake/src/via/mod.rs @@ -172,7 +172,7 @@ pub(crate) const VIA_REPORT_DESCRIPTOR: &[u8] = &[ ]; #[rumcake_macros::task] -pub async fn via_process_task(_k: K) +pub async fn via_process_task(_k: K, _t: T) where [(); <::FlashStorageType as FlashStorage>::ERASE_SIZE]:, [(); K::DYNAMIC_KEYMAP_LAYER_COUNT * K::Layout::LAYOUT_COLS * K::Layout::LAYOUT_ROWS * 2]:, @@ -204,8 +204,8 @@ where } let via_state: Mutex> = 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 { diff --git a/rumcake/src/vial/mod.rs b/rumcake/src/vial/mod.rs index f4694c2..faca376 100644 --- a/rumcake/src/vial/mod.rs +++ b/rumcake/src/vial/mod.rs @@ -68,7 +68,7 @@ pub trait VialKeyboard: ViaKeyboard { pub(crate) static VIAL_DIRECT_SET_CHANNEL: Channel = Channel::new(); #[rumcake_macros::task] -pub async fn vial_process_task(_k: K) +pub async fn vial_process_task(_k: K, _t: T) where [(); <::FlashStorageType as FlashStorage>::ERASE_SIZE]:, [(); K::DYNAMIC_KEYMAP_LAYER_COUNT * K::Layout::LAYOUT_COLS * K::Layout::LAYOUT_ROWS * 2]:, @@ -102,8 +102,8 @@ where let vial_state: Mutex = Mutex::new(Default::default()); let via_state: Mutex> = 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;