From a237bb7dc8c8f44140364ccacb3d54b750109411 Mon Sep 17 00:00:00 2001 From: Victoria Fischer Date: Sat, 14 Dec 2024 14:41:26 +0100 Subject: [PATCH] platform: esp32: drop buggy and slow i2s implementation --- src/platform/esp32.rs | 55 ------------------------------------------- 1 file changed, 55 deletions(-) diff --git a/src/platform/esp32.rs b/src/platform/esp32.rs index 1b36407..c7064d3 100644 --- a/src/platform/esp32.rs +++ b/src/platform/esp32.rs @@ -39,61 +39,6 @@ use crate::task::FixedSizeScheduler; use crate::task::Task; use crate::time::Periodically; -pub mod i2s { - use esp_idf_svc::hal::i2s::*; - use rgb::ComponentBytes; - use rgb::Rgb; - - use crate::mappings::*; - use crate::buffers::Pixbuf; - use crate::render::Output; - use crate::render::Sample; - - pub struct I2SOutput<'d> { - driver: I2sDriver<'d, I2sTx>, - pixbuf: [Rgb; 310], - pixmap: StrideMapping, - } - - impl<'d> I2SOutput<'d> { - fn new(driver: I2sDriver<'d, I2sTx>) -> Self { - I2SOutput { - driver, - pixbuf: Pixbuf::new(), - pixmap: StrideMapping::new_jar() - } - } - } - - impl<'d> Output for I2SOutput<'d> { - fn on_event(&mut self, event: &crate::events::Event) { - - } - - fn blank(&mut self) { - self.pixbuf.blank(); - } - - fn commit(&mut self) { - let bytes = self.pixbuf.as_bytes(); - let mut written = self.driver.preload_data(bytes).unwrap(); - self.driver.tx_enable().unwrap(); - while written < bytes.len() { - let next = &bytes[written..]; - written += self.driver.write(next, 0).unwrap(); - } - self.driver.tx_disable().unwrap(); - } - } - - impl<'d> Sample for I2SOutput<'d> { - type Pixel = Rgb; - fn sample(&mut self, rect: &crate::geometry::Rectangle) -> impl crate::render::PixelView { - StrideSampler::new(&mut self.pixbuf, self.pixmap.select(rect)) - } - } -} - pub struct Esp32Board { sys_loop: EspSystemEventLoop, modem: Option,