@@ -102,7 +102,7 @@ impl<REG: Resettable + Writable> Reg<REG> {
102102 #[ inline( always) ]
103103 pub fn write < F > ( & self , f : F )
104104 where
105- F : FnOnce ( & mut REG :: Writer ) -> & mut REG :: Writer ,
105+ F : FnOnce ( & mut REG :: Writer ) -> & mut W < REG >
106106 {
107107 self . register . set (
108108 f ( & mut REG :: Writer :: from ( W {
@@ -124,7 +124,7 @@ where
124124 #[ inline( always) ]
125125 pub fn write_with_zero < F > ( & self , f : F )
126126 where
127- F : FnOnce ( & mut REG :: Writer ) -> & mut REG :: Writer ,
127+ F : FnOnce ( & mut REG :: Writer ) -> & mut W < REG >
128128 {
129129 self . register . set (
130130 ( * f ( & mut REG :: Writer :: from ( W {
@@ -157,7 +157,7 @@ impl<REG: Readable + Writable> Reg<REG> {
157157 #[ inline( always) ]
158158 pub fn modify < F > ( & self , f : F )
159159 where
160- for < ' w > F : FnOnce ( & REG :: Reader , & ' w mut REG :: Writer ) -> & ' w mut REG :: Writer ,
160+ for < ' w > F : FnOnce ( & REG :: Reader , & ' w mut REG :: Writer ) -> & ' w mut W < REG >
161161 {
162162 let bits = self . register . get ( ) ;
163163 self . register . set (
@@ -216,8 +216,9 @@ pub struct W<REG: RegisterSpec + ?Sized> {
216216impl < REG : RegisterSpec > W < REG > {
217217 /// Writes raw bits to the register.
218218 #[ inline( always) ]
219- pub unsafe fn bits ( & mut self , bits : REG :: Ux ) {
219+ pub unsafe fn bits ( & mut self , bits : REG :: Ux ) -> & mut Self {
220220 self . bits = bits;
221+ self
221222 }
222223}
223224
0 commit comments