Skip to content

Commit

Permalink
move shared code for blocking & async to new module
Browse files Browse the repository at this point in the history
  • Loading branch information
Be-ing committed Feb 6, 2025
1 parent df4227b commit 8c5f264
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 7 deletions.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions src/common/filesystem/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub(crate) mod attributes;
pub(crate) mod cluster;
pub(crate) mod timestamp;
File renamed without changes.
4 changes: 4 additions & 0 deletions src/common/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//! Common modules that have no difference between blocking and asynchronous code
pub(crate) mod filesystem;
pub(crate) mod sdcard;
1 change: 1 addition & 0 deletions src/common/sdcard/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod proto;
File renamed without changes.
9 changes: 3 additions & 6 deletions src/inner/filesystem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,18 @@
/// Maximum file size supported by this library
pub const MAX_FILE_SIZE: u32 = u32::MAX;

mod attributes;
mod cluster;
mod directory;
mod filename;
mod files;
mod handles;
mod timestamp;

pub use self::attributes::Attributes;
pub use self::cluster::ClusterId;
pub use crate::common::filesystem::attributes::Attributes;
pub use crate::common::filesystem::cluster::ClusterId;
pub use self::directory::{DirEntry, Directory, RawDirectory};
pub use self::filename::{FilenameError, LfnBuffer, ShortFileName, ToShortFileName};
pub use self::files::{File, FileError, Mode, RawFile};
pub use self::handles::{Handle, HandleGenerator};
pub use self::timestamp::{TimeSource, Timestamp};
pub use crate::common::filesystem::timestamp::{TimeSource, Timestamp};

pub(crate) use self::directory::DirectoryInfo;
pub(crate) use self::files::FileInfo;
Expand Down
2 changes: 1 addition & 1 deletion src/inner/sdcard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! This is currently optimised for readability and debugability, not
//! performance.
pub mod proto;
pub use crate::common::sdcard::proto;

use super::super::{bisync, DelayNs, SpiDevice};

Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ extern crate hex_literal;
#[macro_use]
mod structure;

mod common;

/// Blocking implementation of this crate. Uses traits from embedded_hal & embedded_io crates.
#[path = "."]
pub mod blocking {
Expand Down

0 comments on commit 8c5f264

Please sign in to comment.