Skip to content

Commit 69b9a94

Browse files
committed
digital_io: test: remove input reading emulation
It turns out we do not actually read any inputs in our tests, so we can remove this implementation. This change was prompted by cargo clippy complaining about the u8 in LineEvent never being read. Signed-off-by: Leonard Göhrs <[email protected]>
1 parent bce0350 commit 69b9a94

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/digital_io/gpio/test.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1717

1818
use std::cell::RefCell;
19-
use std::iter::Iterator;
2019
use std::ops::BitOr;
2120
use std::sync::atomic::{AtomicU8, Ordering};
22-
use std::thread::sleep;
23-
use std::time::Duration;
2421

2522
use anyhow::Result;
2623
use async_std::sync::Arc;
@@ -42,30 +39,6 @@ impl LineHandle {
4239
}
4340
}
4441

45-
pub struct LineEvent(u8);
46-
47-
pub struct LineEventHandle {
48-
val: Arc<AtomicU8>,
49-
prev_val: u8,
50-
}
51-
52-
impl Iterator for LineEventHandle {
53-
type Item = Result<LineEvent, ()>;
54-
55-
fn next(&mut self) -> Option<Self::Item> {
56-
loop {
57-
let val = self.val.load(Ordering::Relaxed);
58-
59-
if val != self.prev_val {
60-
self.prev_val = val;
61-
return Some(Ok(LineEvent(val)));
62-
}
63-
64-
sleep(Duration::from_millis(100));
65-
}
66-
}
67-
}
68-
6942
#[allow(clippy::upper_case_acronyms, non_camel_case_types)]
7043
#[derive(Clone, Copy)]
7144
pub enum LineRequestFlags {

0 commit comments

Comments
 (0)