From 2012e6899535561f116dd479cc7a7f1f58081f99 Mon Sep 17 00:00:00 2001 From: sawyer bristol Date: Thu, 18 Sep 2025 19:21:17 -0600 Subject: [PATCH] remove unused --- kernel/src/display.rs | 4 --- kernel/src/framebuffer.rs | 63 --------------------------------------- 2 files changed, 67 deletions(-) diff --git a/kernel/src/display.rs b/kernel/src/display.rs index a1e0000..5ed21e6 100644 --- a/kernel/src/display.rs +++ b/kernel/src/display.rs @@ -8,10 +8,6 @@ use embassy_rp::{ spi::{Async, Spi}, }; use embassy_time::{Delay, Timer}; -use embedded_graphics::{ - draw_target::DrawTarget, - pixelcolor::{Rgb565, RgbColor}, -}; use embedded_hal_bus::spi::ExclusiveDevice; use st7365p_lcd::ST7365P; diff --git a/kernel/src/framebuffer.rs b/kernel/src/framebuffer.rs index a029231..04823f8 100644 --- a/kernel/src/framebuffer.rs +++ b/kernel/src/framebuffer.rs @@ -184,69 +184,6 @@ impl AtomicFrameBuffer { Ok(()) } - /// Sends only dirty tiles (16x16px) individually to the display without batching - pub async fn partial_draw( - &mut self, - display: &mut ST7365P, - ) -> Result<(), ()> - where - SPI: SpiDevice, - DC: OutputPin, - RST: OutputPin, - { - if unsafe { DIRTY_TILES.get().iter().any(|p| p.load(Ordering::Acquire)) } { - let tiles_x = (SCREEN_WIDTH + TILE_SIZE - 1) / TILE_SIZE; - let tiles_y = (SCREEN_HEIGHT + TILE_SIZE - 1) / TILE_SIZE; - - let mut tile_buffer = [0u16; TILE_SIZE * TILE_SIZE]; - - for ty in 0..tiles_y { - for tx in 0..tiles_x { - if unsafe { !DIRTY_TILES.get()[ty * tiles_x + tx].load(Ordering::Acquire) } { - continue; - } - - let x = tx * TILE_SIZE; - let y = ty * TILE_SIZE; - - // Copy pixels for the tile into tile_buffer - for row in 0..TILE_SIZE { - for col in 0..TILE_SIZE { - let actual_x = x + col; - let actual_y = y + row; - - if actual_x < SCREEN_WIDTH && actual_y < SCREEN_HEIGHT { - let idx = actual_y * SCREEN_WIDTH + actual_x; - tile_buffer[row * TILE_SIZE + col] = unsafe { BUFFER[idx] }; - } else { - // Out of bounds, fill with zero (or background) - tile_buffer[row * TILE_SIZE + col] = 0; - } - } - } - - // Send the tile's pixel data to the display - display - .set_pixels_buffered( - x as u16, - y as u16, - (x + TILE_SIZE - 1).min(SCREEN_WIDTH - 1) as u16, - (y + TILE_SIZE - 1).min(SCREEN_HEIGHT - 1) as u16, - &tile_buffer, - ) - .await?; - - // Mark tile as clean - unsafe { - DIRTY_TILES.get_mut()[ty * tiles_x + tx].store(false, Ordering::Release) - }; - } - } - } - - Ok(()) - } - /// Sends only dirty tiles (16x16px) in batches to the display pub async fn partial_draw_batched( &mut self,