mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
inotify relies on tokio, so a switch is required..
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::{CtrlTask, task_watch_item};
|
||||
use crate::{config::Config, error::RogError, GetSupported};
|
||||
use crate::{task_watch_item, CtrlTask};
|
||||
use async_trait::async_trait;
|
||||
use log::{info, warn};
|
||||
use rog_platform::platform::{AsusPlatform, GpuMode};
|
||||
@@ -311,8 +311,9 @@ impl CtrlTask for CtrlRogBios {
|
||||
)
|
||||
.await;
|
||||
|
||||
self.watch_panel_od(executor, signal_ctxt.clone())?;
|
||||
self.watch_gpu_mux_mode(executor, signal_ctxt.clone())?;
|
||||
self.watch_panel_od(executor, signal_ctxt.clone()).await?;
|
||||
self.watch_gpu_mux_mode(executor, signal_ctxt.clone())
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -167,7 +167,8 @@ impl CtrlTask for CtrlPower {
|
||||
)
|
||||
.await;
|
||||
|
||||
self.watch_charge_control_end_threshold(executor, signal_ctxt)?;
|
||||
self.watch_charge_control_end_threshold(executor, signal_ctxt)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ pub trait ZbusAdd {
|
||||
macro_rules! task_watch_item {
|
||||
($name:ident $self_inner:ident) => {
|
||||
concat_idents::concat_idents!(fn_name = watch_, $name {
|
||||
fn fn_name<'a>(
|
||||
async fn fn_name<'a>(
|
||||
&self,
|
||||
executor: &mut Executor<'a>,
|
||||
signal_ctxt: SignalContext<'a>,
|
||||
@@ -91,17 +91,15 @@ macro_rules! task_watch_item {
|
||||
executor
|
||||
.spawn(async move {
|
||||
let mut buffer = [0; 1024];
|
||||
watch.event_stream(&mut buffer).unwrap().for_each(|e|{
|
||||
watch.event_stream(&mut buffer).unwrap().for_each(|_| async {
|
||||
let value = ctrl.$name();
|
||||
dbg!(value);
|
||||
concat_idents::concat_idents!(notif_fn = notify_, $name {
|
||||
Self::notif_fn(&signal_ctxt, value).await.unwrap();
|
||||
});
|
||||
smol::future::ready(())
|
||||
}).await;
|
||||
})
|
||||
.detach();
|
||||
dbg!("SPWADEWFWEFE");
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user