@@ -15,18 +15,17 @@ use crate::{
1515 ahb:: { AhbClk , AhbId } ,
1616 pclk:: { Pclk , PclkId , PclkSourceId } ,
1717 types:: Can0 ,
18- Source ,
1918 } ,
2019 gpio:: * ,
21- typelevel:: { Decrement , Increment , Sealed } ,
20+ typelevel:: Sealed ,
2221} ;
2322use atsamd_hal_macros:: hal_cfg;
2423
2524#[ hal_cfg( "can1" ) ]
2625use crate :: clock:: v2:: types:: Can1 ;
2726
28- use mcan_core:: fugit:: HertzU32 ;
2927use mcan_core:: CanId ;
28+ use mcan_core:: fugit:: HertzU32 ;
3029
3130/// Struct enclosing all the dependencies required to bootstrap `ID` instance of
3231/// MCAN.
@@ -47,37 +46,22 @@ impl<ID: PclkId + AhbId, PS: PclkSourceId, RX, TX, CAN> Dependencies<ID, PS, RX,
4746 ///
4847 /// This struct implements [`mcan_core::Dependencies`] trait, making it
4948 /// possible to construct an instance of `mcan::bus::CanConfigurable`.
50- pub fn new < S > (
51- gclk : S ,
52- pclk : Pclk < ID , PS > ,
53- ahbclk : AhbClk < ID > ,
54- rx : RX ,
55- tx : TX ,
56- can : CAN ,
57- ) -> ( Self , S :: Inc )
58- where
59- S : Source + Increment ,
60- {
61- (
62- Self {
63- pclk,
64- host_freq : gclk. freq ( ) ,
65- ahbclk,
66- rx,
67- tx,
68- can,
69- } ,
70- gclk. inc ( ) ,
71- )
49+ pub fn new ( pclk : Pclk < ID , PS > , ahbclk : AhbClk < ID > , rx : RX , tx : TX , can : CAN ) -> Self {
50+ let host_freq = pclk. freq ( ) ;
51+ Self {
52+ pclk,
53+ host_freq,
54+ ahbclk,
55+ rx,
56+ tx,
57+ can,
58+ }
7259 }
7360 /// Destroy an instance of `Dependencies` struct.
7461 ///
7562 /// Releases all enclosed objects back to the user.
7663 #[ allow( clippy:: type_complexity) ]
77- pub fn free < S > ( self , gclk : S ) -> ( Pclk < ID , PS > , HertzU32 , AhbClk < ID > , RX , TX , CAN , S :: Dec )
78- where
79- S : Source + Decrement ,
80- {
64+ pub fn free ( self ) -> ( Pclk < ID , PS > , HertzU32 , AhbClk < ID > , RX , TX , CAN ) {
8165 let Self {
8266 pclk,
8367 host_freq,
@@ -86,7 +70,7 @@ impl<ID: PclkId + AhbId, PS: PclkSourceId, RX, TX, CAN> Dependencies<ID, PS, RX,
8670 tx,
8771 can,
8872 } = self ;
89- ( pclk, host_freq, ahbclk, rx, tx, can, gclk . dec ( ) )
73+ ( pclk, host_freq, ahbclk, rx, tx, can)
9074 }
9175}
9276
0 commit comments