Skip to content

Commit b38af21

Browse files
Merge branch 'main' into curl-cleanup
2 parents 0df1c28 + 1c674fc commit b38af21

File tree

5 files changed

+26
-17
lines changed

5 files changed

+26
-17
lines changed

nrf52-code/boards/dk-solution/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ impl Timer {
179179

180180
/// Start the timer with the given microsecond duration.
181181
pub fn start(&mut self, microseconds: u32) {
182-
self.0.cc(0).clear_events();
182+
self.0.stop();
183+
self.0.clear();
183184
self.0.cc(0).write(microseconds);
184-
self.0.task_clear();
185-
self.0.task_start();
185+
self.0.start();
186186
}
187187

188188
/// If the timer has finished, resets it and returns true.

nrf52-code/boards/dk-solution/src/radio.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,15 @@ impl<'d> Radio<'d> {
454454
// Check if either receive is done or timeout occured
455455
loop {
456456
match recv.is_done() {
457-
Ok(crc) => break Ok(crc),
458-
Err(err) => match err {
459-
nb::Error::Other(crc) => break Err(Error::Crc(crc)),
460-
nb::Error::WouldBlock => (),
461-
},
457+
Ok(crc) => {
458+
break Ok(crc);
459+
}
460+
Err(nb::Error::Other(crc)) => {
461+
break Err(Error::Crc(crc));
462+
}
463+
Err(nb::Error::WouldBlock) => {
464+
// do nothing
465+
}
462466
}
463467

464468
if timer.reset_if_finished() {

nrf52-code/boards/dk/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ impl Timer {
151151

152152
/// Start the timer with the given microsecond duration.
153153
pub fn start(&mut self, microseconds: u32) {
154-
self.0.cc(0).clear_events();
154+
self.0.stop();
155+
self.0.clear();
155156
self.0.cc(0).write(microseconds);
156-
self.0.task_clear();
157-
self.0.task_start();
157+
self.0.start();
158158
}
159159

160160
/// If the timer has finished, resets it and returns true.

nrf52-code/boards/dk/src/radio.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,15 @@ impl<'d> Radio<'d> {
454454
// Check if either receive is done or timeout occured
455455
loop {
456456
match recv.is_done() {
457-
Ok(crc) => break Ok(crc),
458-
Err(err) => match err {
459-
nb::Error::Other(crc) => break Err(Error::Crc(crc)),
460-
nb::Error::WouldBlock => (),
461-
},
457+
Ok(crc) => {
458+
break Ok(crc);
459+
}
460+
Err(nb::Error::Other(crc)) => {
461+
break Err(Error::Crc(crc));
462+
}
463+
Err(nb::Error::WouldBlock) => {
464+
// do nothing
465+
}
462466
}
463467

464468
if timer.reset_if_finished() {

nrf52-code/hal-app/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ description = "Solutions for the nRF52 HAL exercises"
99
[dependencies]
1010
cortex-m = {version = "0.7.7", features = ["critical-section-single-core"]}
1111
cortex-m-rt = "0.7.5"
12-
dk = { path = "../boards/dk-solution", features = ["radio"] }
12+
dk = { path = "../boards/dk", features = ["radio"] }
13+
# dk = { path = "../boards/dk-solution", features = ["radio"] }
1314
heapless = "0.9"
1415
defmt = "1"
1516
defmt-rtt = "1.1"

0 commit comments

Comments
 (0)