Skip to content

Commit

Permalink
Adjustments for v1 and v2
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Young-Git committed Oct 27, 2024
1 parent 98af5ea commit aea4e64
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions microbit/src/07-uart/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ fn main() -> ! {
UartePort::new(serial)
};

// Writing bytes (make sure to use write_all if needed)
nb::block!(serial.write(b'X')).unwrap();
// Write a byte and flush for `v1`
#[cfg(feature = "v1")]
nb::block!(serial.write(&[b'X'])).unwrap();

#[cfg(feature = "v2")]
nb::block!(serial.flush()).unwrap();

loop {}
Expand Down

0 comments on commit aea4e64

Please sign in to comment.