@@ -364,7 +364,7 @@ bool tud_usbtmc_start_bus_read()
364
364
case STATE_RCV :
365
365
break ;
366
366
default :
367
- TU_VERIFY ( false) ;
367
+ return false;
368
368
}
369
369
TU_VERIFY (usbd_edpt_xfer (usbtmc_state .rhport , usbtmc_state .ep_bulk_out , usbtmc_state .ep_bulk_out_buf , (uint16_t )usbtmc_state .ep_bulk_out_wMaxPacketSize ));
370
370
return true;
@@ -466,61 +466,60 @@ bool usbtmcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint
466
466
switch (usbtmc_state .state )
467
467
{
468
468
case STATE_IDLE :
469
- TU_VERIFY (xferred_bytes >= sizeof (usbtmc_msg_generic_t ));
470
- msg = (usbtmc_msg_generic_t * )(usbtmc_state .ep_bulk_out_buf );
471
- uint8_t invInvTag = (uint8_t )~(msg -> header .bTagInverse );
472
- TU_VERIFY (msg -> header .bTag == invInvTag );
473
- TU_VERIFY (msg -> header .bTag != 0x00 );
474
-
475
- switch (msg -> header .MsgID ) {
476
- case USBTMC_MSGID_DEV_DEP_MSG_OUT :
477
- if (!handle_devMsgOutStart (rhport , msg , xferred_bytes ))
478
- {
479
- usbd_edpt_stall (rhport , usbtmc_state .ep_bulk_out );
480
- TU_VERIFY (false);
481
- }
482
- break ;
469
+ {
470
+ TU_VERIFY (xferred_bytes >= sizeof (usbtmc_msg_generic_t ));
471
+ msg = (usbtmc_msg_generic_t * )(usbtmc_state .ep_bulk_out_buf );
472
+ uint8_t invInvTag = (uint8_t )~(msg -> header .bTagInverse );
473
+ TU_VERIFY (msg -> header .bTag == invInvTag );
474
+ TU_VERIFY (msg -> header .bTag != 0x00 );
475
+
476
+ switch (msg -> header .MsgID ) {
477
+ case USBTMC_MSGID_DEV_DEP_MSG_OUT :
478
+ if (!handle_devMsgOutStart (rhport , msg , xferred_bytes ))
479
+ {
480
+ usbd_edpt_stall (rhport , usbtmc_state .ep_bulk_out );
481
+ return false;
482
+ }
483
+ break ;
483
484
484
- case USBTMC_MSGID_DEV_DEP_MSG_IN :
485
- TU_VERIFY (handle_devMsgIn (msg , xferred_bytes ));
486
- break ;
485
+ case USBTMC_MSGID_DEV_DEP_MSG_IN :
486
+ TU_VERIFY (handle_devMsgIn (msg , xferred_bytes ));
487
+ break ;
487
488
488
489
#if (CFG_TUD_USBTMC_ENABLE_488 )
489
- case USBTMC_MSGID_USB488_TRIGGER :
490
- // Spec says we halt the EP if we didn't declare we support it.
491
- TU_VERIFY (usbtmc_state .capabilities -> bmIntfcCapabilities488 .supportsTrigger );
492
- TU_VERIFY (tud_usbtmc_msg_trigger_cb (msg ));
490
+ case USBTMC_MSGID_USB488_TRIGGER :
491
+ // Spec says we halt the EP if we didn't declare we support it.
492
+ TU_VERIFY (usbtmc_state .capabilities -> bmIntfcCapabilities488 .supportsTrigger );
493
+ TU_VERIFY (tud_usbtmc_msg_trigger_cb (msg ));
493
494
494
- break ;
495
+ break ;
495
496
#endif
496
- case USBTMC_MSGID_VENDOR_SPECIFIC_MSG_OUT :
497
- case USBTMC_MSGID_VENDOR_SPECIFIC_IN :
498
- default :
499
- usbd_edpt_stall (rhport , usbtmc_state .ep_bulk_out );
500
- TU_VERIFY (false);
501
- return false;
497
+ case USBTMC_MSGID_VENDOR_SPECIFIC_MSG_OUT :
498
+ case USBTMC_MSGID_VENDOR_SPECIFIC_IN :
499
+ default :
500
+ usbd_edpt_stall (rhport , usbtmc_state .ep_bulk_out );
501
+ return false;
502
+ }
503
+ return true;
502
504
}
503
- return true;
504
-
505
505
case STATE_RCV :
506
506
if (!handle_devMsgOut (rhport , usbtmc_state .ep_bulk_out_buf , xferred_bytes , xferred_bytes ))
507
507
{
508
508
usbd_edpt_stall (rhport , usbtmc_state .ep_bulk_out );
509
- TU_VERIFY ( false) ;
509
+ return false;
510
510
}
511
511
return true;
512
512
513
513
case STATE_ABORTING_BULK_OUT :
514
- TU_VERIFY (false);
515
- return false; // Should be stalled by now, shouldn't have received a packet.
514
+ return false;
516
515
517
516
case STATE_TX_REQUESTED :
518
517
case STATE_TX_INITIATED :
519
518
case STATE_ABORTING_BULK_IN :
520
519
case STATE_ABORTING_BULK_IN_SHORTED :
521
520
case STATE_ABORTING_BULK_IN_ABORTED :
522
521
default :
523
- TU_VERIFY ( false) ;
522
+ return false;
524
523
}
525
524
}
526
525
else if (ep_addr == usbtmc_state .ep_bulk_in )
@@ -569,7 +568,6 @@ bool usbtmcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint
569
568
570
569
default :
571
570
TU_ASSERT (false);
572
- return false;
573
571
}
574
572
}
575
573
else if (ep_addr == usbtmc_state .ep_int_in ) {
@@ -873,16 +871,13 @@ bool usbtmcd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request
873
871
case USB488_bREQUEST_LOCAL_LOCKOUT :
874
872
{
875
873
TU_VERIFY (request -> bmRequestType == 0xA1 ); // in,class,interface
876
- TU_VERIFY (false);
877
874
return false;
878
875
}
879
876
#endif
880
877
881
878
default :
882
- TU_VERIFY (false);
883
879
return false;
884
880
}
885
- TU_VERIFY (false);
886
881
}
887
882
888
883
#endif /* CFG_TUD_TSMC */
0 commit comments