From 4ecd69c3d2ab21a3a3596e97a08c1bdbf7408ffe Mon Sep 17 00:00:00 2001 From: irriden Date: Tue, 1 Aug 2023 18:47:16 +0000 Subject: [PATCH] fixup warning in periph button --- sphinx-key/src/periph/button.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sphinx-key/src/periph/button.rs b/sphinx-key/src/periph/button.rs index e785ff8..8758ed4 100644 --- a/sphinx-key/src/periph/button.rs +++ b/sphinx-key/src/periph/button.rs @@ -18,10 +18,7 @@ pub fn button_loop(gpio9: gpio::Gpio9, tx: mpsc::Sender) { let mut pressed = false; let mut up_times = 0; let mut low_times = 0; - let mut machine = Machine { - tx, - state: Status::Starting, - }; + let mut machine = Machine::new(tx, Status::Starting); loop { // we are using thread::sleep here to make sure the watchdog isn't triggered thread::sleep(Duration::from_millis(PAUSE.into()));