Skip to content

Commit 08fd815

Browse files
Update hosted variant for e-h 1.0.0
1 parent 61c5d57 commit 08fd815

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/hosted.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
88
use embedded_hal as hal;
99

10-
use hal::blocking::spi::Write;
11-
use hal::spi::{Mode, Phase, Polarity};
10+
use hal::spi::{Mode, Phase, Polarity, SpiBus};
1211

1312
use core::marker::PhantomData;
1413

@@ -39,7 +38,7 @@ pub struct Ws2812<SPI, DEVICE = devices::Ws2812> {
3938

4039
impl<SPI, E> Ws2812<SPI>
4140
where
42-
SPI: Write<u8, Error = E>,
41+
SPI: SpiBus<u8, Error = E>,
4342
{
4443
/// Use ws2812 devices via spi
4544
///
@@ -60,7 +59,7 @@ where
6059

6160
impl<SPI, E> Ws2812<SPI, devices::Sk6812w>
6261
where
63-
SPI: Write<u8, Error = E>,
62+
SPI: SpiBus<u8, Error = E>,
6463
{
6564
/// Use sk6812w devices via spi
6665
///
@@ -83,7 +82,7 @@ where
8382

8483
impl<SPI, D, E> Ws2812<SPI, D>
8584
where
86-
SPI: Write<u8, Error = E>,
85+
SPI: SpiBus<u8, Error = E>,
8786
{
8887
/// Write a single byte for ws2812 devices
8988
fn write_byte(&mut self, mut data: u8) {
@@ -108,14 +107,14 @@ where
108107

109108
impl<SPI, E> SmartLedsWrite for Ws2812<SPI>
110109
where
111-
SPI: Write<u8, Error = E>,
110+
SPI: SpiBus<u8, Error = E>,
112111
{
113112
type Error = E;
114113
type Color = RGB8;
115114
/// Write all the items of an iterator to a ws2812 strip
116115
fn write<T, I>(&mut self, iterator: T) -> Result<(), E>
117116
where
118-
T: Iterator<Item = I>,
117+
T: IntoIterator<Item = I>,
119118
I: Into<Self::Color>,
120119
{
121120
for item in iterator {
@@ -130,14 +129,14 @@ where
130129

131130
impl<SPI, E> SmartLedsWrite for Ws2812<SPI, devices::Sk6812w>
132131
where
133-
SPI: Write<u8, Error = E>,
132+
SPI: SpiBus<u8, Error = E>,
134133
{
135134
type Error = E;
136135
type Color = RGBW<u8, u8>;
137-
/// Write all the items of an iterator to a sk6812w strip
136+
/// Write all the items of an iterator to a ws2812 strip
138137
fn write<T, I>(&mut self, iterator: T) -> Result<(), E>
139138
where
140-
T: Iterator<Item = I>,
139+
T: IntoIterator<Item = I>,
141140
I: Into<Self::Color>,
142141
{
143142
for item in iterator {

0 commit comments

Comments
 (0)