#[macro_export]
macro_rules! fs_table {
($board_name:ident, { $($fs_name:ident: $fs_type:ty = $value:expr),* $(,)? }) => {
$(
pub struct $fs_name {
fs: $fs_type,
}
crate::singleton!($fs_name { fs: $value });
impl $fs_name {
#[inline]
pub fn fs() -> &'static mut $fs_type {
&mut Self::ref_mut().fs
}
}
)*
struct $board_name;
impl $board_name {
pub fn fs_init() -> anyhow::Result<()> {
$(
$fs_name::fs().fs_init()?;
)*
Ok(())
}
pub fn fs_deinit() -> anyhow::Result<()> {
$(
$fs_name::fs().fs_deinit()?;
)*
Ok(())
}
}
};
}