File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -74,3 +74,35 @@ pub trait Wait: embedded_hal::digital::ErrorType {
7474 /// Wait for the pin to undergo any transition, i.e low to high OR high to low.
7575 fn wait_for_any_edge < ' a > ( & ' a mut self ) -> Self :: WaitForAnyEdgeFuture < ' a > ;
7676}
77+
78+ impl < T : Wait > Wait for & mut T {
79+ type WaitForHighFuture < ' a > = T :: WaitForHighFuture < ' a > where Self : ' a ;
80+
81+ fn wait_for_high < ' a > ( & ' a mut self ) -> Self :: WaitForHighFuture < ' a > {
82+ T :: wait_for_high ( self )
83+ }
84+
85+ type WaitForLowFuture < ' a > = T :: WaitForLowFuture < ' a > where Self : ' a ;
86+
87+ fn wait_for_low < ' a > ( & ' a mut self ) -> Self :: WaitForLowFuture < ' a > {
88+ T :: wait_for_low ( self )
89+ }
90+
91+ type WaitForRisingEdgeFuture < ' a > = T :: WaitForRisingEdgeFuture < ' a > where Self : ' a ;
92+
93+ fn wait_for_rising_edge < ' a > ( & ' a mut self ) -> Self :: WaitForRisingEdgeFuture < ' a > {
94+ T :: wait_for_rising_edge ( self )
95+ }
96+
97+ type WaitForFallingEdgeFuture < ' a > = T :: WaitForFallingEdgeFuture < ' a > where Self : ' a ;
98+
99+ fn wait_for_falling_edge < ' a > ( & ' a mut self ) -> Self :: WaitForFallingEdgeFuture < ' a > {
100+ T :: wait_for_falling_edge ( self )
101+ }
102+
103+ type WaitForAnyEdgeFuture < ' a > = T :: WaitForAnyEdgeFuture < ' a > where Self : ' a ;
104+
105+ fn wait_for_any_edge < ' a > ( & ' a mut self ) -> Self :: WaitForAnyEdgeFuture < ' a > {
106+ T :: wait_for_any_edge ( self )
107+ }
108+ }
You can’t perform that action at this time.
0 commit comments