From 3514463dbbc74f90ebbe3e9ff586e34092f124bc Mon Sep 17 00:00:00 2001 From: Naxdy Date: Wed, 27 Mar 2024 20:09:14 +0100 Subject: [PATCH] fix(input): don't use raw waker (embassy) --- src/input.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/input.rs b/src/input.rs index de142b9..ee29a14 100644 --- a/src/input.rs +++ b/src/input.rs @@ -135,9 +135,11 @@ async fn update_stick_states< let mut cy_sum = 0u32; // TODO: lower interval possible? - let mut timer = Timer::at(Instant::now() + embassy_time::Duration::from_millis(1)); - while embassy_futures::poll_once(&mut timer) != Poll::Ready(()) { + let end_time = Instant::now() + embassy_time::Duration::from_millis(1); + let timer = Timer::at(end_time); + + while Instant::now() < end_time { adc_count += 1; ax_sum += read_ext_adc( Stick::ControlStick,