Fix example

This commit is contained in:
Henrik Alsér 2022-08-30 01:39:08 +02:00 committed by Henrik Alsér
parent 44150c4830
commit c8ecc55710

View File

@ -8,7 +8,7 @@ use defmt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_rp::gpio::{Level, Output}; use embassy_rp::gpio::{Level, Output};
use embassy_rp::spi; use embassy_rp::spi;
use embassy_rp::spi::Spi; use embassy_rp::spi::{Spi, Blocking};
use embassy_time::Delay; use embassy_time::Delay;
use embedded_graphics::image::{Image, ImageRawLE}; use embedded_graphics::image::{Image, ImageRawLE};
use embedded_graphics::mono_font::ascii::FONT_10X20; use embedded_graphics::mono_font::ascii::FONT_10X20;
@ -48,7 +48,8 @@ async fn main(_spawner: Spawner) {
config.phase = spi::Phase::CaptureOnSecondTransition; config.phase = spi::Phase::CaptureOnSecondTransition;
config.polarity = spi::Polarity::IdleHigh; config.polarity = spi::Polarity::IdleHigh;
let spi_bus = RefCell::new(Spi::new(p.SPI1, clk, mosi, miso, config)); let spi: Spi<'_, _, Blocking> = Spi::new_blocking(p.SPI1, clk, mosi, miso, config);
let spi_bus = RefCell::new(spi);
let display_spi = SpiDeviceWithCs::new(&spi_bus, Output::new(display_cs, Level::High)); let display_spi = SpiDeviceWithCs::new(&spi_bus, Output::new(display_cs, Level::High));
let touch_spi = SpiDeviceWithCs::new(&spi_bus, Output::new(touch_cs, Level::High)); let touch_spi = SpiDeviceWithCs::new(&spi_bus, Output::new(touch_cs, Level::High));