From 314611124213c8c6490b0a1dc8b82da793202837 Mon Sep 17 00:00:00 2001 From: Ashcon Mohseninia Date: Tue, 3 Dec 2024 14:12:45 +0100 Subject: [PATCH] Decouple Gclk0 from CAN --- hal/src/peripherals/can.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hal/src/peripherals/can.rs b/hal/src/peripherals/can.rs index 2f65e4c7324..d5ca132a3ce 100644 --- a/hal/src/peripherals/can.rs +++ b/hal/src/peripherals/can.rs @@ -13,7 +13,6 @@ use crate::{ clock::v2::{ ahb::{AhbClk, AhbId}, - gclk::Gclk0Id, pclk::{Pclk, PclkId, PclkSourceId}, types::Can0, Source, @@ -49,7 +48,7 @@ impl Dependencies( - gclk0: S, + gclk: S, pclk: Pclk, ahbclk: AhbClk, rx: RX, @@ -57,27 +56,27 @@ impl Dependencies (Self, S::Inc) where - S: Source + Increment, + S: Source + Increment, { ( Self { pclk, - host_freq: gclk0.freq(), + host_freq: gclk.freq(), ahbclk, rx, tx, can, }, - gclk0.inc(), + gclk.inc(), ) } /// Destroy an instance of `Dependencies` struct. /// /// Releases all enclosed objects back to the user. #[allow(clippy::type_complexity)] - pub fn free(self, gclk0: S) -> (Pclk, HertzU32, AhbClk, RX, TX, CAN, S::Dec) + pub fn free(self, gclk: S) -> (Pclk, HertzU32, AhbClk, RX, TX, CAN, S::Dec) where - S: Source + Decrement, + S: Source + Decrement, { let Self { pclk, @@ -87,7 +86,7 @@ impl Dependencies