16 lines
335 B
Rust
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 });
|