Files
wiringop-rs/src/lib.rs
2024-11-02 12:53:35 +01:00

16 lines
335 B
Rust

use once_cell::sync::Lazy;
mod ffi;
pub mod gpio;
#[macro_export]
macro_rules! ensure_library_setup {
() => {
if !*$crate::LIBRARY_SETUP_COMPLETE {
panic!("wiringOP library failed to set up");
}
};
}
static LIBRARY_SETUP_COMPLETE: Lazy<bool> = Lazy::new(|| unsafe { ffi::wiringPiSetup() == 0 });