Skip to content

Commit c88f864

Browse files
Apply suggestions from code review
Co-authored-by: Jonas Schievink <[email protected]>
1 parent b57ba81 commit c88f864

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

nrf52840-hal/src/ieee802154.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ impl<'c> Radio<'c> {
260260
}
261261

262262
/// Sample the received signal power (i.e. the presence of possibly interfering signals)
263-
/// within the bandwidth of the currently used channel for sample_cycles iterations.
263+
/// within the bandwidth of the currently used channel for `sample_cycles` iterations.
264264
/// Note that one iteration has a sample time of 128μs, and that each iteration produces the
265265
/// average RSSI value measured during this sample time.
266266
///
@@ -294,14 +294,14 @@ impl<'c> Radio<'c> {
294294
self.radio.events_edend.reset();
295295

296296
// note that since we have increased EDCNT, the EDSAMPLE register contains the
297-
// maximumrecorded value, not the average
297+
// maximum recorded value, not the average
298298
let read_lvl = self.radio.edsample.read().edlvl().bits();
299299
return read_lvl;
300300
}
301301
}
302302
}
303303

304-
/// Recevies one radio packet and copies its contents into the given `packet` buffer
304+
/// Receives one radio packet and copies its contents into the given `packet` buffer
305305
///
306306
/// This methods returns the `Ok` variant if the CRC included the packet was successfully
307307
/// validated by the hardware; otherwise it returns the `Err` variant. In either case, `packet`
@@ -645,9 +645,7 @@ impl<'c> Radio<'c> {
645645
fn wait_for_event(&self, event: Event) {
646646
match event {
647647
Event::End => {
648-
while self.radio.events_end.read().events_end().bit_is_clear() {
649-
continue;
650-
}
648+
while self.radio.events_end.read().events_end().bit_is_clear() {}
651649
self.radio.events_end.reset();
652650
}
653651
Event::PhyEnd => {
@@ -657,19 +655,15 @@ impl<'c> Radio<'c> {
657655
.read()
658656
.events_phyend()
659657
.bit_is_clear()
660-
{
661-
continue;
662-
}
658+
{}
663659
self.radio.events_phyend.reset();
664660
}
665661
}
666662
}
667663

668664
/// Waits until the radio state matches the given `state`
669665
fn wait_for_state_a(&self, state: STATE_A) {
670-
while self.radio.state.read().state() != state {
671-
continue;
672-
}
666+
while self.radio.state.read().state() != state {}
673667
}
674668
}
675669

0 commit comments

Comments
 (0)