|
85 | 85 | //! fn get_timeout(&self) -> Self::Time;
|
86 | 86 | //!
|
87 | 87 | //! /// Pauses the timer
|
88 |
| -//! fn pause(&self); |
| 88 | +//! fn pause(&mut self); |
89 | 89 | //!
|
90 | 90 | //! /// Restarts the timer count
|
91 |
| -//! fn restart(&self); |
| 91 | +//! fn restart(&mut self); |
92 | 92 | //!
|
93 | 93 | //! /// Resumes the timer count
|
94 |
| -//! fn resume(&self); |
| 94 | +//! fn resume(&mut self); |
95 | 95 | //!
|
96 | 96 | //! /// Sets a new timeout
|
97 |
| -//! fn set_timeout<T>(&self, ticks: T) where T: Into<Self::Time>; |
| 97 | +//! fn set_timeout<T>(&mut self, ticks: T) where T: Into<Self::Time>; |
98 | 98 | //!
|
99 | 99 | //! /// "waits" until the timer times out
|
100 | 100 | //! fn wait(&self) -> nb::Result<(), !>;
|
|
146 | 146 | //! {
|
147 | 147 | //! type Error = Error;
|
148 | 148 | //!
|
149 |
| -//! fn read(&self) -> nb::Result<u8, Error> { |
| 149 | +//! fn read(&mut self) -> nb::Result<u8, Error> { |
150 | 150 | //! // read the status register
|
151 | 151 | //! let sr = self.0.sr.read();
|
152 | 152 | //!
|
|
172 | 172 | //! {
|
173 | 173 | //! type Error = Error;
|
174 | 174 | //!
|
175 |
| -//! fn write(&self, byte: u8) -> nb::Result<(), Error> { |
| 175 | +//! fn write(&mut self, byte: u8) -> nb::Result<(), Error> { |
176 | 176 | //! // Very similar to the above implementation
|
177 | 177 | //! Ok(())
|
178 | 178 | //! }
|
|
203 | 203 | //! impl hal::serial::Read<u8> for Serial1 {
|
204 | 204 | //! type Error = !;
|
205 | 205 | //!
|
206 |
| -//! fn read(&self) -> Result<u8, nb::Error<Self::Error>> { |
| 206 | +//! fn read(&mut self) -> Result<u8, nb::Error<Self::Error>> { |
207 | 207 | //! hal::serial::Read::read(&Serial(&*USART1.lock()))
|
208 | 208 | //! }
|
209 | 209 | //! }
|
|
419 | 419 | //!
|
420 | 420 | //! use hal::prelude::*;
|
421 | 421 | //!
|
422 |
| -//! fn write_all<S>(serial: &S, buffer: &[u8]) -> Result<(), S::Error> |
| 422 | +//! fn write_all<S>(serial: &mut S, buffer: &[u8]) -> Result<(), S::Error> |
423 | 423 | //! where
|
424 | 424 | //! S: hal::serial::Write<u8>
|
425 | 425 | //! {
|
|
446 | 446 | //! }
|
447 | 447 | //!
|
448 | 448 | //! fn read_with_timeout<S, T>(
|
449 |
| -//! serial: &S, |
450 |
| -//! timer: &T, |
| 449 | +//! serial: &mut S, |
| 450 | +//! timer: &mut T, |
451 | 451 | //! timeout: T::Time,
|
452 | 452 | //! ) -> Result<u8, Error<S::Error>>
|
453 | 453 | //! where
|
|
519 | 519 | //!
|
520 | 520 | //! use hal::prelude::*;
|
521 | 521 | //!
|
522 |
| -//! fn flush<S>(serial: &S, cb: &mut CircularBuffer) -> Result<(), S::Error> |
| 522 | +//! fn flush<S>(serial: &mut S, cb: &mut CircularBuffer) -> Result<(), S::Error> |
523 | 523 | //! where
|
524 | 524 | //! S: hal::serial::Write<u8>,
|
525 | 525 | //! {
|
|
565 | 565 | //! let serial = SERIAL.lock();
|
566 | 566 | //! let buffer = BUFFER.lock();
|
567 | 567 | //!
|
568 |
| -//! flush(&serial, &mut buffer).unwrap(); |
| 568 | +//! flush(&mut serial, &mut buffer).unwrap(); |
569 | 569 | //! }
|
570 | 570 | //! ```
|
571 | 571 | //!
|
|
0 commit comments