From d387d6c99b893f978dee904584be2a20a9cdf141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 28 Nov 2024 05:45:12 -0300 Subject: [PATCH] {icm20689, leak, led, pca9685}: Move from 30 to 60ms to wait pin configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/icm20689.rs | 2 +- src/leak.rs | 2 +- src/led.rs | 2 +- src/pca9685.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/icm20689.rs b/src/icm20689.rs index 96dda56a3..9492c0287 100644 --- a/src/icm20689.rs +++ b/src/icm20689.rs @@ -88,7 +88,7 @@ impl Icm20689Builder { let cs_pin = Pin::new(self.cs_pin_number); cs_pin.export()?; - std::thread::sleep(std::time::Duration::from_millis(30)); + std::thread::sleep(std::time::Duration::from_millis(60)); cs_pin.set_direction(Direction::Out)?; cs_pin.set_value(1)?; diff --git a/src/leak.rs b/src/leak.rs index 1969f3f1c..5dbbee886 100644 --- a/src/leak.rs +++ b/src/leak.rs @@ -59,7 +59,7 @@ impl LeakBuilder { pub fn build(self) -> Result> { let pin = Pin::new(self.pin_number); pin.export()?; - sleep(Duration::from_millis(30)); + sleep(Duration::from_millis(60)); pin.set_direction(Direction::In)?; Ok(LeakDetector { pin, diff --git a/src/led.rs b/src/led.rs index 3b6be3b07..df435e31d 100644 --- a/src/led.rs +++ b/src/led.rs @@ -68,7 +68,7 @@ impl LedControllerBuilder { for &pin_number in &self.pins { let pin = Pin::new(pin_number); pin.export().expect("Failed to export LED pin"); - sleep(Duration::from_millis(30)); + sleep(Duration::from_millis(60)); pin.set_direction(Direction::Out) .expect("Failed to set direction"); pin.set_value(1).expect("Failed to set initial LED value"); diff --git a/src/pca9685.rs b/src/pca9685.rs index 0a67cc2d5..a8b599765 100644 --- a/src/pca9685.rs +++ b/src/pca9685.rs @@ -91,7 +91,7 @@ impl Pca9685DeviceBuilder { let oe_pin = { let pin = Pin::new(self.oe_pin_number); pin.export()?; - sleep(Duration::from_millis(30)); + sleep(Duration::from_millis(60)); pin.set_direction(Direction::High)?; pin };