From 8b50f2a58be0e23ca451d03af7769773e3815b00 Mon Sep 17 00:00:00 2001 From: jrmoulton Date: Tue, 18 Jun 2024 11:17:15 -0600 Subject: [PATCH] remove dead code when v1 --- embassy-stm32/src/i2c/config.rs | 6 ------ embassy-stm32/src/i2c/v2.rs | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/embassy-stm32/src/i2c/config.rs b/embassy-stm32/src/i2c/config.rs index 6f9c53f1f..2c7676bd9 100644 --- a/embassy-stm32/src/i2c/config.rs +++ b/embassy-stm32/src/i2c/config.rs @@ -46,12 +46,6 @@ impl From for Address { } } impl Address { - pub(super) fn add_mode(&self) -> stm32_metapac::i2c::vals::Addmode { - match self { - Address::SevenBit(_) => stm32_metapac::i2c::vals::Addmode::BIT7, - Address::TenBit(_) => stm32_metapac::i2c::vals::Addmode::BIT10, - } - } /// Get the inner address as a u16. /// /// For 7 bit addresses, the u8 that was used to store the address is returned as a u16. diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs index b6d714327..531358efa 100644 --- a/embassy-stm32/src/i2c/v2.rs +++ b/embassy-stm32/src/i2c/v2.rs @@ -27,6 +27,15 @@ impl From for Oamsk { } } +impl Address { + pub(super) fn add_mode(&self) -> stm32_metapac::i2c::vals::Addmode { + match self { + Address::SevenBit(_) => stm32_metapac::i2c::vals::Addmode::BIT7, + Address::TenBit(_) => stm32_metapac::i2c::vals::Addmode::BIT10, + } + } +} + pub(crate) unsafe fn on_interrupt() { let regs = T::info().regs; let isr = regs.isr().read();