From 19b52eb7a94786bc2b18e6cb7d607fa007ce9811 Mon Sep 17 00:00:00 2001 From: sawyer bristol Date: Sun, 6 Jul 2025 11:14:04 -0600 Subject: [PATCH] cargo fix --- src/display.rs | 18 +++++------------- src/main.rs | 13 +------------ src/peripherals/keyboard.rs | 9 --------- src/peripherals/mod.rs | 7 +++---- 4 files changed, 9 insertions(+), 38 deletions(-) diff --git a/src/display.rs b/src/display.rs index 9726122..06273fc 100644 --- a/src/display.rs +++ b/src/display.rs @@ -1,4 +1,3 @@ -use defmt::info; use embassy_rp::{ gpio::{Level, Output}, peripherals::{PIN_13, PIN_14, PIN_15, SPI1}, @@ -7,26 +6,19 @@ use embassy_rp::{ use embassy_time::{Delay, Timer}; use embedded_graphics::{ Drawable, - mono_font::{ - MonoFont, MonoTextStyle, - ascii::{FONT_6X9, FONT_10X20}, - }, + mono_font::{MonoTextStyle, ascii::FONT_10X20}, pixelcolor::Rgb565, - prelude::{Point, RgbColor, WebColors}, - text::{Baseline, Text, TextStyle}, + prelude::{Point, RgbColor}, + text::Text, }; use embedded_hal_bus::spi::ExclusiveDevice; use st7365p_lcd::{FrameBuffer, ST7365P}; -type SPI = Spi<'static, SPI1, Async>; - -type FRAMEBUFFER = FrameBuffer; - const SCREEN_WIDTH: usize = 320; const SCREEN_HEIGHT: usize = 320; #[embassy_executor::task] -pub async fn display_task(spi: SPI, cs: PIN_13, data: PIN_14, reset: PIN_15) { +pub async fn display_task(spi: Spi<'static, SPI1, Async>, cs: PIN_13, data: PIN_14, reset: PIN_15) { let spi_device = ExclusiveDevice::new(spi, Output::new(cs, Level::Low), Delay).unwrap(); let mut display = ST7365P::new( spi_device, @@ -38,7 +30,7 @@ pub async fn display_task(spi: SPI, cs: PIN_13, data: PIN_14, reset: PIN_15) { display.init(&mut Delay).await.unwrap(); display.set_custom_orientation(0x60).await.unwrap(); - let mut framebuffer: FRAMEBUFFER = FrameBuffer::new(); + let mut framebuffer: FrameBuffer = FrameBuffer::new(); Text::with_alignment( "Hello!", diff --git a/src/main.rs b/src/main.rs index 2cd115f..2c1fd32 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,29 +3,18 @@ #![no_std] #![no_main] -#[cfg(feature = "defmt")] -use defmt::*; use {defmt_rtt as _, panic_probe as _}; use embassy_executor::Spawner; use embassy_rp::peripherals::I2C1; -use embassy_rp::spi::Spi; use embassy_rp::{ - bind_interrupts, - gpio::{Level, Output}, i2c, i2c::I2c, spi, }; -use embassy_sync::blocking_mutex::raw::NoopRawMutex; -use embassy_sync::channel::Channel; -use embassy_time::Timer; -use embedded_hal_bus::spi::ExclusiveDevice; -use embedded_sdmmc::asynchronous::{File, SdCard, ShortFileName, VolumeIdx, VolumeManager}; -use static_cell::StaticCell; mod peripherals; -use peripherals::{conf_peripherals, keyboard::KeyEvent}; +use peripherals::conf_peripherals; mod display; use display::display_task; diff --git a/src/peripherals/keyboard.rs b/src/peripherals/keyboard.rs index 4d33755..208a335 100644 --- a/src/peripherals/keyboard.rs +++ b/src/peripherals/keyboard.rs @@ -1,12 +1,3 @@ -use defmt::{info, warn}; -use embassy_rp::{ - i2c::{Async, I2c}, - peripherals::I2C1, -}; -use embassy_sync::{ - blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex}, - channel::Sender, -}; use crate::peripherals::PERIPHERAL_BUS; diff --git a/src/peripherals/mod.rs b/src/peripherals/mod.rs index 7602555..bdef798 100644 --- a/src/peripherals/mod.rs +++ b/src/peripherals/mod.rs @@ -6,14 +6,13 @@ use embassy_rp::{ peripherals::I2C1, }; use embassy_sync::{ - blocking_mutex::raw::NoopRawMutex, channel::Sender, lazy_lock::LazyLock, mutex::Mutex, + blocking_mutex::raw::NoopRawMutex, lazy_lock::LazyLock, mutex::Mutex, }; -use embassy_time::{Duration, Timer}; +use embassy_time::Timer; pub mod keyboard; -use keyboard::{KeyCode, KeyEvent, KeyState}; -use crate::peripherals::keyboard::{configure_keyboard, read_keyboard_fifo}; +use crate::peripherals::keyboard::configure_keyboard; const MCU_ADDR: u8 = 0x1F;