Commit b076077
committed
use switch for ctrl_transfer result check
This directly translates the Device.ctrl_transfer() result check
logic from its old if-statements to an equivalent switch-statement.
The point is to make it clear how each possible result code is
handled. Note that XFER_RESULT_FAILED and XFER_RESULT_TIMEOUT both
return 0 without generating any exception. (but also, tinyusb may
not actually use XFER_RESULT_TIMOUT if its comments are still
accurate)1 parent 05db6ee commit b076077
File tree
1 file changed
+14
-10
lines changed1 file changed
+14
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
387 | 392 | | |
388 | | - | |
389 | 393 | | |
390 | 394 | | |
391 | 395 | | |
| |||
0 commit comments