File tree Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Original file line number Diff line number Diff line change 48
48
/// You may need to look at the datasheet and your own hal to verify this.
49
49
///
50
50
pub fn new ( spi : SPI ) -> Self {
51
- let data = if cfg ! ( feature = "mosi_idle_high" ) {
52
- vec ! [ 0 ; 140 ]
53
- } else {
54
- vec ! [ ]
55
- } ;
51
+ let data = vec ! [ 0 ; 140 ] ;
56
52
57
53
Self {
58
54
spi,
75
71
// The spi frequencies are just the limits, the available timing data isn't
76
72
// complete
77
73
pub fn new_sk6812w ( spi : SPI ) -> Self {
78
- let data = if cfg ! ( feature = "mosi_idle_high" ) {
79
- vec ! [ 0 ; 140 ]
80
- } else {
81
- vec ! [ ]
82
- } ;
74
+ let data = vec ! [ 0 ; 140 ] ;
83
75
84
76
Self {
85
77
spi,
@@ -109,11 +101,7 @@ where
109
101
fn send_data ( & mut self ) -> Result < ( ) , E > {
110
102
self . data . extend_from_slice ( & [ 0 ; 140 ] ) ;
111
103
self . spi . write ( & self . data ) ?;
112
- self . data . truncate ( if cfg ! ( feature = "mosi_idle_high" ) {
113
- 140
114
- } else {
115
- 0
116
- } ) ;
104
+ self . data . truncate ( 140 ) ;
117
105
Ok ( ( ) )
118
106
}
119
107
}
Original file line number Diff line number Diff line change 10
10
// Timings for ws2812 from https://cpldcpu.files.wordpress.com/2014/01/ws2812_timing_table.png
11
11
// Timings for sk6812 from https://cpldcpu.wordpress.com/2016/03/09/the-sk6812-another-intelligent-rgb-led/
12
12
13
- #![ no_std]
14
-
15
- #[ cfg( feature = "std" ) ]
16
- extern crate std;
13
+ #![ cfg_attr( not( feature = "std" ) , no_std) ]
17
14
18
15
use embedded_hal as hal;
19
16
You can’t perform that action at this time.
0 commit comments