mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-28 04:40:39 +00:00
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:
parent
b5887b252a
commit
9c72c684d1
@ -49,10 +49,8 @@ async fn main(_spawner: Spawner) {
|
|||||||
let scl = p.PIN_15;
|
let scl = p.PIN_15;
|
||||||
|
|
||||||
info!("set up i2c ");
|
info!("set up i2c ");
|
||||||
let mut config = Config::default();
|
// Default I2C config enables internal pull-up resistors.
|
||||||
// by default internal pullup resitors are disabled
|
let config = Config::default();
|
||||||
config.sda_pullup = true;
|
|
||||||
config.scl_pullup = true;
|
|
||||||
let mut i2c = i2c::I2c::new_blocking(p.I2C1, scl, sda, config);
|
let mut i2c = i2c::I2c::new_blocking(p.I2C1, scl, sda, config);
|
||||||
|
|
||||||
use mcp23017::*;
|
use mcp23017::*;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user