Skip to content

Commit

Permalink
Fix MAX17055 write_sequential
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Oct 10, 2023
1 parent 18efa87 commit af6684c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions max17055/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ where
where
R: Register<RegisterWidth = u16>,
{
for el in buffer.iter_mut() {
self.write_one(R::ADDRESS, *el)?;
for (i, el) in buffer.iter_mut().enumerate() {
self.write_one((R::ADDRESS as usize + i) as u8, *el)?;
}
Ok(())
}
Expand Down Expand Up @@ -249,8 +249,9 @@ where
where
R: Register<RegisterWidth = u16>,
{
for el in buffer.iter_mut() {
self.write_one_async(R::ADDRESS, *el).await?;
for (i, el) in buffer.iter_mut().enumerate() {
self.write_one_async((R::ADDRESS as usize + i) as u8, *el)
.await?;
}

Ok(())
Expand Down

0 comments on commit af6684c

Please sign in to comment.