Skip to content

Commit

Permalink
fix(i2c): add ioc setting to pin
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Oct 7, 2024
1 parent f5f3aa2 commit 606914b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/i2c/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,15 @@ impl<'d> I2c<'d, Blocking> {
) -> Self {
into_ref!(scl, sda);

scl.set_as_ioc_gpio();
sda.set_as_ioc_gpio();

#[cfg(not(ip_feature_i2c_support_reset))]
loop {
// TODO: Fix this strangle control flow
use embedded_hal::delay::DelayNs;
use riscv::delay::McycleDelay;

scl.set_as_ioc_gpio();
sda.set_as_ioc_gpio();
scl.set_as_input();
sda.set_as_input();

Expand Down Expand Up @@ -224,14 +225,15 @@ impl<'d> I2c<'d, Async> {
) -> Self {
into_ref!(scl, sda);

scl.set_as_ioc_gpio();
sda.set_as_ioc_gpio();

#[cfg(not(ip_feature_i2c_support_reset))]
loop {
// TODO: Fix this strangle control flow
use embedded_hal::delay::DelayNs;
use riscv::delay::McycleDelay;

scl.set_as_ioc_gpio();
sda.set_as_ioc_gpio();
scl.set_as_input();
sda.set_as_input();

Expand Down

0 comments on commit 606914b

Please # to comment.