diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 13 |
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; | |||
| 18 | mod nvram; | 18 | mod nvram; |
| 19 | mod runner; | 19 | mod runner; |
| 20 | 20 | ||
| 21 | use core::slice; | ||
| 22 | |||
| 21 | use embassy_net_driver_channel as ch; | 23 | use embassy_net_driver_channel as ch; |
| 22 | use embedded_hal_1::digital::OutputPin; | 24 | use embedded_hal_1::digital::OutputPin; |
| 23 | use events::EventQueue; | 25 | use events::Events; |
| 24 | use ioctl::IoctlState; | 26 | use ioctl::IoctlState; |
| 25 | 27 | ||
| 26 | use crate::bus::Bus; | 28 | use crate::bus::Bus; |
| @@ -103,7 +105,7 @@ const CHIP: Chip = Chip { | |||
| 103 | pub struct State { | 105 | pub 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 | ||
| 109 | impl State { | 111 | impl 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 | |||
| 231 | fn 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 | } | ||
