Skip to content

Commit

Permalink
fix: Adapt ieee802154 example
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Jan 9, 2025
1 parent a25cc74 commit 6c91fb4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions examples/src/bin/ieee802154_sniffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ fn main() -> ! {
let mut cnt = 0;
let mut read = [0u8; 2];
loop {
let c = loop {
if let Some(c) = uart0.read_byte() {
break c;
}
};
let c = uart0.read_byte();

if c == b'r' {
continue;
}
Expand Down Expand Up @@ -78,10 +75,9 @@ fn main() -> ! {
println!("@RAW {:02x?}", &frame.data);
}

if let Some(c) = uart0.read_byte() {
if c == b'r' {
software_reset();
}
let mut buff = [0u8; 1];
if uart0.read_bytes(&mut buff) > 0 && buff[0] == b'r' {
software_reset();
}
}
}

0 comments on commit 6c91fb4

Please sign in to comment.