diff options
Diffstat (limited to 'embassy-usb-synopsys-otg')
| -rw-r--r-- | embassy-usb-synopsys-otg/src/lib.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/embassy-usb-synopsys-otg/src/lib.rs b/embassy-usb-synopsys-otg/src/lib.rs index 615faa2fc..44b2bd093 100644 --- a/embassy-usb-synopsys-otg/src/lib.rs +++ b/embassy-usb-synopsys-otg/src/lib.rs | |||
| @@ -242,23 +242,20 @@ unsafe impl<const EP_COUNT: usize> Sync for State<EP_COUNT> {} | |||
| 242 | impl<const EP_COUNT: usize> State<EP_COUNT> { | 242 | impl<const EP_COUNT: usize> State<EP_COUNT> { |
| 243 | /// Create a new State. | 243 | /// Create a new State. |
| 244 | pub const fn new() -> Self { | 244 | pub const fn new() -> Self { |
| 245 | const NEW_AW: AtomicWaker = AtomicWaker::new(); | ||
| 246 | const NEW_BUF: UnsafeCell<*mut u8> = UnsafeCell::new(0 as _); | ||
| 247 | const NEW_SIZE: AtomicU16 = AtomicU16::new(EP_OUT_BUFFER_EMPTY); | ||
| 248 | const NEW_EP_STATE: EpState = EpState { | ||
| 249 | in_waker: NEW_AW, | ||
| 250 | out_waker: NEW_AW, | ||
| 251 | out_buffer: NEW_BUF, | ||
| 252 | out_size: NEW_SIZE, | ||
| 253 | }; | ||
| 254 | |||
| 255 | Self { | 245 | Self { |
| 256 | cp_state: ControlPipeSetupState { | 246 | cp_state: ControlPipeSetupState { |
| 257 | setup_data: [const { AtomicU32::new(0) }; 2], | 247 | setup_data: [const { AtomicU32::new(0) }; 2], |
| 258 | setup_ready: AtomicBool::new(false), | 248 | setup_ready: AtomicBool::new(false), |
| 259 | }, | 249 | }, |
| 260 | ep_states: [NEW_EP_STATE; EP_COUNT], | 250 | ep_states: [const { |
| 261 | bus_waker: NEW_AW, | 251 | EpState { |
| 252 | in_waker: AtomicWaker::new(), | ||
| 253 | out_waker: AtomicWaker::new(), | ||
| 254 | out_buffer: UnsafeCell::new(0 as _), | ||
| 255 | out_size: AtomicU16::new(EP_OUT_BUFFER_EMPTY), | ||
| 256 | } | ||
| 257 | }; EP_COUNT], | ||
| 258 | bus_waker: AtomicWaker::new(), | ||
| 262 | } | 259 | } |
| 263 | } | 260 | } |
| 264 | } | 261 | } |
