Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ImTheSquid committed Oct 12, 2024
1 parent 98820fb commit ff6fd24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
33 changes: 12 additions & 21 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
// pub mod eeprom;
// pub mod schema;

use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, channel::Channel};
use esp_idf_svc::{
hal::{
gpio::{AnyOutputPin, Output, PinDriver},
interrupt::free,
ledc::LedcDriver,
task::watchdog::WatchdogSubscription,
},
sys::EspError,
};
use std::{
net::TcpStream,
sync::{atomic::AtomicBool, mpsc::Receiver},
};
use std::{
os::fd::{AsRawFd, IntoRawFd},
sync::mpsc::Sender,
};
use esp_idf_svc::{hal::ledc::LedcDriver, sys::EspError};
use std::net::TcpStream;
use std::os::fd::{AsRawFd, IntoRawFd};

pub struct Leds {
channels: [LedcDriver<'static>; 15],
Expand Down Expand Up @@ -68,13 +53,19 @@ impl Leds {

pub async fn set_color(&mut self, color: palette::Srgb<u8>, block: Block) {
let r = block.channel_for_color(Color::Red);
self.channels[r].set_duty(color.red as u32);
self.channels[r]
.set_duty(GAMMA_LUT[color.red as usize] as u32)
.unwrap();

let g = block.channel_for_color(Color::Green);
self.channels[g].set_duty(color.green as u32);
self.channels[g]
.set_duty(GAMMA_LUT[color.green as usize] as u32)
.unwrap();

let b = block.channel_for_color(Color::Blue);
self.channels[b].set_duty(color.blue as u32);
self.channels[b]
.set_duty(GAMMA_LUT[color.blue as usize] as u32)
.unwrap();
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use embassy_time::{with_timeout, Timer};
use esp_idf_svc::{
eventloop::EspSystemEventLoop,
hal::{
gpio::{OutputPin, PinDriver},
gpio::PinDriver,
ledc::{config::TimerConfig, LedcDriver, LedcTimerDriver},
peripherals::Peripherals,
reset::restart,
Expand All @@ -28,7 +28,7 @@ use http::Request;
use lightning_time::LightningTime;
use log::info;
use sign_firmware::{Block, EspTlsSocket, Leds};
use std::{net::TcpStream, sync::mpsc::channel};
use std::net::TcpStream;
use url::Url;

extern crate alloc;
Expand Down

0 comments on commit ff6fd24

Please sign in to comment.