Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -15,7 +15,7 @@ exclude = [
]

[dependencies]
embedded-hal = "=0.2.2"
embedded-hal = "0.2.7"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My plan here is to eventually have embedded-hal-02 and embedded-hal-1 and support both traits from this library

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to just support whatever is newest. Nothing is dependent. Is there going to be added complexity supporting both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd make it much easier for me to support just v1. Supporting both is possible (it's even done in the embassy-rs crate itself) but it's a hassle for sure. I think I'd end up adding feature flags to support both.

I only intend to use v1 but I'll leave this up to you

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, just keep it at v1 and we'll cross that bridge when we get there.

I'm a little concerned this bump will break the Embedded Linux HAL as all of the examples target the Raspberry Pi
c901cc6

Do you know if this breaks anything there? Could you go and add cargo check to the CI process and then rebase this on top of that? At least then I don't have to question if this stuff compiles.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1 should be fine as linux-embedded-hal's newest version is 0.4.0 and it looks like they target v1 as well.

@RandomInsano Do you mind merging #24 and I can rebase this PR on it? That PR has a check to ensure that I don't regress linux builds

bit_reverse = { version = "0.1.7", default-features = false }
bitflags = "1.0"
byteorder = { version = "1.2", default-features = false }
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extern crate embedded_hal as hal;
use bit_reverse::ParallelReverse;
use core::fmt;
use hal::blocking::spi;
use hal::digital::OutputPin;
use hal::digital::v2::OutputPin;

use baton::Baton;
use classic::{Classic, GamepadButtons};
Expand Down Expand Up @@ -295,7 +295,7 @@ where
pub fn new(spi: SPI, mut select: Option<CS>) -> Self {
// If a select pin was provided, disable the controller for now
if let Some(ref mut x) = select {
x.set_high();
let _ = x.set_high();
}

Self {
Expand Down Expand Up @@ -329,13 +329,13 @@ where
Self::flip(result);

if let Some(ref mut x) = self.select {
x.set_low();
let _ = x.set_low();
}

self.dev.transfer(result)?;

if let Some(ref mut x) = self.select {
x.set_high();
let _ = x.set_high();
}

Self::flip(result);
Expand Down