@@ -91,14 +91,15 @@ pub enum PinState {
91
91
}
92
92
93
93
/// GPIO Pin speed selection
94
+ #[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
94
95
pub enum Speed {
95
96
Low = 0 ,
96
97
Medium = 1 ,
97
98
High = 2 ,
98
99
VeryHigh = 3 ,
99
100
}
100
101
101
- #[ derive( Debug , PartialEq ) ]
102
+ #[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
102
103
pub enum Edge {
103
104
RISING ,
104
105
FALLING ,
@@ -292,12 +293,14 @@ impl<MODE, const P: char> OutputPin for PXx<Output<MODE>, P> {
292
293
293
294
#[ inline( always) ]
294
295
fn set_high ( & mut self ) -> Result < ( ) , Self :: Error > {
295
- Ok ( self . set_high ( ) )
296
+ self . set_high ( ) ;
297
+ Ok ( ( ) )
296
298
}
297
299
298
300
#[ inline( always) ]
299
301
fn set_low ( & mut self ) -> Result < ( ) , Self :: Error > {
300
- Ok ( self . set_low ( ) )
302
+ self . set_low ( ) ;
303
+ Ok ( ( ) )
301
304
}
302
305
}
303
306
@@ -318,7 +321,8 @@ impl<MODE, const P: char> ToggleableOutputPin for PXx<Output<MODE>, P> {
318
321
319
322
#[ inline( always) ]
320
323
fn toggle ( & mut self ) -> Result < ( ) , Self :: Error > {
321
- Ok ( self . toggle ( ) )
324
+ self . toggle ( ) ;
325
+ Ok ( ( ) )
322
326
}
323
327
}
324
328
@@ -423,7 +427,7 @@ impl<MODE, const P: char, const N: u8> PinExt for PX<MODE, P, N> {
423
427
impl < MODE , const P : char , const N : u8 > PX < MODE , P , N > {
424
428
/// Configures the pin to operate alternate mode
425
429
pub fn into_alternate < const A : u8 > ( self ) -> PX < Alternate < AF < A > > , P , N > {
426
- #[ allow( path_statements) ]
430
+ #[ allow( path_statements, clippy :: no_effect ) ]
427
431
{
428
432
Assert :: < A , 16 > :: LESS ;
429
433
}
@@ -434,7 +438,7 @@ impl<MODE, const P: char, const N: u8> PX<MODE, P, N> {
434
438
/// Configures the pin to operate in alternate open drain mode
435
439
#[ allow( path_statements) ]
436
440
pub fn into_alternate_open_drain < const A : u8 > ( self ) -> PX < AlternateOD < AF < A > > , P , N > {
437
- #[ allow( path_statements) ]
441
+ #[ allow( path_statements, clippy :: no_effect ) ]
438
442
{
439
443
Assert :: < A , 16 > :: LESS ;
440
444
}
@@ -915,12 +919,14 @@ impl<MODE, const P: char, const N: u8> OutputPin for PX<Output<MODE>, P, N> {
915
919
916
920
#[ inline( always) ]
917
921
fn set_high ( & mut self ) -> Result < ( ) , Self :: Error > {
918
- Ok ( self . set_high ( ) )
922
+ self . set_high ( ) ;
923
+ Ok ( ( ) )
919
924
}
920
925
921
926
#[ inline( always) ]
922
927
fn set_low ( & mut self ) -> Result < ( ) , Self :: Error > {
923
- Ok ( self . set_low ( ) )
928
+ self . set_low ( ) ;
929
+ Ok ( ( ) )
924
930
}
925
931
}
926
932
@@ -941,7 +947,8 @@ impl<MODE, const P: char, const N: u8> ToggleableOutputPin for PX<Output<MODE>,
941
947
942
948
#[ inline( always) ]
943
949
fn toggle ( & mut self ) -> Result < ( ) , Self :: Error > {
944
- Ok ( self . toggle ( ) )
950
+ self . toggle ( ) ;
951
+ Ok ( ( ) )
945
952
}
946
953
}
947
954
@@ -1371,12 +1378,14 @@ impl<MODE> OutputPin for Pin<Output<MODE>> {
1371
1378
1372
1379
#[ inline( always) ]
1373
1380
fn set_high ( & mut self ) -> Result < ( ) , Self :: Error > {
1374
- Ok ( self . set_high ( ) )
1381
+ self . set_high ( ) ;
1382
+ Ok ( ( ) )
1375
1383
}
1376
1384
1377
1385
#[ inline( always) ]
1378
1386
fn set_low ( & mut self ) -> Result < ( ) , Self :: Error > {
1379
- Ok ( self . set_low ( ) )
1387
+ self . set_low ( ) ;
1388
+ Ok ( ( ) )
1380
1389
}
1381
1390
}
1382
1391
@@ -1397,7 +1406,8 @@ impl<MODE> ToggleableOutputPin for Pin<Output<MODE>> {
1397
1406
1398
1407
#[ inline( always) ]
1399
1408
fn toggle ( & mut self ) -> Result < ( ) , Self :: Error > {
1400
- Ok ( self . toggle ( ) )
1409
+ self . toggle ( ) ;
1410
+ Ok ( ( ) )
1401
1411
}
1402
1412
}
1403
1413
0 commit comments