Skip to content

Commit 222c7e5

Browse files
committed
some compile fixes
1 parent 50fc4c9 commit 222c7e5

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

esp-hal-smartled/src/lib.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@ impl From<RmtError> for LedAdapterError {
6262

6363
fn led_pulses_for_clock(src_clock: u32) -> (u32, u32) {
6464
(
65-
u32::from(PulseCode {
66-
level1: true,
67-
length1: ((SK68XX_T0H_NS * src_clock) / 1000) as u16,
68-
level2: false,
69-
length2: ((SK68XX_T0L_NS * src_clock) / 1000) as u16,
70-
}),
71-
u32::from(PulseCode {
72-
level1: true,
73-
length1: ((SK68XX_T1H_NS * src_clock) / 1000) as u16,
74-
level2: false,
75-
length2: ((SK68XX_T1L_NS * src_clock) / 1000) as u16,
76-
}),
65+
PulseCode::new(
66+
true,
67+
((SK68XX_T0H_NS * src_clock) / 1000) as u16,
68+
false,
69+
((SK68XX_T0L_NS * src_clock) / 1000) as u16,
70+
),
71+
PulseCode::new(
72+
true,
73+
((SK68XX_T1H_NS * src_clock) / 1000) as u16,
74+
false,
75+
((SK68XX_T1L_NS * src_clock) / 1000) as u16,
76+
),
7777
)
7878
}
7979

@@ -229,9 +229,9 @@ pub mod asynch {
229229
use super::*;
230230
use esp_hal::{
231231
clock::Clocks,
232-
gpio::PeripheralOutput,
232+
gpio::OutputPin,
233233
peripheral::Peripheral,
234-
rmt::{asynch::TxChannelAsync, TxChannelCreatorAsync},
234+
rmt::{TxChannelAsync, TxChannelCreatorAsync},
235235
};
236236

237237
/// Function to calculate the required RMT buffer size for a given number of LEDs when using
@@ -257,7 +257,7 @@ pub mod asynch {
257257
rmt_buffer: [u32; BUFFER_SIZE],
258258
) -> SmartLedAdapterAsync<Tx, BUFFER_SIZE>
259259
where
260-
O: PeripheralOutput + 'd,
260+
O: OutputPin + 'd,
261261
C: TxChannelCreatorAsync<'d, Tx, O>,
262262
{
263263
let channel = channel.configure(pin, led_config()).unwrap();

0 commit comments

Comments
 (0)