Skip to content

Commit 9c72c68

Browse files
committed
rp: fix blocking I2C example regarding pull-up resistors
This amends the blocking I2C example for embassy-rp. Commit bbc3e49 added a pull-up configuration and a comment that pull-ups were not enabled by default. This was made out-of-date by badcdcc, which ensured pull-ups were enabled by default to make the larger I2C configuration change non-breaking. This commit removes the (now-unnecessary) pull-up configuration, and adds a comment to clarify that the default I2C configuration enables pull-ups.
1 parent b5887b2 commit 9c72c68

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

examples/rp/src/bin/i2c_blocking.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ async fn main(_spawner: Spawner) {
4949
let scl = p.PIN_15;
5050

5151
info!("set up i2c ");
52-
let mut config = Config::default();
53-
// by default internal pullup resitors are disabled
54-
config.sda_pullup = true;
55-
config.scl_pullup = true;
52+
// Default I2C config enables internal pull-up resistors.
53+
let config = Config::default();
5654
let mut i2c = i2c::I2c::new_blocking(p.I2C1, scl, sda, config);
5755

5856
use mcp23017::*;

0 commit comments

Comments
 (0)