@@ -38,11 +38,12 @@ impl<S: Syscalls, C: Config> Screen<S, C> {
3838 let called: Cell < Option < ( u32 , ) > > = Cell :: new ( None ) ;
3939 share:: scope ( |subscribe| {
4040 S :: subscribe :: < _ , _ , C , DRIVER_NUM , { subscribe:: WRITE } > ( subscribe, & called) ?;
41- let val = S :: command ( DRIVER_NUM , command:: SET_BRIGHTNESS , value as u32 , 0 ) . to_result ( ) ;
41+ S :: command ( DRIVER_NUM , command:: SET_BRIGHTNESS , value as u32 , 0 )
42+ . to_result :: < ( ) , _ > ( ) ?;
4243 loop {
4344 S :: yield_wait ( ) ;
4445 if let Some ( ( _, ) ) = called. get ( ) {
45- return val ;
46+ return Ok ( ( ) ) ;
4647 }
4748 }
4849 } )
@@ -53,11 +54,11 @@ impl<S: Syscalls, C: Config> Screen<S, C> {
5354 let called: Cell < Option < ( u32 , ) > > = Cell :: new ( None ) ;
5455 share:: scope ( |subscribe| {
5556 S :: subscribe :: < _ , _ , C , DRIVER_NUM , { subscribe:: WRITE } > ( subscribe, & called) ?;
56- let val = S :: command ( DRIVER_NUM , command:: SET_INVERT_ON , 0 , 0 ) . to_result ( ) ;
57+ S :: command ( DRIVER_NUM , command:: SET_INVERT_ON , 0 , 0 ) . to_result :: < ( ) , _ > ( ) ? ;
5758 loop {
5859 S :: yield_wait ( ) ;
5960 if let Some ( ( _, ) ) = called. get ( ) {
60- return val ;
61+ return Ok ( ( ) ) ;
6162 }
6263 }
6364 } )
@@ -68,11 +69,11 @@ impl<S: Syscalls, C: Config> Screen<S, C> {
6869 let called: Cell < Option < ( u32 , ) > > = Cell :: new ( None ) ;
6970 share:: scope ( |subscribe| {
7071 S :: subscribe :: < _ , _ , C , DRIVER_NUM , { subscribe:: WRITE } > ( subscribe, & called) ?;
71- let val = S :: command ( DRIVER_NUM , command:: SET_INVERT_OFF , 0 , 0 ) . to_result ( ) ;
72+ S :: command ( DRIVER_NUM , command:: SET_INVERT_OFF , 0 , 0 ) . to_result :: < ( ) , _ > ( ) ? ;
7273 loop {
7374 S :: yield_wait ( ) ;
7475 if let Some ( ( _, ) ) = called. get ( ) {
75- return val ;
76+ return Ok ( ( ) ) ;
7677 }
7778 }
7879 } )
@@ -119,6 +120,7 @@ impl<S: Syscalls, C: Config> Screen<S, C> {
119120 share:: scope ( |subscribe| {
120121 S :: subscribe :: < _ , _ , C , DRIVER_NUM , { subscribe:: WRITE } > ( subscribe, & called) ?;
121122 let val = S :: command ( DRIVER_NUM , command:: GET_ROTATION , 0 , 0 ) . to_result ( ) ;
123+ val?;
122124 loop {
123125 S :: yield_wait ( ) ;
124126 if let Some ( ( _, ) ) = called. get ( ) {
@@ -133,11 +135,12 @@ impl<S: Syscalls, C: Config> Screen<S, C> {
133135 let called: Cell < Option < ( u32 , ) > > = Cell :: new ( None ) ;
134136 share:: scope ( |subscribe| {
135137 S :: subscribe :: < _ , _ , C , DRIVER_NUM , { subscribe:: WRITE } > ( subscribe, & called) ?;
136- let val = S :: command ( DRIVER_NUM , command:: SET_ROTATION , rotation as u32 , 0 ) . to_result ( ) ;
138+ S :: command ( DRIVER_NUM , command:: SET_ROTATION , rotation as u32 , 0 )
139+ . to_result :: < ( ) , _ > ( ) ?;
137140 loop {
138141 S :: yield_wait ( ) ;
139142 if let Some ( ( _, ) ) = called. get ( ) {
140- return val ;
143+ return Ok ( ( ) ) ;
141144 }
142145 }
143146 } )
@@ -153,17 +156,17 @@ impl<S: Syscalls, C: Config> Screen<S, C> {
153156 let called: Cell < Option < ( u32 , ) > > = Cell :: new ( None ) ;
154157 share:: scope ( |subscribe| {
155158 S :: subscribe :: < _ , _ , C , DRIVER_NUM , { subscribe:: WRITE } > ( subscribe, & called) ?;
156- let val = S :: command (
159+ S :: command (
157160 DRIVER_NUM ,
158161 command:: SET_RESOLUTION ,
159162 width as u32 ,
160163 height as u32 ,
161164 )
162- . to_result ( ) ;
165+ . to_result :: < ( ) , _ > ( ) ? ;
163166 loop {
164167 S :: yield_wait ( ) ;
165168 if let Some ( ( _, ) ) = called. get ( ) {
166- return val ;
169+ return Ok ( ( ) ) ;
167170 }
168171 }
169172 } )
@@ -179,12 +182,12 @@ impl<S: Syscalls, C: Config> Screen<S, C> {
179182 let called: Cell < Option < ( u32 , ) > > = Cell :: new ( None ) ;
180183 share:: scope ( |subscribe| {
181184 S :: subscribe :: < _ , _ , C , DRIVER_NUM , { subscribe:: WRITE } > ( subscribe, & called) ?;
182- let val =
183- S :: command ( DRIVER_NUM , command :: SET_PIXEL_FORMAT , format as u32 , 0 ) . to_result ( ) ;
185+ S :: command ( DRIVER_NUM , command :: SET_PIXEL_FORMAT , format as u32 , 0 )
186+ . to_result :: < ( ) , _ > ( ) ? ;
184187 loop {
185188 S :: yield_wait ( ) ;
186189 if let Some ( ( _, ) ) = called. get ( ) {
187- return val ;
190+ return Ok ( ( ) ) ;
188191 }
189192 }
190193 } )
@@ -197,11 +200,11 @@ impl<S: Syscalls, C: Config> Screen<S, C> {
197200 let called: Cell < Option < ( u32 , ) > > = Cell :: new ( None ) ;
198201 share:: scope ( |subscribe| {
199202 S :: subscribe :: < _ , _ , C , DRIVER_NUM , { subscribe:: WRITE } > ( subscribe, & called) ?;
200- let val = S :: command ( DRIVER_NUM , command:: SET_WRITE_FRAME , data1, data2) . to_result ( ) ;
203+ S :: command ( DRIVER_NUM , command:: SET_WRITE_FRAME , data1, data2) . to_result :: < ( ) , _ > ( ) ? ;
201204 loop {
202205 S :: yield_wait ( ) ;
203206 if let Some ( ( _, ) ) = called. get ( ) {
204- return val ;
207+ return Ok ( ( ) ) ;
205208 }
206209 }
207210 } )
@@ -221,11 +224,11 @@ impl<S: Syscalls, C: Config> Screen<S, C> {
221224 let ( allow_ro, subscribe) = handle. split ( ) ;
222225 S :: allow_ro :: < C , DRIVER_NUM , { allow_ro:: WRITE_BUFFER_ID } > ( allow_ro, s) ?;
223226 S :: subscribe :: < _ , _ , C , DRIVER_NUM , { subscribe:: WRITE } > ( subscribe, & called) ?;
224- let val = S :: command ( DRIVER_NUM , command:: WRITE , s. len ( ) as u32 , 0 ) . to_result ( ) ;
227+ S :: command ( DRIVER_NUM , command:: WRITE , s. len ( ) as u32 , 0 ) . to_result :: < ( ) , _ > ( ) ? ;
225228 loop {
226229 S :: yield_wait ( ) ;
227230 if let Some ( ( _, ) ) = called. get ( ) {
228- return val ;
231+ return Ok ( ( ) ) ;
229232 }
230233 }
231234 } )
@@ -249,11 +252,11 @@ impl<S: Syscalls, C: Config> Screen<S, C> {
249252 let ( allow_ro, subscribe) = handle. split ( ) ;
250253 S :: allow_ro :: < C , DRIVER_NUM , { allow_ro:: WRITE_BUFFER_ID } > ( allow_ro, s) ?;
251254 S :: subscribe :: < _ , _ , C , DRIVER_NUM , { subscribe:: WRITE } > ( subscribe, & called) ?;
252- let val = S :: command ( DRIVER_NUM , command:: FILL , 0 , 0 ) . to_result ( ) ;
255+ S :: command ( DRIVER_NUM , command:: FILL , 0 , 0 ) . to_result :: < ( ) , _ > ( ) ? ;
253256 loop {
254257 S :: yield_wait ( ) ;
255258 if let Some ( ( _, ) ) = called. get ( ) {
256- return val ;
259+ return Ok ( ( ) ) ;
257260 }
258261 }
259262 } )
0 commit comments