Merge pull request #3387 from paulwrath1223/main

Fixed overflow on `pio_stepper.rs`
This commit is contained in:
Henrik Alsér 2024-10-02 21:17:54 +00:00 committed by GitHub
commit 6e0b08291b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -154,7 +154,7 @@ async fn main(_spawner: Spawner) {
stepper.step(1000).await;
info!("CCW full steps, drop after 1 sec");
if let Err(_) = with_timeout(Duration::from_secs(1), stepper.step(i32::MIN)).await {
if let Err(_) = with_timeout(Duration::from_secs(1), stepper.step(-i32::MAX)).await {
info!("Time's up!");
Timer::after(Duration::from_secs(1)).await;
}