From ce7353fba4e2a133087f0312ae47184aa180642e Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Tue, 12 Jul 2022 07:52:16 +0200 Subject: Hook up embassy-net. IT WORKS. --- src/structs.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/structs.rs') diff --git a/src/structs.rs b/src/structs.rs index dd2c0cfe9..060c2b060 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -1,3 +1,5 @@ +use crate::events::Event; + macro_rules! impl_bytes { ($t:ident) => { impl $t { @@ -157,3 +159,10 @@ pub struct EventMask { pub events: [u8; 24], } impl_bytes!(EventMask); + +impl EventMask { + pub fn unset(&mut self, evt: Event) { + let evt = evt as u8 as usize; + self.events[evt / 8] &= !(1 << (evt % 8)); + } +} -- cgit