Skip to content

Commit

Permalink
Bump crates.
Browse files Browse the repository at this point in the history
) nrf52840-hal goes to 0.18
) USB device crates are updated (which means new string code)
) Use embedded-hal 1.0
  • Loading branch information
jonathanpallant committed Oct 4, 2024
1 parent 6dfee53 commit f349333
Show file tree
Hide file tree
Showing 21 changed files with 705 additions and 409 deletions.
6 changes: 3 additions & 3 deletions nrf52-code/boards/dk-solution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ version = "0.0.0"
cortex-m = {version = "0.7.6", features = ["critical-section-single-core"]}
cortex-m-rt = "0.7.2"
cortex-m-semihosting = "0.5.0"
defmt = "0.3.5"
defmt = "0.3.8"
defmt-rtt = "0.4"
embedded-hal = "0.2.7"
embedded-hal = "1.0"
grounded = { version = "0.2.0", features = ["cas"] }
hal = { package = "nrf52840-hal", version = "0.16.0" }
hal = { package = "nrf52840-hal", version = "0.18.0" }

[features]
advanced = []
Expand Down
6 changes: 3 additions & 3 deletions nrf52-code/boards/dk-solution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use core::{

use cortex_m::peripheral::NVIC;
use cortex_m_semihosting::debug;
use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin};
use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin};
#[cfg(any(feature = "advanced"))]
use grounded::uninit::GroundedArrayCell;
#[cfg(any(feature = "radio"))]
Expand Down Expand Up @@ -126,12 +126,12 @@ impl Led {
}

/// Returns `true` if the LED is in the OFF state
pub fn is_off(&self) -> bool {
pub fn is_off(&mut self) -> bool {
self.inner.is_set_high() == Ok(true)
}

/// Returns `true` if the LED is in the ON state
pub fn is_on(&self) -> bool {
pub fn is_on(&mut self) -> bool {
!self.is_off()
}

Expand Down
6 changes: 3 additions & 3 deletions nrf52-code/boards/dk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ version = "0.0.0"
cortex-m = {version = "0.7.6", features = ["critical-section-single-core"]}
cortex-m-rt = "0.7.2"
cortex-m-semihosting = "0.5.0"
defmt = "0.3.5"
defmt = "0.3.8"
defmt-rtt = "0.4"
embedded-hal = "0.2.7"
embedded-hal = "1.0"
grounded = { version = "0.2.0", features = ["cas"] }
hal = { package = "nrf52840-hal", version = "0.16.0" }
hal = { package = "nrf52840-hal", version = "0.18.0" }

[features]
advanced = []
Expand Down
6 changes: 3 additions & 3 deletions nrf52-code/boards/dk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use core::{

use cortex_m::peripheral::NVIC;
use cortex_m_semihosting::debug;
use embedded_hal::digital::v2::{OutputPin, StatefulOutputPin};
use embedded_hal::digital::{OutputPin, StatefulOutputPin};
#[cfg(any(feature = "advanced"))]
use grounded::uninit::GroundedArrayCell;
#[cfg(any(feature = "radio"))]
Expand Down Expand Up @@ -124,12 +124,12 @@ impl Led {
}

/// Returns `true` if the LED is in the OFF state
pub fn is_off(&self) -> bool {
pub fn is_off(&mut self) -> bool {
self.inner.is_set_high() == Ok(true)
}

/// Returns `true` if the LED is in the ON state
pub fn is_on(&self) -> bool {
pub fn is_on(&mut self) -> bool {
!self.is_off()
}

Expand Down
6 changes: 3 additions & 3 deletions nrf52-code/boards/dongle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ cortex-m = {version = "0.7.6", features = ["critical-section-single-core"]}
cortex-m-rt = "0.7.2"
cortex-m-semihosting = "0.5.0"
critical-section = "1.1.2"
defmt = "0.3.5"
defmt = "0.3.8"
defmt-rtt = "0.4"
embedded-hal = "0.2.7"
hal = { package = "nrf52840-hal", version = "0.16.0" }
embedded-hal = "1.0"
hal = { package = "nrf52840-hal", version = "0.18.0" }
heapless = "0.8.0"
panic-probe = { version = "0.3.0", features = ["print-defmt"] }
14 changes: 3 additions & 11 deletions nrf52-code/boards/dongle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ use core::{

use cortex_m::peripheral::NVIC;
use cortex_m_semihosting::debug;
use embedded_hal::{
digital::v2::{OutputPin, StatefulOutputPin},
timer::CountDown,
};
use embedded_hal::digital::{OutputPin, StatefulOutputPin};

pub use hal::{self, ieee802154};
use hal::{
Expand Down Expand Up @@ -112,12 +109,12 @@ impl Led {
}

/// Returns `true` if the LED is in the OFF state
pub fn is_off(&self) -> bool {
pub fn is_off(&mut self) -> bool {
self.inner.is_set_high() == Ok(true)
}

/// Returns `true` if the LED is in the ON state
pub fn is_on(&self) -> bool {
pub fn is_on(&mut self) -> bool {
!self.is_off()
}

Expand Down Expand Up @@ -172,11 +169,6 @@ impl Timer {
pub fn start(&mut self, timeout_us: u32) {
self.inner.start(timeout_us)
}

/// Returns `true` if the timer is still running after a call to `start(nnn)`
pub fn is_running(&mut self) -> bool {
self.inner.wait().is_err()
}
}

impl ops::Deref for Timer {
Expand Down
Loading

0 comments on commit f349333

Please sign in to comment.