clippy --fix

This commit is contained in:
Jakub Hlusička 2026-02-24 23:19:54 +01:00
parent 2ea4e57857
commit 07efc876f3
3 changed files with 13 additions and 18 deletions

View file

@ -70,13 +70,12 @@ pub mod usb {
#[macro_use] #[macro_use]
pub mod uart { pub mod uart {
use super::*; use super::*;
use crate::console;
use core::{cell::RefCell, fmt::Write}; use core::{cell::RefCell, fmt::Write};
use critical_section::{CriticalSection, Mutex}; use critical_section::{CriticalSection, Mutex};
use esp_hal::{ use esp_hal::{
Blocking, Blocking,
gpio::interconnect::{PeripheralInput, PeripheralOutput}, uart::UartTx,
uart::{Uart, UartTx},
}; };
use log::{Log, info}; use log::{Log, info};

View file

@ -16,7 +16,6 @@
extern crate alloc; extern crate alloc;
use core::alloc::Layout;
use core::cell::RefCell; use core::cell::RefCell;
use core::fmt::Write; use core::fmt::Write;
use core::sync::atomic::{AtomicBool, Ordering}; use core::sync::atomic::{AtomicBool, Ordering};
@ -27,22 +26,19 @@ use alloc::collections::vec_deque::VecDeque;
use alloc::format; use alloc::format;
use alloc::string::String; use alloc::string::String;
use alloc::sync::Arc; use alloc::sync::Arc;
use alloc::vec;
use alloc::vec::Vec; use alloc::vec::Vec;
use cfg_if::cfg_if;
use embassy_embedded_hal::adapter::BlockingAsync; use embassy_embedded_hal::adapter::BlockingAsync;
use embassy_embedded_hal::flash::partition::Partition; use embassy_embedded_hal::flash::partition::Partition;
use embassy_executor::{SendSpawner, Spawner, SpawnerTraceExt}; use embassy_executor::Spawner;
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
use embassy_sync::channel::Channel; use embassy_sync::channel::Channel;
use embassy_sync::mutex::Mutex; use embassy_sync::mutex::Mutex;
use embassy_sync::signal::Signal;
use embassy_time::{Duration, Timer}; use embassy_time::{Duration, Timer};
use esp_alloc::{HeapRegion, MemoryCapability}; use esp_alloc::{HeapRegion, MemoryCapability};
use esp_bootloader_esp_idf::partitions::PartitionTable; use esp_bootloader_esp_idf::partitions::PartitionTable;
use esp_hal::clock::CpuClock; use esp_hal::clock::CpuClock;
use esp_hal::dma::{ use esp_hal::dma::{
BurstConfig, DmaDescriptor, DmaTxBuf, ExternalBurstConfig, InternalBurstConfig, BurstConfig, ExternalBurstConfig, InternalBurstConfig,
}; };
use esp_hal::efuse::Efuse; use esp_hal::efuse::Efuse;
#[cfg(not(feature = "alt-log"))] #[cfg(not(feature = "alt-log"))]
@ -51,9 +47,9 @@ use esp_hal::gpio::{Flex, Input, InputConfig, Level, Output, OutputConfig, Pull}
use esp_hal::i2c::master::{I2c, I2cAddress}; use esp_hal::i2c::master::{I2c, I2cAddress};
use esp_hal::interrupt::software::{SoftwareInterrupt, SoftwareInterruptControl}; use esp_hal::interrupt::software::{SoftwareInterrupt, SoftwareInterruptControl};
use esp_hal::lcd_cam::LcdCam; use esp_hal::lcd_cam::LcdCam;
use esp_hal::lcd_cam::lcd::dpi::{Dpi, DpiTransfer}; use esp_hal::lcd_cam::lcd::dpi::Dpi;
use esp_hal::mcpwm::{McPwm, PeripheralClockConfig}; use esp_hal::mcpwm::{McPwm, PeripheralClockConfig};
use esp_hal::peripherals::{DMA_CH0, SPI0, SPI2}; use esp_hal::peripherals::{DMA_CH0, SPI2};
use esp_hal::psram::{FlashFreq, PsramConfig, PsramSize, SpiRamFreq, SpiTimingConfigCoreClock}; use esp_hal::psram::{FlashFreq, PsramConfig, PsramSize, SpiRamFreq, SpiTimingConfigCoreClock};
use esp_hal::ram; use esp_hal::ram;
use esp_hal::rng::TrngSource; use esp_hal::rng::TrngSource;
@ -89,7 +85,7 @@ use crate::matrix::IoeMatrix;
use crate::peripherals::st7701s::St7701s; use crate::peripherals::st7701s::St7701s;
use crate::proxy::create_hid_report_interceptor; use crate::proxy::create_hid_report_interceptor;
use crate::ui::backend::SlintBackend; use crate::ui::backend::SlintBackend;
use crate::ui::dpi::{DmaBounce, DmaTxBounceBuf, Framebuffer, Swapchain, allocate_dma_buffer_in}; use crate::ui::dpi::{DmaBounce, Framebuffer, Swapchain, allocate_dma_buffer_in};
use crate::vial::{ use crate::vial::{
CustomKeycodes, VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID, VIAL_KEYBOARD_NAME, VIAL_PRODUCT_ID, CustomKeycodes, VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID, VIAL_KEYBOARD_NAME, VIAL_PRODUCT_ID,
VIAL_VENDOR_ID, VIAL_VENDOR_ID,
@ -211,7 +207,7 @@ async fn test_bounce_buffers(
y = core::cmp::min(y, HEIGHT_PIXELS as i16 - 1 - y); y = core::cmp::min(y, HEIGHT_PIXELS as i16 - 1 - y);
let min = core::cmp::min(x, y); let min = core::cmp::min(x, y);
*pixel = colors[min as usize % colors.len()].clone(); *pixel = colors[min as usize % colors.len()];
continue; continue;
} }

View file

@ -161,7 +161,7 @@ pub struct SwapchainWriteGuard<'a> {
impl<'a> SwapchainWriteGuard<'a> { impl<'a> SwapchainWriteGuard<'a> {
pub fn cast<T: NoUninit + AnyBitPattern>(&mut self) -> &mut [T] { pub fn cast<T: NoUninit + AnyBitPattern>(&mut self) -> &mut [T] {
bytemuck::cast_slice_mut::<_, T>(&mut self.framebuffer) bytemuck::cast_slice_mut::<_, T>(self.framebuffer)
} }
} }
@ -175,13 +175,13 @@ impl<'a> Deref for SwapchainWriteGuard<'a> {
type Target = [u8]; type Target = [u8];
fn deref(&self) -> &Self::Target { fn deref(&self) -> &Self::Target {
&self.framebuffer self.framebuffer
} }
} }
impl<'a> DerefMut for SwapchainWriteGuard<'a> { impl<'a> DerefMut for SwapchainWriteGuard<'a> {
fn deref_mut(&mut self) -> &mut Self::Target { fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.framebuffer self.framebuffer
} }
} }
@ -647,7 +647,7 @@ impl DmaBounce {
transfer_builder: |mem2mem| { transfer_builder: |mem2mem| {
Some( Some(
mem2mem mem2mem
.start_transfer(&mut self.bounce_buffer_dst, buffer_src_window) .start_transfer(self.bounce_buffer_dst, buffer_src_window)
.unwrap(), .unwrap(),
) )
}, },
@ -694,7 +694,7 @@ impl DmaBounce {
.with_descriptors(bounce_dst_descs, src_descs, self.burst_config) .with_descriptors(bounce_dst_descs, src_descs, self.burst_config)
.unwrap(); .unwrap();
let transfer = mem2mem let transfer = mem2mem
.start_transfer(&mut self.bounce_buffer_dst, buffer_src_window) .start_transfer(self.bounce_buffer_dst, buffer_src_window)
.unwrap(); .unwrap();
transfer.wait_async().await.unwrap(); transfer.wait_async().await.unwrap();