@@ -169,22 +169,22 @@ pub trait StatefulOutputPin: OutputPin {
169
169
/// Is the pin in drive high mode?
170
170
///
171
171
/// *NOTE* this does *not* read the electrical state of the pin.
172
- fn is_set_high ( & self ) -> Result < bool , Self :: Error > ;
172
+ fn is_set_high ( & mut self ) -> Result < bool , Self :: Error > ;
173
173
174
174
/// Is the pin in drive low mode?
175
175
///
176
176
/// *NOTE* this does *not* read the electrical state of the pin.
177
- fn is_set_low ( & self ) -> Result < bool , Self :: Error > ;
177
+ fn is_set_low ( & mut self ) -> Result < bool , Self :: Error > ;
178
178
}
179
179
180
180
impl < T : StatefulOutputPin + ?Sized > StatefulOutputPin for & mut T {
181
181
#[ inline]
182
- fn is_set_high ( & self ) -> Result < bool , Self :: Error > {
182
+ fn is_set_high ( & mut self ) -> Result < bool , Self :: Error > {
183
183
T :: is_set_high ( self )
184
184
}
185
185
186
186
#[ inline]
187
- fn is_set_low ( & self ) -> Result < bool , Self :: Error > {
187
+ fn is_set_low ( & mut self ) -> Result < bool , Self :: Error > {
188
188
T :: is_set_low ( self )
189
189
}
190
190
}
@@ -205,20 +205,20 @@ impl<T: ToggleableOutputPin + ?Sized> ToggleableOutputPin for &mut T {
205
205
/// Single digital input pin.
206
206
pub trait InputPin : ErrorType {
207
207
/// Is the input pin high?
208
- fn is_high ( & self ) -> Result < bool , Self :: Error > ;
208
+ fn is_high ( & mut self ) -> Result < bool , Self :: Error > ;
209
209
210
210
/// Is the input pin low?
211
- fn is_low ( & self ) -> Result < bool , Self :: Error > ;
211
+ fn is_low ( & mut self ) -> Result < bool , Self :: Error > ;
212
212
}
213
213
214
- impl < T : InputPin + ?Sized > InputPin for & T {
214
+ impl < T : InputPin + ?Sized > InputPin for & mut T {
215
215
#[ inline]
216
- fn is_high ( & self ) -> Result < bool , Self :: Error > {
216
+ fn is_high ( & mut self ) -> Result < bool , Self :: Error > {
217
217
T :: is_high ( self )
218
218
}
219
219
220
220
#[ inline]
221
- fn is_low ( & self ) -> Result < bool , Self :: Error > {
221
+ fn is_low ( & mut self ) -> Result < bool , Self :: Error > {
222
222
T :: is_low ( self )
223
223
}
224
224
}
0 commit comments