use linuxcnc_hal::{error::ResourcesError, HalComponent, RegisterResources, Resources};
use std::{error::Error, thread, time::Duration};
#[derive(Debug)]
struct EmptyResources {}
impl Resources for EmptyResources {
type RegisterError = ResourcesError;
fn register_resources(_comp: &RegisterResources) -> Result<Self, Self::RegisterError> {
Ok(Self {})
}
}
fn main() -> Result<(), Box<dyn Error>> {
let comp = HalComponent::<EmptyResources>::new("empty")?;
while !comp.should_exit() {
println!("Poll");
thread::sleep(Duration::from_millis(1000));
}
Ok(())
}