Loading rust/kernel/io/poll.rs +4 −10 Original line number Diff line number Diff line Loading @@ -42,8 +42,8 @@ /// /// const HW_READY: u16 = 0x01; /// /// fn wait_for_hardware<const SIZE: usize>(io: &Io<SIZE>) -> Result<()> { /// match read_poll_timeout( /// fn wait_for_hardware<const SIZE: usize>(io: &Io<SIZE>) -> Result { /// read_poll_timeout( /// // The `op` closure reads the value of a specific status register. /// || io.try_read16(0x1000), /// // The `cond` closure takes a reference to the value returned by `op` Loading @@ -51,15 +51,9 @@ /// |val: &u16| *val == HW_READY, /// Delta::from_millis(50), /// Delta::from_secs(3), /// ) { /// Ok(_) => { /// // The hardware is ready. The returned value of the `op` closure /// // isn't used. /// )?; /// Ok(()) /// } /// Err(e) => Err(e), /// } /// } /// ``` #[track_caller] pub fn read_poll_timeout<Op, Cond, T>( Loading Loading
rust/kernel/io/poll.rs +4 −10 Original line number Diff line number Diff line Loading @@ -42,8 +42,8 @@ /// /// const HW_READY: u16 = 0x01; /// /// fn wait_for_hardware<const SIZE: usize>(io: &Io<SIZE>) -> Result<()> { /// match read_poll_timeout( /// fn wait_for_hardware<const SIZE: usize>(io: &Io<SIZE>) -> Result { /// read_poll_timeout( /// // The `op` closure reads the value of a specific status register. /// || io.try_read16(0x1000), /// // The `cond` closure takes a reference to the value returned by `op` Loading @@ -51,15 +51,9 @@ /// |val: &u16| *val == HW_READY, /// Delta::from_millis(50), /// Delta::from_secs(3), /// ) { /// Ok(_) => { /// // The hardware is ready. The returned value of the `op` closure /// // isn't used. /// )?; /// Ok(()) /// } /// Err(e) => Err(e), /// } /// } /// ``` #[track_caller] pub fn read_poll_timeout<Op, Cond, T>( Loading