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.
This commit is contained in:
Rob Wells 2025-08-19 19:02:20 +01:00
parent b5887b252a
commit 9c72c684d1
No known key found for this signature in database

View File

@ -49,10 +49,8 @@ async fn main(_spawner: Spawner) {
let scl = p.PIN_15;
info!("set up i2c ");
let mut config = Config::default();
// by default internal pullup resitors are disabled
config.sda_pullup = true;
config.scl_pullup = true;
// Default I2C config enables internal pull-up resistors.
let config = Config::default();
let mut i2c = i2c::I2c::new_blocking(p.I2C1, scl, sda, config);
use mcp23017::*;