2021-01-20 20:43:34 +08:00
|
|
|
#![no_std]
|
2021-02-03 22:26:13 +08:00
|
|
|
#![cfg_attr(feature = "nightly", feature(core_intrinsics))]
|
2021-01-20 20:43:34 +08:00
|
|
|
|
|
|
|
pub mod hardware;
|
2021-03-18 03:16:13 +08:00
|
|
|
pub mod net;
|
2021-06-01 23:55:42 +08:00
|
|
|
|
|
|
|
/// Macro to reduce rightward drift when calling the same closure-based API
|
|
|
|
/// on multiple structs simultaneously, e.g. when accessing DMA buffers.
|
|
|
|
/// This could be improved a bit using the tuple-based style from `mutex-trait`.
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! flatten_closures {
|
|
|
|
($fn:ident, $e:ident, $fun:block) => {
|
|
|
|
$e.$fn(|$e| $fun ).unwrap()
|
|
|
|
};
|
|
|
|
($fn:ident, $e:ident, $($es:ident),+, $fun:block) => {
|
|
|
|
$e.$fn(|$e| flatten_closures!($fn, $($es),*, $fun)).unwrap()
|
|
|
|
};
|
|
|
|
}
|