Skip to content

Commit

Permalink
Enforce correct SD state at compilation using a new type
Browse files Browse the repository at this point in the history
The struct `SdMmcSpi` had two separate methods for initialization and deinitialization. It was up to the user not to mess them up at runtime.

A new `BlockSpi` struct takes over `BlockDevice` interface duties, making it impossible to use block procedures while the SD interface is in the wrong state.
  • Loading branch information
dcz-self committed Aug 24, 2021
1 parent 0fbfaf4 commit 75433cc
Show file tree
Hide file tree
Showing 2 changed files with 155 additions and 147 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub use crate::filesystem::{
Timestamp, MAX_FILE_SIZE,
};
pub use crate::sdmmc::Error as SdMmcError;
pub use crate::sdmmc::SdMmcSpi;
pub use crate::sdmmc::{BlockSpi, SdMmcSpi};

// ****************************************************************************
//
Expand Down
Loading

0 comments on commit 75433cc

Please sign in to comment.