14
14
//! yourself then.
15
15
16
16
use cortex_m;
17
- use embedded_hal :: timer :: CountDown ;
17
+ use cortex_m :: prelude :: _embedded_hal_timer_CountDown ;
18
18
use fugit:: { ExtU32 , HertzU32 } ;
19
19
use rp2040_hal:: {
20
20
gpio:: AnyPin ,
21
21
pio:: { PIOExt , StateMachineIndex , Tx , UninitStateMachine , PIO } ,
22
+ timer:: CountDown ,
22
23
} ;
23
24
use smart_leds_trait:: SmartLedsWrite ;
24
25
@@ -210,20 +211,18 @@ where
210
211
/// // Do other stuff here...
211
212
/// };
212
213
///```
213
- pub struct Ws2812 < P , SM , C , I >
214
+ pub struct Ws2812 < ' timer , P , SM , I >
214
215
where
215
- C : CountDown ,
216
216
I : AnyPin < Function = P :: PinFunction > ,
217
217
P : PIOExt ,
218
218
SM : StateMachineIndex ,
219
219
{
220
220
driver : Ws2812Direct < P , SM , I > ,
221
- cd : C ,
221
+ cd : CountDown < ' timer > ,
222
222
}
223
223
224
- impl < P , SM , C , I > Ws2812 < P , SM , C , I >
224
+ impl < ' timer , P , SM , I > Ws2812 < ' timer , P , SM , I >
225
225
where
226
- C : CountDown ,
227
226
I : AnyPin < Function = P :: PinFunction > ,
228
227
P : PIOExt ,
229
228
SM : StateMachineIndex ,
@@ -234,15 +233,15 @@ where
234
233
pio : & mut PIO < P > ,
235
234
sm : UninitStateMachine < ( P , SM ) > ,
236
235
clock_freq : fugit:: HertzU32 ,
237
- cd : C ,
238
- ) -> Ws2812 < P , SM , C , I > {
236
+ cd : CountDown < ' timer > ,
237
+ ) -> Ws2812 < ' timer , P , SM , I > {
239
238
let driver = Ws2812Direct :: new ( pin, pio, sm, clock_freq) ;
240
239
241
240
Self { driver, cd }
242
241
}
243
242
}
244
243
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 >
246
245
where
247
246
I : AnyPin < Function = P :: PinFunction > ,
248
247
P : PIOExt ,
0 commit comments