1414//! yourself then.
1515
1616use cortex_m;
17- use embedded_hal :: timer :: CountDown ;
17+ use cortex_m :: prelude :: _embedded_hal_timer_CountDown ;
1818use fugit:: { ExtU32 , HertzU32 } ;
1919use rp2040_hal:: {
2020 gpio:: AnyPin ,
2121 pio:: { PIOExt , StateMachineIndex , Tx , UninitStateMachine , PIO } ,
22+ timer:: CountDown ,
2223} ;
2324use smart_leds_trait:: SmartLedsWrite ;
2425
@@ -210,20 +211,18 @@ where
210211/// // Do other stuff here...
211212/// };
212213///```
213- pub struct Ws2812 < P , SM , C , I >
214+ pub struct Ws2812 < ' timer , P , SM , I >
214215where
215- C : CountDown ,
216216 I : AnyPin < Function = P :: PinFunction > ,
217217 P : PIOExt ,
218218 SM : StateMachineIndex ,
219219{
220220 driver : Ws2812Direct < P , SM , I > ,
221- cd : C ,
221+ cd : CountDown < ' timer > ,
222222}
223223
224- impl < P , SM , C , I > Ws2812 < P , SM , C , I >
224+ impl < ' timer , P , SM , I > Ws2812 < ' timer , P , SM , I >
225225where
226- C : CountDown ,
227226 I : AnyPin < Function = P :: PinFunction > ,
228227 P : PIOExt ,
229228 SM : StateMachineIndex ,
@@ -234,15 +233,15 @@ where
234233 pio : & mut PIO < P > ,
235234 sm : UninitStateMachine < ( P , SM ) > ,
236235 clock_freq : fugit:: HertzU32 ,
237- cd : C ,
238- ) -> Ws2812 < P , SM , C , I > {
236+ cd : CountDown < ' timer > ,
237+ ) -> Ws2812 < ' timer , P , SM , I > {
239238 let driver = Ws2812Direct :: new ( pin, pio, sm, clock_freq) ;
240239
241240 Self { driver, cd }
242241 }
243242}
244243
245- impl < ' timer , P , SM , I > SmartLedsWrite for Ws2812 < P , SM , rp2040_hal :: timer :: CountDown < ' timer > , I >
244+ impl < ' timer , P , SM , I > SmartLedsWrite for Ws2812 < ' timer , P , SM , I >
246245where
247246 I : AnyPin < Function = P :: PinFunction > ,
248247 P : PIOExt ,
0 commit comments