@@ -119,6 +119,8 @@ pub mod size;
119119#[ doc( hidden) ]
120120pub mod test_helpers;
121121
122+ use core:: convert:: Infallible ;
123+
122124pub use crate :: i2c_interface:: I2CDisplayInterface ;
123125use crate :: mode:: BasicMode ;
124126use brightness:: Brightness ;
@@ -412,43 +414,43 @@ where
412414// SPI-only reset
413415impl < SPI , DC , SIZE , MODE > Ssd1306 < SPIInterfaceNoCS < SPI , DC > , SIZE , MODE > {
414416 /// Reset the display.
415- pub fn reset < RST , DELAY , PinE > (
417+ pub fn reset < RST , DELAY > (
416418 & mut self ,
417419 rst : & mut RST ,
418420 delay : & mut DELAY ,
419- ) -> Result < ( ) , Error < ( ) , PinE > >
421+ ) -> Result < ( ) , Error < Infallible , RST :: Error > >
420422 where
421- RST : OutputPin < Error = PinE > ,
423+ RST : OutputPin ,
422424 DELAY : DelayMs < u8 > ,
423425 {
424- inner_reset ( rst, delay)
426+ inner_reset ( rst, delay) . map_err ( Error :: Pin )
425427 }
426428}
427429
428430// SPI-only reset
429431impl < SPI , DC , CS , SIZE , MODE > Ssd1306 < SPIInterface < SPI , DC , CS > , SIZE , MODE > {
430432 /// Reset the display.
431- pub fn reset < RST , DELAY , PinE > (
433+ pub fn reset < RST , DELAY > (
432434 & mut self ,
433435 rst : & mut RST ,
434436 delay : & mut DELAY ,
435- ) -> Result < ( ) , Error < ( ) , PinE > >
437+ ) -> Result < ( ) , Error < Infallible , RST :: Error > >
436438 where
437- RST : OutputPin < Error = PinE > ,
439+ RST : OutputPin ,
438440 DELAY : DelayMs < u8 > ,
439441 {
440- inner_reset ( rst, delay)
442+ inner_reset ( rst, delay) . map_err ( Error :: Pin )
441443 }
442444}
443445
444- fn inner_reset < RST , DELAY , PinE > ( rst : & mut RST , delay : & mut DELAY ) -> Result < ( ) , Error < ( ) , PinE > >
446+ fn inner_reset < RST , DELAY > ( rst : & mut RST , delay : & mut DELAY ) -> Result < ( ) , RST :: Error >
445447where
446- RST : OutputPin < Error = PinE > ,
448+ RST : OutputPin ,
447449 DELAY : DelayMs < u8 > ,
448450{
449- rst. set_high ( ) . map_err ( Error :: Pin ) ?;
451+ rst. set_high ( ) ?;
450452 delay. delay_ms ( 1 ) ;
451- rst. set_low ( ) . map_err ( Error :: Pin ) ?;
453+ rst. set_low ( ) ?;
452454 delay. delay_ms ( 10 ) ;
453- rst. set_high ( ) . map_err ( Error :: Pin )
455+ rst. set_high ( )
454456}
0 commit comments