aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs13
1 files changed, 10 insertions, 3 deletions
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;
18mod nvram; 18mod nvram;
19mod runner; 19mod runner;
20 20
21use core::slice;
22
21use embassy_net_driver_channel as ch; 23use embassy_net_driver_channel as ch;
22use embedded_hal_1::digital::OutputPin; 24use embedded_hal_1::digital::OutputPin;
23use events::EventQueue; 25use events::Events;
24use ioctl::IoctlState; 26use ioctl::IoctlState;
25 27
26use crate::bus::Bus; 28use crate::bus::Bus;
@@ -103,7 +105,7 @@ const CHIP: Chip = Chip {
103pub struct State { 105pub struct State {
104 ioctl_state: IoctlState, 106 ioctl_state: IoctlState,
105 ch: ch::State<MTU, 4, 4>, 107 ch: ch::State<MTU, 4, 4>,
106 events: EventQueue, 108 events: Events,
107} 109}
108 110
109impl State { 111impl State {
@@ -111,7 +113,7 @@ impl State {
111 Self { 113 Self {
112 ioctl_state: IoctlState::new(), 114 ioctl_state: IoctlState::new(),
113 ch: ch::State::new(), 115 ch: ch::State::new(),
114 events: EventQueue::new(), 116 events: Events::new(),
115 } 117 }
116 } 118 }
117} 119}
@@ -225,3 +227,8 @@ where
225 runner, 227 runner,
226 ) 228 )
227} 229}
230
231fn slice8_mut(x: &mut [u32]) -> &mut [u8] {
232 let len = x.len() * 4;
233 unsafe { slice::from_raw_parts_mut(x.as_mut_ptr() as _, len) }
234}