Skip to content

Commit bb9d0db

Browse files
committed
Update to embedded-hal 1.0 alpha.11
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent b1eddb1 commit bb9d0db

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ documentation = "https://docs.rs/ws2812-pio"
88
repository = "https://github.com/rp-rs/ws2812-pio-rs/"
99

1010
[dependencies]
11-
embedded-hal = "0.2.5"
11+
embedded-hal = "1.0.0-alpha.11"
1212
fugit = "0.3.5"
13-
rp2040-hal = "0.9.0-alpha.1"
13+
rp2040-hal = { version = "0.9.0-alpha.1", features = [ "eh1_0_alpha", ] }
1414
pio = "0.2.0"
1515
smart-leds-trait = "0.2.1"
1616
nb = "1.0.0"

src/lib.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
//! yourself then.
1515
1616
use cortex_m;
17-
use embedded_hal::timer::CountDown;
17+
use cortex_m::prelude::_embedded_hal_timer_CountDown;
1818
use fugit::{ExtU32, HertzU32};
1919
use rp2040_hal::{
2020
gpio::AnyPin,
2121
pio::{PIOExt, StateMachineIndex, Tx, UninitStateMachine, PIO},
22+
timer::CountDown,
2223
};
2324
use 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>
214215
where
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>
225225
where
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>
246245
where
247246
I: AnyPin<Function = P::PinFunction>,
248247
P: PIOExt,

0 commit comments

Comments
 (0)