Skip to content

Commit

Permalink
Bump rp2040-pac to 0.6 in rtic-monotonics (#905)
Browse files Browse the repository at this point in the history
* Support rp2040-pac v0.6 in rtic-monotonics

* Add changelog entry

* Fix rp2040_local_i2c_init example
  • Loading branch information
martinsp authored Apr 21, 2024
1 parent acb9f44 commit 5d05d60
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 63 deletions.
149 changes: 102 additions & 47 deletions examples/rp2040_local_i2c_init/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/rp2040_local_i2c_init/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ features = ["rp2040"]
cortex-m = "0.7"
embedded-hal = { version = "0.2.7", features = ["unproven"] }
fugit = "0.3"
rp-pico = "0.8.0"
rp-pico = "0.9.0"
panic-probe = "0.3"

[profile.dev]
Expand Down
12 changes: 6 additions & 6 deletions examples/rp2040_local_i2c_init/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod app {
gpio::{
self,
bank0::{Gpio2, Gpio25, Gpio3},
FunctionSioOutput, PullNone, PullUp,
FunctionSio, PullNone, PullUp, SioOutput,
},
pac,
sio::Sio,
Expand All @@ -41,7 +41,7 @@ mod app {

#[local]
struct Local {
led: gpio::Pin<Gpio25, FunctionSioOutput, PullNone>,
led: gpio::Pin<Gpio25, FunctionSio<SioOutput>, PullNone>,
i2c: &'static mut I2CBus,
}

Expand Down Expand Up @@ -82,14 +82,14 @@ mod app {
led.set_low().unwrap();

// Init I2C pins
let sda_pin = gpioa
let sda_pin: gpio::Pin<_, gpio::FunctionI2C, _> = gpioa
.gpio2
.into_pull_up_disabled()
.into_function::<gpio::FunctionI2C>();
let scl_pin = gpioa
.reconfigure();
let scl_pin: gpio::Pin<_, gpio::FunctionI2C, _> = gpioa
.gpio3
.into_pull_up_disabled()
.into_function::<gpio::FunctionI2C>();
.reconfigure();

// Init I2C itself, using MaybeUninit to overwrite the previously
// uninitialized i2c_ctx variable without dropping its value
Expand Down
Loading

0 comments on commit 5d05d60

Please sign in to comment.