Skip to content

Commit

Permalink
Merge pull request #133 from ferrous-systems/bump-crates
Browse files Browse the repository at this point in the history
Bump crates
  • Loading branch information
miguelraz authored Oct 4, 2024
2 parents e465c36 + e18284d commit 0849efa
Show file tree
Hide file tree
Showing 26 changed files with 710 additions and 416 deletions.
4 changes: 1 addition & 3 deletions exercise-book/src/nrf52-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,5 @@ Bus 002 Device 015: ID 1366:1051 <- J-Link on the nRF52840 Development Kit
✅ In the terminal run the following command from the [`nrf52-code/radio-app`](../../nrf52-code/radio-app) folder. This will build and run a simple program on the DK to test the set-up.

```console
cargo run --bin hello -- --allow-erase-all
cargo run --bin hello
```

The `-- --allow-erase-all` option gives the `--allow-erase-all` argument to `probe-rs`, which gives it permission to clear out the pre-installed Nordic bootloader code. You only need that the first time you try and program the nRF52840-DK with `cargo run`.
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
2 changes: 1 addition & 1 deletion nrf52-code/hal-app/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[target.thumbv7em-none-eabihf]
# set custom cargo runner to flash & run on embedded target when we call `cargo run`
# for more information, check out https://github.com/probe-rs
runner = "probe-rs run --chip nRF52840_xxAA"
runner = "probe-rs run --chip nRF52840_xxAA --allow-erase-all"
rustflags = [
"-C", "link-arg=-Tlink.x", # use the cortex-m-rt linker script
"-C", "linker=flip-link", # adds stack overflow protection
Expand Down
Loading

0 comments on commit 0849efa

Please sign in to comment.