Skip to content

Commit

Permalink
chore: take impl DelayNs instead of &mut impl DelayNs
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-k committed Aug 10, 2024
1 parent b23337d commit 766de0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ All notable changes for this crate are documented in this file.
* Support for LP5866
* `ConfigBuilder` is now an empty, generic-free struct that provides device-specific
`new_*()` methods. These return a `ConfigBuilderDeviceSpecific`.
* `LP586x::new_*()` methods now take a `impl DelayNs` instead of `&mut impl DelayNs`.
This usually shouldn't require code changes.

## 0.1.0

Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ where
config: &ConfigBuilderDeviceSpecific<DV, DM>,
i2c: I2C,
address: u8,
delay: &mut D,
delay: impl DelayNs,
) -> Result<Lp586x<DV, interface::I2cInterface<I2C>, DM>, Error<IE>> {
Lp586x::<DV, _, DM>::new(config, interface::I2cInterface::new(i2c, address), delay)
}
Expand All @@ -381,7 +381,7 @@ where
pub fn new_with_spi_device(
config: &ConfigBuilderDeviceSpecific<DV, DM>,
spi_device: SPI,
delay: &mut D,
delay: impl DelayNs,
) -> Result<Lp586x<DV, interface::SpiDeviceInterface<SPI>, DM>, Error<IE>> {
Lp586x::<DV, _, DM>::new(
config,
Expand Down Expand Up @@ -436,7 +436,7 @@ where
pub fn new(
config: &ConfigBuilderDeviceSpecific<DV, DM>,
interface: I,
delay: &mut D,
mut delay: impl DelayNs,
) -> Result<Lp586x<DV, I, DM>, Error<IE>> {
let mut driver = Lp586x {
interface,
Expand Down

0 comments on commit 766de0d

Please sign in to comment.