Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v0.8.0 #137

Merged
merged 27 commits into from
Jul 12, 2024
Merged
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ec01477
Merge pull request #118 from rust-embedded-community/main
thejpster Feb 9, 2024
f880b51
Upgrade to heapless ^0.8
bsodmike Feb 25, 2024
ba27644
Merge pull request #120 from bsodmike/upgrade_heapless_0.8
thejpster Feb 25, 2024
3cdb6cb
Add ability to flush written data
peterkrull Mar 25, 2024
55c77ce
Merge pull request #121 from peterkrull/flush-written-file
thejpster Mar 25, 2024
86c20e0
Do not panic on errors during drop, add optional manual closing to no…
peterkrull Mar 29, 2024
710bd34
Merge pull request #123 from peterkrull/always-closing
thejpster Mar 30, 2024
1e89779
split FatVolume.iterate_dir into 2 subfunctions
orsinium Apr 3, 2024
f26de60
FIx some docs
orsinium Apr 3, 2024
44b63de
Merge pull request #127 from orsinium-forks/fat-iterate-dir-refactor
thejpster Apr 4, 2024
83128a3
Add new test.
thejpster Jun 1, 2024
07d7bd2
Bug fix for #131
thejpster Jun 1, 2024
a3c895b
Fix read_file_backwards.
thejpster Jun 1, 2024
a04e5f0
Fix seek_from_end.
thejpster Jun 1, 2024
0de58d3
Move new test into read_file.
thejpster Jun 1, 2024
59e4c2f
Code cleanups.
thejpster Jun 1, 2024
7b5b876
Appease clippy.
thejpster Jun 1, 2024
6b1ef4c
Update README example
thejpster Jun 1, 2024
ee72ddc
Merge pull request #134 from rust-embedded-community/fix-warnings
eldruin Jun 6, 2024
92c8ca9
Merge branch 'develop' into fix-seeking
eldruin Jun 6, 2024
860e072
Merge pull request #133 from rust-embedded-community/fix-seeking
eldruin Jun 10, 2024
510d50e
Use SpiDevice to control the chip select.
thejpster Jul 6, 2024
44a5736
Merge pull request #136 from rust-embedded-community/use-spidevice-pr…
thejpster Jul 12, 2024
c828250
Minor clean-ups of docs.
jonathanpallant Jul 12, 2024
4e4e084
Merge pull request #138 from rust-embedded-community/clean-up-docs
thejpster Jul 12, 2024
b178599
Update CHANGELOG.
jonathanpallant Jul 12, 2024
a1cc455
Update version to 0.8.0
jonathanpallant Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ log = {version = "0.4", default-features = false, optional = true}

[dev-dependencies]
chrono = "0.4"
embedded-hal-bus = "0.1.0"
embedded-hal-bus = "0.2.0"
env_logger = "0.10.0"
flate2 = "1.0"
hex-literal = "0.4.1"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ You will need something that implements the `BlockDevice` trait, which can read

```rust
// Build an SD Card interface out of an SPI device, a chip-select pin and the delay object
let sdcard = embedded_sdmmc::SdCard::new(sdmmc_spi, sdmmc_cs, delay);
let sdcard = embedded_sdmmc::SdCard::new(sdmmc_spi, delay);
// Get the card size (this also triggers card initialisation because it's not been done yet)
println!("Card size is {} bytes", sdcard.num_bytes()?);
// Now let's look for volumes (also known as partitions) on our block device.
23 changes: 19 additions & 4 deletions examples/readme_test.rs
Original file line number Diff line number Diff line change
@@ -7,7 +7,23 @@

use core::cell::RefCell;

use embedded_sdmmc::sdcard::DummyCsPin;
pub struct DummyCsPin;

impl embedded_hal::digital::ErrorType for DummyCsPin {
type Error = core::convert::Infallible;
}

impl embedded_hal::digital::OutputPin for DummyCsPin {
#[inline(always)]
fn set_low(&mut self) -> Result<(), Self::Error> {
Ok(())
}

#[inline(always)]
fn set_high(&mut self) -> Result<(), Self::Error> {
Ok(())
}
}

struct FakeSpiBus();

@@ -99,13 +115,12 @@ fn main() -> Result<(), Error> {
// BEGIN Fake stuff that will be replaced with real peripherals
let spi_bus = RefCell::new(FakeSpiBus());
let delay = FakeDelayer();
let sdmmc_spi = embedded_hal_bus::spi::RefCellDevice::new(&spi_bus, DummyCsPin, delay);
let sdmmc_cs = FakeCs();
let sdmmc_spi = embedded_hal_bus::spi::RefCellDevice::new(&spi_bus, DummyCsPin, delay).unwrap();
let time_source = FakeTimesource();
// END Fake stuff that will be replaced with real peripherals

// Build an SD Card interface out of an SPI device, a chip-select pin and the delay object
let sdcard = embedded_sdmmc::SdCard::new(sdmmc_spi, sdmmc_cs, delay);
let sdcard = embedded_sdmmc::SdCard::new(sdmmc_spi, delay);
// Get the card size (this also triggers card initialisation because it's not been done yet)
println!("Card size is {} bytes", sdcard.num_bytes()?);
// Now let's look for volumes (also known as partitions) on our block device.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -19,14 +19,13 @@
//! ```rust
//! use embedded_sdmmc::{Error, Mode, SdCard, SdCardError, TimeSource, VolumeIdx, VolumeManager};
//!
//! fn example<S, CS, D, T>(spi: S, cs: CS, delay: D, ts: T) -> Result<(), Error<SdCardError>>
//! fn example<S, D, T>(spi: S, delay: D, ts: T) -> Result<(), Error<SdCardError>>
//! where
//! S: embedded_hal::spi::SpiDevice,
//! CS: embedded_hal::digital::OutputPin,
//! D: embedded_hal::delay::DelayNs,
//! T: TimeSource,
//! {
//! let sdcard = SdCard::new(spi, cs, delay);
//! let sdcard = SdCard::new(spi, delay);
//! println!("Card size is {} bytes", sdcard.num_bytes()?);
//! let mut volume_mgr = VolumeManager::new(sdcard, ts);
//! let mut volume0 = volume_mgr.open_volume(VolumeIdx(0))?;
Loading