From 021221ede3057ca8fc456fb366369d4587dfb2de Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Sat, 21 Aug 2021 02:16:25 +1000 Subject: [PATCH] Switch the modify where C SDK does --- rp2040-hal/src/i2c.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rp2040-hal/src/i2c.rs b/rp2040-hal/src/i2c.rs index a482eeb..ef3c3c1 100644 --- a/rp2040-hal/src/i2c.rs +++ b/rp2040-hal/src/i2c.rs @@ -105,7 +105,7 @@ macro_rules! hal { i2c.ic_enable.write(|w| w.enable().disabled()); - i2c.ic_con.write(|w| { + i2c.ic_con.modify(|_,w| { w.speed().fast(); w.master_mode().enabled(); w.ic_slave_disable().slave_disabled(); @@ -162,7 +162,7 @@ macro_rules! hal { .bits(if lcnt < 16 { 1 } else { (lcnt / 16) as u8 }) }); i2c.ic_sda_hold - .write(|w| w.ic_sda_tx_hold().bits(sda_tx_hold_count as u16)); + .modify(|_r,w| w.ic_sda_tx_hold().bits(sda_tx_hold_count as u16)); } i2c.ic_enable.write(|w| w.enable().enabled());