From 2d7ba44621fa35abad07d2ddb8b253e815ce2c1f Mon Sep 17 00:00:00 2001 From: kbleeke Date: Sun, 2 Apr 2023 20:19:47 +0200 Subject: rework event handling to allow sending data --- src/lib.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 069ca40f4..f9244bddb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,9 +18,11 @@ mod control; mod nvram; mod runner; +use core::slice; + use embassy_net_driver_channel as ch; use embedded_hal_1::digital::OutputPin; -use events::EventQueue; +use events::Events; use ioctl::IoctlState; use crate::bus::Bus; @@ -103,7 +105,7 @@ const CHIP: Chip = Chip { pub struct State { ioctl_state: IoctlState, ch: ch::State, - events: EventQueue, + events: Events, } impl State { @@ -111,7 +113,7 @@ impl State { Self { ioctl_state: IoctlState::new(), ch: ch::State::new(), - events: EventQueue::new(), + events: Events::new(), } } } @@ -225,3 +227,8 @@ where runner, ) } + +fn slice8_mut(x: &mut [u32]) -> &mut [u8] { + let len = x.len() * 4; + unsafe { slice::from_raw_parts_mut(x.as_mut_ptr() as _, len) } +} -- cgit