From 6f81a63d1275b637262727d8ce6f7bb0f1485a77 Mon Sep 17 00:00:00 2001 From: atse Date: Wed, 20 Sep 2023 11:11:07 +0800 Subject: [PATCH] Remove unused LED parameters --- src/command_handler.rs | 11 +++++------ src/main.rs | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/command_handler.rs b/src/command_handler.rs index 5726c93..91b46d7 100644 --- a/src/command_handler.rs +++ b/src/command_handler.rs @@ -13,7 +13,6 @@ use super::{ PwmPin, ShParameter }, - leds::Leds, ad7172, CHANNEL_CONFIG_KEY, channels::{ @@ -176,13 +175,13 @@ impl Handler { Ok(Handler::Handled) } - fn engage_pid (socket: &mut TcpSocket, channels: &mut Channels, leds: &mut Leds, channel: usize) -> Result { + fn engage_pid (socket: &mut TcpSocket, channels: &mut Channels, channel: usize) -> Result { channels.channel_state(channel).pid_engaged = true; send_line(socket, b"{}"); Ok(Handler::Handled) } - fn set_pwm (socket: &mut TcpSocket, channels: &mut Channels, leds: &mut Leds, channel: usize, pin: PwmPin, value: f64) -> Result { + fn set_pwm (socket: &mut TcpSocket, channels: &mut Channels, channel: usize, pin: PwmPin, value: f64) -> Result { match pin { PwmPin::ISet => { channels.channel_state(channel).pid_engaged = false; @@ -413,7 +412,7 @@ impl Handler { } } - pub fn handle_command(command: Command, socket: &mut TcpSocket, channels: &mut Channels, session: &Session, leds: &mut Leds, store: &mut FlashStore, ipv4_config: &mut Ipv4Config, fan_ctrl: &mut FanCtrl, hwrev: HWRev) -> Result { + pub fn handle_command(command: Command, socket: &mut TcpSocket, channels: &mut Channels, session: &Session, store: &mut FlashStore, ipv4_config: &mut Ipv4Config, fan_ctrl: &mut FanCtrl, hwrev: HWRev) -> Result { match command { Command::Quit => Ok(Handler::CloseSocket), Command::Reporting(_reporting) => Handler::reporting(socket), @@ -424,8 +423,8 @@ impl Handler { Command::Show(ShowCommand::SteinhartHart) => Handler::show_steinhart_hart(socket, channels), Command::Show(ShowCommand::PostFilter) => Handler::show_post_filter(socket, channels), Command::Show(ShowCommand::Ipv4) => Handler::show_ipv4(socket, ipv4_config), - Command::PwmPid { channel } => Handler::engage_pid(socket, channels, leds, channel), - Command::Pwm { channel, pin, value } => Handler::set_pwm(socket, channels, leds, channel, pin, value), + Command::PwmPid { channel } => Handler::engage_pid(socket, channels, channel), + Command::Pwm { channel, pin, value } => Handler::set_pwm(socket, channels, channel, pin, value), Command::CenterPoint { channel, center } => Handler::set_center_point(socket, channels, channel, center), Command::Pid { channel, parameter, value } => Handler::set_pid(socket, channels, channel, parameter, value), Command::SteinhartHart { channel, parameter, value } => Handler::set_steinhart_hart(socket, channels, channel, parameter, value), diff --git a/src/main.rs b/src/main.rs index d1c788b..4d6fd05 100644 --- a/src/main.rs +++ b/src/main.rs @@ -217,7 +217,7 @@ fn main() -> ! { // Do nothing and feed more data to the line reader in the next loop cycle. Ok(SessionInput::Nothing) => {} Ok(SessionInput::Command(command)) => { - match Handler::handle_command(command, &mut socket, &mut channels, session, &mut leds, &mut store, &mut ipv4_config, &mut fan_ctrl, hwrev) { + match Handler::handle_command(command, &mut socket, &mut channels, session, &mut store, &mut ipv4_config, &mut fan_ctrl, hwrev) { Ok(Handler::NewIPV4(ip)) => new_ipv4_config = Some(ip), Ok(Handler::Handled) => {}, Ok(Handler::CloseSocket) => socket.close(),