Skip to content
Snippets Groups Projects
Commit 2cfff945 authored by Stephen D's avatar Stephen D
Browse files

code cleanup

parent 163e13a4
No related branches found
No related tags found
No related merge requests found
......@@ -36,8 +36,6 @@ enum Command {
EnterNormalMode = 0x13,
SetUninvertedMode = 0x20,
SetDisplayOn = 0x29,
SetColumnAddress = 0x2A,
SetPageAddress = 0x2B,
WriteMemoryStart = 0x2C,
SetScrollArea = 0x33,
SetAddressMode = 0x36,
......@@ -102,17 +100,6 @@ impl St7789 {
&mut self,
buffer: &'static mut [u8; WIDTH * HEIGHT * 2],
) -> &'static mut [u8; WIDTH * HEIGHT * 2] {
/*let end_width = u16::try_from(WIDTH).unwrap().to_be_bytes();
let end_height = u16::try_from(HEIGHT).unwrap().to_be_bytes();
self.send_command(
Command::SetColumnAddress,
[0, 0, end_width[0], end_width[1]],
);
self.send_command(
Command::SetPageAddress,
[0, 0, end_height[0], end_height[1]],
);*/
self.send_command(Command::WriteMemoryStart, []);
self.cs.set_low().unwrap();
......@@ -142,7 +129,7 @@ impl St7789 {
self.dc.set_high().unwrap();
if data.len() > 0 {
if !data.is_empty() {
self.cs.set_low().unwrap();
self.spi.as_mut().unwrap().transfer(&mut data).unwrap();
self.cs.set_high().unwrap();
......
......@@ -23,8 +23,7 @@ pub static BOOT_LOADER: [u8; 256] = rp2040_boot2::BOOT_LOADER_GD25Q64CS;
mod app {
use crate::{
buffered_display::BufferedDisplay, controller::Controller, drivers::st7789::St7789,
gui::Element, keyboard::KeyCode, keyboard::Keyboard, touchpad::Touchpad,
voltage::VoltMeter,
gui::Element, keyboard::Keyboard, touchpad::Touchpad, voltage::VoltMeter,
};
use cortex_m::{delay::Delay, singleton};
use embedded_hal::{digital::v2::OutputPin, PwmPin};
......@@ -38,7 +37,6 @@ mod app {
},
pac::I2C1,
pwm::{self, Channel, FreeRunning, Pwm4, Slice},
reset,
timer::{monotonic::Monotonic, Instant, Timer},
Adc, Clock, I2C,
};
......@@ -262,10 +260,6 @@ mod app {
if let Some(k) = keyboard.pushed_key() {
ctx.shared.controller.lock(|g| g.key_push(k));
if k == KeyCode::Enter {
reset();
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment