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
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 @@ -179,10 +179,10 @@ impl Timer {

/// Start the timer with the given microsecond duration.
pub fn start(&mut self, microseconds: u32) {
self.0.cc(0).clear_events();
self.0.stop();
self.0.clear();
self.0.cc(0).write(microseconds);
self.0.task_clear();
self.0.task_start();
self.0.start();
}

/// If the timer has finished, resets it and returns true.
Expand Down
14 changes: 9 additions & 5 deletions nrf52-code/boards/dk-solution/src/radio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,15 @@ impl<'d> Radio<'d> {
// Check if either receive is done or timeout occured
loop {
match recv.is_done() {
Ok(crc) => break Ok(crc),
Err(err) => match err {
nb::Error::Other(crc) => break Err(Error::Crc(crc)),
nb::Error::WouldBlock => (),
},
Ok(crc) => {
break Ok(crc);
}
Err(nb::Error::Other(crc)) => {
break Err(Error::Crc(crc));
}
Err(nb::Error::WouldBlock) => {
// do nothing
}
}

if timer.reset_if_finished() {
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 @@ -151,10 +151,10 @@ impl Timer {

/// Start the timer with the given microsecond duration.
pub fn start(&mut self, microseconds: u32) {
self.0.cc(0).clear_events();
self.0.stop();
self.0.clear();
self.0.cc(0).write(microseconds);
self.0.task_clear();
self.0.task_start();
self.0.start();
}

/// If the timer has finished, resets it and returns true.
Expand Down
14 changes: 9 additions & 5 deletions nrf52-code/boards/dk/src/radio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,15 @@ impl<'d> Radio<'d> {
// Check if either receive is done or timeout occured
loop {
match recv.is_done() {
Ok(crc) => break Ok(crc),
Err(err) => match err {
nb::Error::Other(crc) => break Err(Error::Crc(crc)),
nb::Error::WouldBlock => (),
},
Ok(crc) => {
break Ok(crc);
}
Err(nb::Error::Other(crc)) => {
break Err(Error::Crc(crc));
}
Err(nb::Error::WouldBlock) => {
// do nothing
}
}

if timer.reset_if_finished() {
Expand Down