diff options
| -rw-r--r-- | embassy-nrf/src/buffered_uarte.rs | 7 | ||||
| -rw-r--r-- | embassy-nrf/src/gpio.rs | 24 | ||||
| -rw-r--r-- | embassy-nrf/src/wdt.rs | 5 |
3 files changed, 26 insertions, 10 deletions
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs index b368a3d33..159b4db8f 100644 --- a/embassy-nrf/src/buffered_uarte.rs +++ b/embassy-nrf/src/buffered_uarte.rs | |||
| @@ -219,6 +219,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> { | |||
| 219 | /// # Panics | 219 | /// # Panics |
| 220 | /// | 220 | /// |
| 221 | /// Panics if `rx_buffer.len()` is odd. | 221 | /// Panics if `rx_buffer.len()` is odd. |
| 222 | #[allow(clippy::too_many_arguments)] | ||
| 222 | pub fn new( | 223 | pub fn new( |
| 223 | uarte: impl Peripheral<P = U> + 'd, | 224 | uarte: impl Peripheral<P = U> + 'd, |
| 224 | timer: impl Peripheral<P = T> + 'd, | 225 | timer: impl Peripheral<P = T> + 'd, |
| @@ -254,6 +255,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> { | |||
| 254 | /// # Panics | 255 | /// # Panics |
| 255 | /// | 256 | /// |
| 256 | /// Panics if `rx_buffer.len()` is odd. | 257 | /// Panics if `rx_buffer.len()` is odd. |
| 258 | #[allow(clippy::too_many_arguments)] | ||
| 257 | pub fn new_with_rtscts( | 259 | pub fn new_with_rtscts( |
| 258 | uarte: impl Peripheral<P = U> + 'd, | 260 | uarte: impl Peripheral<P = U> + 'd, |
| 259 | timer: impl Peripheral<P = T> + 'd, | 261 | timer: impl Peripheral<P = T> + 'd, |
| @@ -286,6 +288,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> { | |||
| 286 | ) | 288 | ) |
| 287 | } | 289 | } |
| 288 | 290 | ||
| 291 | #[allow(clippy::too_many_arguments)] | ||
| 289 | fn new_inner( | 292 | fn new_inner( |
| 290 | peri: PeripheralRef<'d, U>, | 293 | peri: PeripheralRef<'d, U>, |
| 291 | timer: PeripheralRef<'d, T>, | 294 | timer: PeripheralRef<'d, T>, |
| @@ -534,6 +537,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarteRx<'d, U, T> { | |||
| 534 | /// # Panics | 537 | /// # Panics |
| 535 | /// | 538 | /// |
| 536 | /// Panics if `rx_buffer.len()` is odd. | 539 | /// Panics if `rx_buffer.len()` is odd. |
| 540 | #[allow(clippy::too_many_arguments)] | ||
| 537 | pub fn new( | 541 | pub fn new( |
| 538 | uarte: impl Peripheral<P = U> + 'd, | 542 | uarte: impl Peripheral<P = U> + 'd, |
| 539 | timer: impl Peripheral<P = T> + 'd, | 543 | timer: impl Peripheral<P = T> + 'd, |
| @@ -564,6 +568,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarteRx<'d, U, T> { | |||
| 564 | /// # Panics | 568 | /// # Panics |
| 565 | /// | 569 | /// |
| 566 | /// Panics if `rx_buffer.len()` is odd. | 570 | /// Panics if `rx_buffer.len()` is odd. |
| 571 | #[allow(clippy::too_many_arguments)] | ||
| 567 | pub fn new_with_rts( | 572 | pub fn new_with_rts( |
| 568 | uarte: impl Peripheral<P = U> + 'd, | 573 | uarte: impl Peripheral<P = U> + 'd, |
| 569 | timer: impl Peripheral<P = T> + 'd, | 574 | timer: impl Peripheral<P = T> + 'd, |
| @@ -590,6 +595,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarteRx<'d, U, T> { | |||
| 590 | ) | 595 | ) |
| 591 | } | 596 | } |
| 592 | 597 | ||
| 598 | #[allow(clippy::too_many_arguments)] | ||
| 593 | fn new_inner( | 599 | fn new_inner( |
| 594 | peri: PeripheralRef<'d, U>, | 600 | peri: PeripheralRef<'d, U>, |
| 595 | timer: PeripheralRef<'d, T>, | 601 | timer: PeripheralRef<'d, T>, |
| @@ -614,6 +620,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarteRx<'d, U, T> { | |||
| 614 | this | 620 | this |
| 615 | } | 621 | } |
| 616 | 622 | ||
| 623 | #[allow(clippy::too_many_arguments)] | ||
| 617 | fn new_innerer( | 624 | fn new_innerer( |
| 618 | peri: PeripheralRef<'d, U>, | 625 | peri: PeripheralRef<'d, U>, |
| 619 | timer: PeripheralRef<'d, T>, | 626 | timer: PeripheralRef<'d, T>, |
diff --git a/embassy-nrf/src/gpio.rs b/embassy-nrf/src/gpio.rs index 7b272dca0..dbc26ea3f 100644 --- a/embassy-nrf/src/gpio.rs +++ b/embassy-nrf/src/gpio.rs | |||
| @@ -534,11 +534,13 @@ mod eh02 { | |||
| 534 | type Error = Infallible; | 534 | type Error = Infallible; |
| 535 | 535 | ||
| 536 | fn set_high(&mut self) -> Result<(), Self::Error> { | 536 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 537 | Ok(self.set_high()) | 537 | self.set_high(); |
| 538 | Ok(()) | ||
| 538 | } | 539 | } |
| 539 | 540 | ||
| 540 | fn set_low(&mut self) -> Result<(), Self::Error> { | 541 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 541 | Ok(self.set_low()) | 542 | self.set_low(); |
| 543 | Ok(()) | ||
| 542 | } | 544 | } |
| 543 | } | 545 | } |
| 544 | 546 | ||
| @@ -580,11 +582,13 @@ mod eh02 { | |||
| 580 | type Error = Infallible; | 582 | type Error = Infallible; |
| 581 | 583 | ||
| 582 | fn set_high(&mut self) -> Result<(), Self::Error> { | 584 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 583 | Ok(self.set_high()) | 585 | self.set_high(); |
| 586 | Ok(()) | ||
| 584 | } | 587 | } |
| 585 | 588 | ||
| 586 | fn set_low(&mut self) -> Result<(), Self::Error> { | 589 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 587 | Ok(self.set_low()) | 590 | self.set_low(); |
| 591 | Ok(()) | ||
| 588 | } | 592 | } |
| 589 | } | 593 | } |
| 590 | 594 | ||
| @@ -628,11 +632,13 @@ impl<'d> embedded_hal_1::digital::ErrorType for Output<'d> { | |||
| 628 | 632 | ||
| 629 | impl<'d> embedded_hal_1::digital::OutputPin for Output<'d> { | 633 | impl<'d> embedded_hal_1::digital::OutputPin for Output<'d> { |
| 630 | fn set_high(&mut self) -> Result<(), Self::Error> { | 634 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 631 | Ok(self.set_high()) | 635 | self.set_high(); |
| 636 | Ok(()) | ||
| 632 | } | 637 | } |
| 633 | 638 | ||
| 634 | fn set_low(&mut self) -> Result<(), Self::Error> { | 639 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 635 | Ok(self.set_low()) | 640 | self.set_low(); |
| 641 | Ok(()) | ||
| 636 | } | 642 | } |
| 637 | } | 643 | } |
| 638 | 644 | ||
| @@ -665,11 +671,13 @@ impl<'d> embedded_hal_1::digital::InputPin for Flex<'d> { | |||
| 665 | 671 | ||
| 666 | impl<'d> embedded_hal_1::digital::OutputPin for Flex<'d> { | 672 | impl<'d> embedded_hal_1::digital::OutputPin for Flex<'d> { |
| 667 | fn set_high(&mut self) -> Result<(), Self::Error> { | 673 | fn set_high(&mut self) -> Result<(), Self::Error> { |
| 668 | Ok(self.set_high()) | 674 | self.set_high(); |
| 675 | Ok(()) | ||
| 669 | } | 676 | } |
| 670 | 677 | ||
| 671 | fn set_low(&mut self) -> Result<(), Self::Error> { | 678 | fn set_low(&mut self) -> Result<(), Self::Error> { |
| 672 | Ok(self.set_low()) | 679 | self.set_low(); |
| 680 | Ok(()) | ||
| 673 | } | 681 | } |
| 674 | } | 682 | } |
| 675 | 683 | ||
diff --git a/embassy-nrf/src/wdt.rs b/embassy-nrf/src/wdt.rs index 5a261ce8f..e4cfa3344 100644 --- a/embassy-nrf/src/wdt.rs +++ b/embassy-nrf/src/wdt.rs | |||
| @@ -184,8 +184,9 @@ impl WatchdogHandle { | |||
| 184 | 184 | ||
| 185 | /// Steal a watchdog handle by index. | 185 | /// Steal a watchdog handle by index. |
| 186 | /// | 186 | /// |
| 187 | /// Safety: watchdog must be initialized, index must be between 0 and N-1 where | 187 | /// # Safety |
| 188 | /// N is the handle count when initializing. | 188 | /// Watchdog must be initialized and `index` must be between `0` and `N-1` |
| 189 | /// where `N` is the handle count when initializing. | ||
| 189 | pub unsafe fn steal(index: u8) -> Self { | 190 | pub unsafe fn steal(index: u8) -> Self { |
| 190 | Self { index } | 191 | Self { index } |
| 191 | } | 192 | } |
