Skip to content

Commit

Permalink
No need to un-export the CS pin that was not used.
Browse files Browse the repository at this point in the history
  • Loading branch information
qwandor committed Jan 30, 2024
1 parent 1d3f1ba commit ac60cbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions examples/receive.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use linux_embedded_hal::spidev::{SpiModeFlags, SpidevOptions};
use linux_embedded_hal::{SpidevDevice, SysfsPin};
use linux_embedded_hal::SpidevDevice;
use rfm69::Rfm69;
use utilities::rfm_error;

Expand Down Expand Up @@ -30,8 +30,5 @@ fn main() -> Result<()> {
println!("Value at {} = {}", index, val)
}

// Un-export the CS pin
SysfsPin::new(25).unexport()?;

Ok(())
}
5 changes: 1 addition & 4 deletions examples/send.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use linux_embedded_hal::spidev::{SpiModeFlags, SpidevOptions};
use linux_embedded_hal::{SpidevDevice, SysfsPin};
use linux_embedded_hal::SpidevDevice;
use rfm69::Rfm69;
use utilities::rfm_error;

Expand All @@ -26,8 +26,5 @@ fn main() -> Result<()> {
let buffer = Vec::from(b"Hello, world!".as_ref());
rfm_error!(rfm.send(&buffer))?;

// Un-export the CS pin
SysfsPin::new(25).unexport()?;

Ok(())
}

0 comments on commit ac60cbf

Please sign in to comment.