Skip to content

Commit 430b884

Browse files
committed
Update to embedded-hal 1.0 alpha.11
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent b1eddb1 commit 430b884

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
//! Bear in mind that you will have to take care of timing requirements
1414
//! yourself then.
1515
16-
use cortex_m;
17-
use embedded_hal::timer::CountDown;
16+
use cortex_m::prelude::_embedded_hal_timer_CountDown;
1817
use fugit::{ExtU32, HertzU32};
1918
use rp2040_hal::{
2019
gpio::AnyPin,
2120
pio::{PIOExt, StateMachineIndex, Tx, UninitStateMachine, PIO},
21+
timer::CountDown,
2222
};
2323
use smart_leds_trait::SmartLedsWrite;
2424

@@ -143,7 +143,10 @@ where
143143

144144
sm.start();
145145

146-
Self { tx, _pin: I::from(pin) }
146+
Self {
147+
tx,
148+
_pin: I::from(pin),
149+
}
147150
}
148151
}
149152

@@ -210,20 +213,18 @@ where
210213
/// // Do other stuff here...
211214
/// };
212215
///```
213-
pub struct Ws2812<P, SM, C, I>
216+
pub struct Ws2812<'timer, P, SM, I>
214217
where
215-
C: CountDown,
216218
I: AnyPin<Function = P::PinFunction>,
217219
P: PIOExt,
218220
SM: StateMachineIndex,
219221
{
220222
driver: Ws2812Direct<P, SM, I>,
221-
cd: C,
223+
cd: CountDown<'timer>,
222224
}
223225

224-
impl<P, SM, C, I> Ws2812<P, SM, C, I>
226+
impl<'timer, P, SM, I> Ws2812<'timer, P, SM, I>
225227
where
226-
C: CountDown,
227228
I: AnyPin<Function = P::PinFunction>,
228229
P: PIOExt,
229230
SM: StateMachineIndex,
@@ -234,15 +235,15 @@ where
234235
pio: &mut PIO<P>,
235236
sm: UninitStateMachine<(P, SM)>,
236237
clock_freq: fugit::HertzU32,
237-
cd: C,
238-
) -> Ws2812<P, SM, C, I> {
238+
cd: CountDown<'timer>,
239+
) -> Ws2812<'timer, P, SM, I> {
239240
let driver = Ws2812Direct::new(pin, pio, sm, clock_freq);
240241

241242
Self { driver, cd }
242243
}
243244
}
244245

245-
impl<'timer, P, SM, I> SmartLedsWrite for Ws2812<P, SM, rp2040_hal::timer::CountDown<'timer>, I>
246+
impl<'timer, P, SM, I> SmartLedsWrite for Ws2812<'timer, P, SM, I>
246247
where
247248
I: AnyPin<Function = P::PinFunction>,
248249
P: PIOExt,

0 commit comments

Comments
 (0)