@@ -68,7 +68,7 @@ where C: KeyColumns<CN>, R: KeyRows<RN> {
68
68
69
69
/// Return a 2-dimensional array of the last polled state of the matrix.
70
70
pub fn current_state ( & self ) -> [ [ bool ; RN ] ; CN ] {
71
- let mut state = [ [ false ; RN ] ; CN ] ; // default_arr::<bool, CN, RN>();
71
+ let mut state = [ [ false ; RN ] ; CN ] ;
72
72
for ( i, row) in self . state . iter ( ) . enumerate ( ) {
73
73
for ( j, & elem) in row. iter ( ) . enumerate ( ) {
74
74
if elem > self . debounce_count {
@@ -126,18 +126,20 @@ impl KeyColumns<$size> for $Type {
126
126
}
127
127
128
128
fn enable_column( & mut self , col: usize ) -> Result <( ) , ( ) > {
129
+ use embedded_hal:: digital:: v2:: OutputPin ;
129
130
match col {
130
131
$(
131
- $index => self . $col_name. set_low ( ) . map_err( drop) ,
132
+ $index => OutputPin :: set_low ( & mut self . $col_name) . map_err( drop) ,
132
133
) +
133
134
_ => unreachable!( )
134
135
}
135
136
}
136
137
137
138
fn disable_column( & mut self , col: usize ) -> Result <( ) , ( ) > {
139
+ use embedded_hal:: digital:: v2:: OutputPin ;
138
140
match col {
139
141
$(
140
- $index => self . $col_name. set_high ( ) . map_err( drop) ,
142
+ $index => OutputPin :: set_high ( & mut self . $col_name) . map_err( drop) ,
141
143
) +
142
144
_ => unreachable!( )
143
145
}
@@ -184,9 +186,10 @@ impl KeyRows<$size> for $Type {
184
186
}
185
187
186
188
fn read_row( & mut self , row: usize ) -> Result <bool , ( ) > {
189
+ use embedded_hal:: digital:: v2:: InputPin ;
187
190
match row {
188
191
$(
189
- $index => self . $row_name. is_low ( ) . map_err( drop) ,
192
+ $index => InputPin :: is_low ( & self . $row_name) . map_err( drop) ,
190
193
) +
191
194
_ => unreachable!( )
192
195
}
0 commit comments