mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-15 06:30:39 +11:00
Cleaning up.
This commit is contained in:
parent
225eabb449
commit
b894ab9ce7
2 changed files with 4 additions and 3 deletions
|
@ -96,7 +96,8 @@ fn main() -> ! {
|
||||||
pins.gpio20.into_push_pull_output(), // d6
|
pins.gpio20.into_push_pull_output(), // d6
|
||||||
pins.gpio21.into_push_pull_output(), // d7
|
pins.gpio21.into_push_pull_output(), // d7
|
||||||
&mut delay,
|
&mut delay,
|
||||||
).unwrap();
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
// Clear the screen
|
// Clear the screen
|
||||||
lcd.reset(&mut delay).unwrap();
|
lcd.reset(&mut delay).unwrap();
|
||||||
|
|
|
@ -85,7 +85,7 @@ fn main() -> ! {
|
||||||
let _spi_mosi = pins.gpio7.into_mode::<hal::gpio::FunctionSpi>();
|
let _spi_mosi = pins.gpio7.into_mode::<hal::gpio::FunctionSpi>();
|
||||||
let _spi_miso = pins.gpio4.into_mode::<hal::gpio::FunctionSpi>();
|
let _spi_miso = pins.gpio4.into_mode::<hal::gpio::FunctionSpi>();
|
||||||
let spi = hal::spi::Spi::<_, _, 8>::new(pac.SPI0);
|
let spi = hal::spi::Spi::<_, _, 8>::new(pac.SPI0);
|
||||||
|
|
||||||
// Exchange the uninitialised SPI driver for an initialised one
|
// Exchange the uninitialised SPI driver for an initialised one
|
||||||
let mut spi = spi.init(
|
let mut spi = spi.init(
|
||||||
&mut pac.RESETS,
|
&mut pac.RESETS,
|
||||||
|
@ -95,7 +95,7 @@ fn main() -> ! {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Write out 0, ignore return value
|
// Write out 0, ignore return value
|
||||||
if let Ok(_) = spi.write(&[0]) {
|
if spi.write(&[0]).is_ok() {
|
||||||
// SPI write was succesful
|
// SPI write was succesful
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue