Remove unused pin from null driver
This commit is contained in:
parent
5ee542b44b
commit
ea222793ca
2 changed files with 4 additions and 6 deletions
|
@ -1,13 +1,11 @@
|
||||||
use crate::drivers::RelayDriver;
|
use crate::drivers::RelayDriver;
|
||||||
use crate::errors::EmgauwaControllerError;
|
use crate::errors::EmgauwaControllerError;
|
||||||
|
|
||||||
pub struct NullDriver {
|
pub struct NullDriver {}
|
||||||
pub pin: u8,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl NullDriver {
|
impl NullDriver {
|
||||||
pub fn new(pin: u8) -> Self {
|
pub fn new() -> Self {
|
||||||
Self { pin }
|
Self {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ impl Relay {
|
||||||
state: bool,
|
state: bool,
|
||||||
) -> Result<Box<dyn drivers::RelayDriver>, EmgauwaError> {
|
) -> Result<Box<dyn drivers::RelayDriver>, EmgauwaError> {
|
||||||
let mut driver: Box<dyn drivers::RelayDriver> = match self.driver {
|
let mut driver: Box<dyn drivers::RelayDriver> = match self.driver {
|
||||||
drivers::Driver::Null => Box::new(drivers::NullDriver::new(self.pin)),
|
drivers::Driver::Null => Box::new(drivers::NullDriver::new()),
|
||||||
drivers::Driver::Gpio => Box::new(drivers::GpioDriver::new(self.pin, self.inverted)?),
|
drivers::Driver::Gpio => Box::new(drivers::GpioDriver::new(self.pin, self.inverted)?),
|
||||||
drivers::Driver::PiFace => {
|
drivers::Driver::PiFace => {
|
||||||
if pfd.is_none() {
|
if pfd.is_none() {
|
||||||
|
|
Loading…
Reference in a new issue