Add TODO's and fix various lints
This commit is contained in:
parent
81a148b128
commit
a788894a3b
37
firmware2/Cargo.lock
generated
37
firmware2/Cargo.lock
generated
|
|
@ -6,7 +6,6 @@ version = 4
|
||||||
name = "acid-firmware"
|
name = "acid-firmware"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"backtrace",
|
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"bt-hci",
|
"bt-hci",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -42,15 +41,6 @@ dependencies = [
|
||||||
"xz2",
|
"xz2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "addr2line"
|
|
||||||
version = "0.25.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b"
|
|
||||||
dependencies = [
|
|
||||||
"gimli",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "adler2"
|
name = "adler2"
|
||||||
version = "2.0.1"
|
version = "2.0.1"
|
||||||
|
|
@ -421,21 +411,6 @@ dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "backtrace"
|
|
||||||
version = "0.3.76"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6"
|
|
||||||
dependencies = [
|
|
||||||
"addr2line",
|
|
||||||
"cfg-if",
|
|
||||||
"libc",
|
|
||||||
"miniz_oxide",
|
|
||||||
"object",
|
|
||||||
"rustc-demangle",
|
|
||||||
"windows-link",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bare-metal"
|
name = "bare-metal"
|
||||||
version = "0.2.5"
|
version = "0.2.5"
|
||||||
|
|
@ -2717,12 +2692,6 @@ dependencies = [
|
||||||
"weezl",
|
"weezl",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "gimli"
|
|
||||||
version = "0.32.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gix"
|
name = "gix"
|
||||||
version = "0.76.0"
|
version = "0.76.0"
|
||||||
|
|
@ -6091,12 +6060,6 @@ dependencies = [
|
||||||
"ordered-multimap",
|
"ordered-multimap",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustc-demangle"
|
|
||||||
version = "0.1.26"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc-hash"
|
name = "rustc-hash"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@ itertools = { version = "0.14.0", default-features = false }
|
||||||
bytemuck = "1.24.0"
|
bytemuck = "1.24.0"
|
||||||
slint = { version = "1.14.1", default-features = false, features = ["compat-1-2", "libm", "log", "unsafe-single-threaded", "renderer-software"]}
|
slint = { version = "1.14.1", default-features = false, features = ["compat-1-2", "libm", "log", "unsafe-single-threaded", "renderer-software"]}
|
||||||
critical-section = "1.2.0"
|
critical-section = "1.2.0"
|
||||||
backtrace = { version = "0.3.76", default-features = false }
|
|
||||||
|
|
||||||
# Crates for serial UART CLI
|
# Crates for serial UART CLI
|
||||||
embedded-cli = { version = "0.2.1", default-features = false, features = ["help", "macros"] }
|
embedded-cli = { version = "0.2.1", default-features = false, features = ["help", "macros"] }
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
|
|
||||||
use alloc::{string::String, vec::Vec};
|
|
||||||
use backtrace::{BytesOrWideString, Symbol, SymbolName};
|
|
||||||
use critical_section::{CriticalSection, Mutex};
|
use critical_section::{CriticalSection, Mutex};
|
||||||
use esp_hal::uart::UartTx;
|
use esp_hal::uart::UartTx;
|
||||||
use esp_hal::Blocking;
|
use esp_hal::Blocking;
|
||||||
|
|
@ -46,6 +44,7 @@ const BLUE: &str = "\u{001B}[34m";
|
||||||
const CYAN: &str = "\u{001B}[35m";
|
const CYAN: &str = "\u{001B}[35m";
|
||||||
|
|
||||||
#[cfg(feature = "alt-log")]
|
#[cfg(feature = "alt-log")]
|
||||||
|
#[allow(unused)]
|
||||||
macro_rules! println {
|
macro_rules! println {
|
||||||
() => {{
|
() => {{
|
||||||
do_print(Default::default());
|
do_print(Default::default());
|
||||||
|
|
@ -56,7 +55,7 @@ macro_rules! println {
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
fn do_print(args: core::fmt::Arguments<'_>) {
|
fn do_print(args: core::fmt::Arguments<'_>) {
|
||||||
with_uart_tx(|_, uart| {
|
with_uart_tx(|_, uart| {
|
||||||
uart.write_fmt(args).unwrap();
|
uart.write_fmt(args).unwrap();
|
||||||
|
|
@ -95,39 +94,11 @@ fn panic_handler(info: &core::panic::PanicInfo) -> ! {
|
||||||
|
|
||||||
for frame in backtrace.frames() {
|
for frame in backtrace.frames() {
|
||||||
println!("0x{:x}", frame.program_counter());
|
println!("0x{:x}", frame.program_counter());
|
||||||
print_resolved_symbol(frame.program_counter());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "usb-log"))]
|
|
||||||
fn print_resolved_symbol(address: usize) {
|
|
||||||
unsafe {
|
|
||||||
backtrace::resolve_unsynchronized(address as _, |sym| {
|
|
||||||
println!("? {:x?}\n{}\n\n", sym.addr().map(|addr| addr as usize), sym.name().unwrap_or(SymbolName::new(b"(unknown)")));
|
|
||||||
// sym.filename_raw().unwrap_or(BytesOrWideString::Bytes(&[]));
|
|
||||||
// let segments: Vec<String> = vec![
|
|
||||||
// sym.addr().map(|a| format!("{:x?}", a as isize)),
|
|
||||||
// sym.name().map(|n| n.to_string()),
|
|
||||||
// sym.filename().map(|p| {
|
|
||||||
// format!(
|
|
||||||
// "{}{}",
|
|
||||||
// p.to_string_lossy(),
|
|
||||||
// sym.lineno()
|
|
||||||
// .map(|n| format!(" (line {})", n))
|
|
||||||
// .unwrap_or_else(|| "".to_string())
|
|
||||||
// )
|
|
||||||
// }),
|
|
||||||
// ]
|
|
||||||
// .into_iter()
|
|
||||||
// .flatten()
|
|
||||||
// .collect();
|
|
||||||
// segments.join("\n")
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn setup_alternative_logging(alt_uart: UartTx<'static, Blocking>, level_filter: LevelFilter)
|
pub fn setup_alternative_logging(alt_uart: UartTx<'static, Blocking>, level_filter: LevelFilter)
|
||||||
{
|
{
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
//! TODO:
|
||||||
|
//! * Async interrupt handling of keyboard input. Reduces LCD glitching.
|
||||||
|
//! * Attempt to reduce the size of the framebuffer to 240x960 by changing the front/back porch of
|
||||||
|
//! the LCD driver. Reduces LCD glitching.
|
||||||
|
//! * GUI event dispatch.
|
||||||
|
//! * Bounce buffers to get rid of glitching completely.
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(macro_metavar_expr)]
|
#![feature(macro_metavar_expr)]
|
||||||
|
|
@ -6,18 +12,13 @@ extern crate alloc;
|
||||||
|
|
||||||
use core::alloc::Layout;
|
use core::alloc::Layout;
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
use core::sync::atomic::AtomicBool;
|
|
||||||
use core::time::Duration;
|
|
||||||
|
|
||||||
use alloc::boxed::Box;
|
use alloc::boxed::Box;
|
||||||
use alloc::rc::Rc;
|
|
||||||
use alloc::sync::Arc;
|
|
||||||
use alloc::vec;
|
use alloc::vec;
|
||||||
use bt_hci::controller::ExternalController;
|
use bt_hci::controller::ExternalController;
|
||||||
use embassy_executor::Spawner;
|
use embassy_executor::Spawner;
|
||||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||||
use embassy_sync::signal::Signal;
|
use embassy_sync::signal::Signal;
|
||||||
use embassy_time::{Delay, Timer};
|
|
||||||
use esp_alloc::{HeapRegion, MemoryCapability};
|
use esp_alloc::{HeapRegion, MemoryCapability};
|
||||||
use esp_hal::clock::CpuClock;
|
use esp_hal::clock::CpuClock;
|
||||||
use esp_hal::dma::{BurstConfig, DmaDescriptor, DmaTxBuf, ExternalBurstConfig};
|
use esp_hal::dma::{BurstConfig, DmaDescriptor, DmaTxBuf, ExternalBurstConfig};
|
||||||
|
|
@ -30,8 +31,7 @@ use esp_hal::lcd_cam::lcd::dpi::Dpi;
|
||||||
use esp_hal::mcpwm::{McPwm, PeripheralClockConfig};
|
use esp_hal::mcpwm::{McPwm, PeripheralClockConfig};
|
||||||
use esp_hal::psram::{FlashFreq, PsramConfig, PsramSize, SpiRamFreq, SpiTimingConfigCoreClock};
|
use esp_hal::psram::{FlashFreq, PsramConfig, PsramSize, SpiRamFreq, SpiTimingConfigCoreClock};
|
||||||
use esp_hal::rng::TrngSource;
|
use esp_hal::rng::TrngSource;
|
||||||
use esp_hal::system::{CpuControl, Stack};
|
use esp_hal::system::Stack;
|
||||||
use esp_hal::time::Instant;
|
|
||||||
use esp_hal::timer::timg::TimerGroup;
|
use esp_hal::timer::timg::TimerGroup;
|
||||||
use esp_hal::{Blocking, ram};
|
use esp_hal::{Blocking, ram};
|
||||||
use esp_radio::Controller;
|
use esp_radio::Controller;
|
||||||
|
|
@ -48,12 +48,10 @@ use rmk::{join_all};
|
||||||
use rmk::keyboard::Keyboard;
|
use rmk::keyboard::Keyboard;
|
||||||
use rmk::storage::async_flash_wrapper;
|
use rmk::storage::async_flash_wrapper;
|
||||||
use rmk::{initialize_keymap_and_storage, run_devices, run_rmk};
|
use rmk::{initialize_keymap_and_storage, run_devices, run_rmk};
|
||||||
use slint::platform::WindowAdapter;
|
use slint::platform::software_renderer::Rgb565Pixel;
|
||||||
use slint::platform::software_renderer::{MinimalSoftwareWindow, RenderingRotation, RepaintBufferType, Rgb565Pixel, SoftwareRenderer};
|
use slint::ComponentHandle;
|
||||||
use slint::{ComponentHandle, PhysicalSize, PlatformError, WindowSize};
|
|
||||||
use static_cell::StaticCell;
|
use static_cell::StaticCell;
|
||||||
use ui::AppWindow;
|
use ui::AppWindow;
|
||||||
use ui::window_adapter::SoftwareWindowAdapter;
|
|
||||||
use {esp_alloc as _, esp_backtrace as _};
|
use {esp_alloc as _, esp_backtrace as _};
|
||||||
|
|
||||||
use crate::matrix::IoeMatrix;
|
use crate::matrix::IoeMatrix;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use core::{cell::Cell, ops::{Deref, DerefMut}};
|
use core::{cell::Cell, ops::{Deref, DerefMut}};
|
||||||
|
|
||||||
use alloc::rc::{Rc, Weak};
|
use alloc::rc::{Rc, Weak};
|
||||||
use slint::{PhysicalSize, Window, WindowSize, platform::{Renderer, WindowAdapter, WindowEvent, software_renderer::{RepaintBufferType, SoftwareRenderer}}};
|
use slint::{PhysicalSize, Window, WindowSize, platform::{Renderer, WindowAdapter, WindowEvent, software_renderer::SoftwareRenderer}};
|
||||||
|
|
||||||
/// This is a minimal adapter for a Window that doesn't have any other feature than rendering
|
/// This is a minimal adapter for a Window that doesn't have any other feature than rendering
|
||||||
/// using the software renderer.
|
/// using the software renderer.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue