aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRob Wells <[email protected]>2025-08-19 19:02:20 +0100
committerRob Wells <[email protected]>2025-08-19 19:27:12 +0100
commit9c72c684d1446d36598c9ce628df41996420fb32 (patch)
tree10e4d8f36cccf2f8b5b5fd5ca401961a053c4f62 /examples
parentb5887b252ae2b8181de1948af2f2137d56bd9e76 (diff)
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.
Diffstat (limited to 'examples')
-rw-r--r--examples/rp/src/bin/i2c_blocking.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/rp/src/bin/i2c_blocking.rs b/examples/rp/src/bin/i2c_blocking.rs
index 6a57ded20..317921374 100644
--- a/examples/rp/src/bin/i2c_blocking.rs
+++ b/examples/rp/src/bin/i2c_blocking.rs
@@ -49,10 +49,8 @@ async fn main(_spawner: Spawner) {
49 let scl = p.PIN_15; 49 let scl = p.PIN_15;
50 50
51 info!("set up i2c "); 51 info!("set up i2c ");
52 let mut config = Config::default(); 52 // Default I2C config enables internal pull-up resistors.
53 // by default internal pullup resitors are disabled 53 let config = Config::default();
54 config.sda_pullup = true;
55 config.scl_pullup = true;
56 let mut i2c = i2c::I2c::new_blocking(p.I2C1, scl, sda, config); 54 let mut i2c = i2c::I2c::new_blocking(p.I2C1, scl, sda, config);
57 55
58 use mcp23017::*; 56 use mcp23017::*;