stm32/hrtim: cleanup merge issues

This commit is contained in:
xoviat 2023-07-28 17:27:15 -05:00
parent c7c701b3e3
commit ec787d3518
3 changed files with 9 additions and 18 deletions

View file

@ -2,7 +2,7 @@ mod traits;
use core::marker::PhantomData;
use embassy_hal_common::{into_ref, PeripheralRef};
use embassy_hal_internal::{into_ref, PeripheralRef};
#[allow(unused_imports)]
use crate::gpio::sealed::{AFType, Pin};

View file

@ -1,3 +1,4 @@
use crate::rcc::sealed::RccPeripheral;
use crate::time::Hertz;
#[derive(Clone, Copy)]
@ -92,7 +93,9 @@ impl HighResolutionControlPrescaler {
pub(crate) mod sealed {
use super::*;
pub trait HighResolutionCaptureCompare16bitInstance: crate::timer::sealed::HighResolutionControlInstance {
pub trait HighResolutionCaptureCompare16bitInstance: RccPeripheral {
fn regs() -> crate::pac::hrtim::Hrtim;
fn set_master_frequency(frequency: Hertz);
fn set_channel_frequency(channnel: usize, frequency: Hertz);
@ -114,9 +117,12 @@ pub trait HighResolutionCaptureCompare16bitInstance:
foreach_interrupt! {
($inst:ident, hrtim, HRTIM, MASTER, $irq:ident) => {
impl sealed::HighResolutionCaptureCompare16bitInstance for crate::peripherals::$inst {
fn regs() -> crate::pac::hrtim::Hrtim {
crate::pac::$inst
}
fn set_master_frequency(frequency: Hertz) {
use crate::rcc::sealed::RccPeripheral;
use crate::timer::sealed::HighResolutionControlInstance;
let f = frequency.0;
let timer_f = Self::frequency().0;
@ -139,7 +145,6 @@ foreach_interrupt! {
fn set_channel_frequency(channel: usize, frequency: Hertz) {
use crate::rcc::sealed::RccPeripheral;
use crate::timer::sealed::HighResolutionControlInstance;
let f = frequency.0;
let timer_f = Self::frequency().0;
@ -161,7 +166,6 @@ foreach_interrupt! {
}
fn set_channel_dead_time(channel: usize, dead_time: u16) {
use crate::timer::sealed::HighResolutionControlInstance;
let regs = Self::regs();

View file

@ -429,17 +429,4 @@ foreach_interrupt! {
};
($inst:ident, hrtim, HRTIM, MASTER, $irq:ident) => {
impl sealed::HighResolutionControlInstance for crate::peripherals::$inst {
type Interrupt = crate::interrupt::typelevel::$irq;
fn regs() -> crate::pac::hrtim::Hrtim {
crate::pac::$inst
}
}
impl HighResolutionControlInstance for crate::peripherals::$inst {
}
};
}