Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ glam = { version = "^0.33.5", features = ["serde"] }
image = "=0.25.10"
inotify = "^0.11.5"
ksni = { version = "^0.3.6", default-features = false, features = ["async-io"] }
libc = "^0.2.189"
log = "^0.4.33"
logind-zbus = { version = "^5.3.2" }
mio = "^1.2.2"
Expand Down
4 changes: 1 addition & 3 deletions asusctl/examples/anime-diag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ fn main() {
}

for c in (0..35).step_by(step) {
for i in &mut matrix.get_mut()[c] {
*i = 50;
}
matrix.get_mut()[c].fill(50);
}

let anime_type = get_anime_type();
Expand Down
13 changes: 2 additions & 11 deletions asusd/src/aura_anime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use rog_anime::usb::{
pkt_set_enable_powersave_anim, pkts_for_init,
};
use rog_anime::{ActionData, AnimeDataBuffer, AnimePacketType};
use rog_platform::hid_raw::HidRaw;
use rog_platform::usb_raw::USBRaw;
use tokio::sync::Mutex;

Expand All @@ -23,7 +22,6 @@ use crate::error::RogError;

#[derive(Debug, Clone)]
pub struct AniMe {
hid: Option<Arc<Mutex<HidRaw>>>,
usb: Option<Arc<Mutex<USBRaw>>>,
config: Arc<Mutex<AniMeConfig>>,
cache: AniMeConfigCached,
Expand All @@ -34,13 +32,8 @@ pub struct AniMe {
}

impl AniMe {
pub fn new(
hid: Option<Arc<Mutex<HidRaw>>>,
usb: Option<Arc<Mutex<USBRaw>>>,
config: Arc<Mutex<AniMeConfig>>,
) -> Self {
pub fn new(usb: Option<Arc<Mutex<USBRaw>>>, config: Arc<Mutex<AniMeConfig>>) -> Self {
Self {
hid,
usb,
config,
cache: AniMeConfigCached::default(),
Expand Down Expand Up @@ -78,9 +71,7 @@ impl AniMe {
}

pub async fn write_bytes(&self, message: &[u8]) -> Result<(), RogError> {
if let Some(hid) = &self.hid {
hid.lock().await.write_bytes(message)?;
} else if let Some(usb) = &self.usb {
if let Some(usb) = &self.usb {
usb.lock().await.write_bytes(message)?;
}
Ok(())
Expand Down
Loading