Skip to content

Commit

Permalink
remove some unnecessary trait bounds for split tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Univa committed Feb 22, 2024
1 parent 5825196 commit 25d21c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions rumcake-macros/src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ pub(crate) fn keyboard_main(
initialization.extend(driver_setup);
spawning.extend(driver_spawns);
spawning.extend(quote! {
spawner.spawn(::rumcake::peripheral_task!(#kb_name, split_peripheral_driver)).unwrap();
});
spawner.spawn(::rumcake::peripheral_task!(split_peripheral_driver)).unwrap();
});
}
None => {
initialization.extend(quote_spanned! {
Expand All @@ -391,8 +391,8 @@ pub(crate) fn keyboard_main(
initialization.extend(driver_setup);
spawning.extend(driver_spawns);
spawning.extend(quote! {
spawner.spawn(::rumcake::central_task!(#kb_name, split_central_driver)).unwrap();
});
spawner.spawn(::rumcake::central_task!(split_central_driver)).unwrap();
});
}
None => {
initialization.extend(quote_spanned! {
Expand Down
4 changes: 2 additions & 2 deletions rumcake/src/split/central.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use embassy_futures::select::{select, Either};
use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex;
use embassy_sync::channel::Channel;

use crate::keyboard::{KeyboardLayout, POLLED_EVENTS_CHANNEL};
use crate::keyboard::POLLED_EVENTS_CHANNEL;
use crate::split::MessageToCentral;

use super::drivers::CentralDeviceDriver;
Expand All @@ -27,7 +27,7 @@ pub static MESSAGE_TO_PERIPHERALS: Channel<ThreadModeRawMutex, MessageToPeripher
Channel::new();

#[rumcake_macros::task]
pub async fn central_task<K: KeyboardLayout>(_k: K, mut driver: impl CentralDeviceDriver) {
pub async fn central_task(mut driver: impl CentralDeviceDriver) {
loop {
match select(
driver.receive_message_from_peripherals(),
Expand Down
4 changes: 2 additions & 2 deletions rumcake/src/split/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ use defmt::{error, Debug2Format};
use embassy_futures::select::{select, Either};
use embassy_sync::pubsub::PubSubBehavior;

use crate::keyboard::{KeyboardMatrix, MATRIX_EVENTS, POLLED_EVENTS_CHANNEL};
use crate::keyboard::{MATRIX_EVENTS, POLLED_EVENTS_CHANNEL};
use crate::split::MessageToPeripheral;

use super::drivers::PeripheralDeviceDriver;

// This task replaces the `layout_collect` task, which is usually used on non-split keyboards for sending events to the keyboard layout
#[rumcake_macros::task]
pub async fn peripheral_task<K: KeyboardMatrix>(_k: K, mut driver: impl PeripheralDeviceDriver) {
pub async fn peripheral_task(mut driver: impl PeripheralDeviceDriver) {
loop {
match select(
driver.receive_message_from_central(),
Expand Down

0 comments on commit 25d21c7

Please sign in to comment.