Skip to content

Commit 712fb1c

Browse files
fkjagodzinskic1728p9
authored andcommitted
Tests: USB: Update ep callbacks
Endpoint callbacks no longer have endpoint as a param. This update was introduced in #7267.
1 parent ed2361c commit 712fb1c

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

TESTS/usb_device/basic/USBEndpointTester.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,10 @@ const uint8_t *USBEndpointTester::configuration_desc(uint8_t index)
684684
}
685685
}
686686

687-
void USBEndpointTester::_cb_bulk_out(usb_ep_t endpoint)
687+
void USBEndpointTester::_cb_bulk_out()
688688
{
689689
_cnt_cb_bulk_out++;
690-
uint32_t rx_size = read_finish(endpoint);
690+
uint32_t rx_size = read_finish(_endpoints[EP_BULK_OUT]);
691691

692692
if (_abort_transfer_test == false) {
693693
// Send data back to host using the IN endpoint.
@@ -699,15 +699,15 @@ void USBEndpointTester::_cb_bulk_out(usb_ep_t endpoint)
699699
_num_packets_bulk_out_abort++;
700700
read_start(_endpoints[EP_BULK_OUT], _endpoint_buffs[EP_BULK_OUT], (*_endpoint_configs)[EP_BULK_OUT].max_packet);
701701
if (_num_packets_bulk_out_abort == NUM_PACKETS_UNTIL_ABORT) {
702-
endpoint_abort(endpoint);
702+
endpoint_abort(_endpoints[EP_BULK_OUT]);
703703
}
704704
}
705705
}
706706

707-
void USBEndpointTester::_cb_bulk_in(usb_ep_t endpoint)
707+
void USBEndpointTester::_cb_bulk_in()
708708
{
709709
_cnt_cb_bulk_in++;
710-
write_finish(endpoint);
710+
write_finish(_endpoints[EP_BULK_IN]);
711711

712712
if (_abort_transfer_test == false) {
713713
// Receive more data from the host using the OUT endpoint.
@@ -721,15 +721,15 @@ void USBEndpointTester::_cb_bulk_in(usb_ep_t endpoint)
721721
memset(_endpoint_buffs[EP_BULK_IN], _num_packets_bulk_in_abort, (*_endpoint_configs)[EP_BULK_IN].max_packet);
722722
write_start(_endpoints[EP_BULK_IN], _endpoint_buffs[EP_BULK_IN], (*_endpoint_configs)[EP_BULK_IN].max_packet);
723723
if (_num_packets_bulk_in_abort == NUM_PACKETS_UNTIL_ABORT) {
724-
endpoint_abort(endpoint);
724+
endpoint_abort(_endpoints[EP_BULK_IN]);
725725
}
726726
}
727727
}
728728

729-
void USBEndpointTester::_cb_int_out(usb_ep_t endpoint)
729+
void USBEndpointTester::_cb_int_out()
730730
{
731731
_cnt_cb_int_out++;
732-
uint32_t rx_size = read_finish(endpoint);
732+
uint32_t rx_size = read_finish(_endpoints[EP_INT_OUT]);
733733
if (_abort_transfer_test == false) {
734734
// Send data back to host using the IN endpoint.
735735
memset(_endpoint_buffs[EP_INT_IN], 0, (*_endpoint_configs)[EP_INT_IN].max_packet);
@@ -740,15 +740,15 @@ void USBEndpointTester::_cb_int_out(usb_ep_t endpoint)
740740
_num_packets_int_out_abort++;
741741
read_start(_endpoints[EP_INT_OUT], _endpoint_buffs[EP_INT_OUT], (*_endpoint_configs)[EP_INT_OUT].max_packet);
742742
if (_num_packets_int_out_abort == NUM_PACKETS_UNTIL_ABORT) {
743-
endpoint_abort(endpoint);
743+
endpoint_abort(_endpoints[EP_INT_OUT]);
744744
}
745745
}
746746
}
747747

748-
void USBEndpointTester::_cb_int_in(usb_ep_t endpoint)
748+
void USBEndpointTester::_cb_int_in()
749749
{
750750
_cnt_cb_int_in++;
751-
write_finish(endpoint);
751+
write_finish(_endpoints[EP_INT_IN]);
752752
if (_abort_transfer_test == false) {
753753
// Receive more data from the host using the OUT endpoint.
754754
read_start(_endpoints[EP_INT_OUT], _endpoint_buffs[EP_INT_OUT], (*_endpoint_configs)[EP_INT_OUT].max_packet);
@@ -761,25 +761,25 @@ void USBEndpointTester::_cb_int_in(usb_ep_t endpoint)
761761
memset(_endpoint_buffs[EP_INT_IN], _num_packets_int_in_abort, (*_endpoint_configs)[EP_INT_IN].max_packet);
762762
write_start(_endpoints[EP_INT_IN], _endpoint_buffs[EP_INT_IN], (*_endpoint_configs)[EP_INT_IN].max_packet);
763763
if (_num_packets_int_in_abort == NUM_PACKETS_UNTIL_ABORT) {
764-
endpoint_abort(endpoint);
764+
endpoint_abort(_endpoints[EP_INT_IN]);
765765
}
766766
}
767767
}
768768

769-
void USBEndpointTester::_cb_iso_out(usb_ep_t endpoint)
769+
void USBEndpointTester::_cb_iso_out()
770770
{
771771
_cnt_cb_iso_out++;
772-
uint32_t rx_size = read_finish(endpoint);
772+
uint32_t rx_size = read_finish(_endpoints[EP_ISO_OUT]);
773773
// Send data back to host using the IN endpoint.
774774
memset(_endpoint_buffs[EP_ISO_IN], 0, (*_endpoint_configs)[EP_ISO_IN].max_packet);
775775
memcpy(_endpoint_buffs[EP_ISO_IN], _endpoint_buffs[EP_ISO_OUT], rx_size);
776776
write_start(_endpoints[EP_ISO_IN], _endpoint_buffs[EP_ISO_IN], rx_size);
777777
}
778778

779-
void USBEndpointTester::_cb_iso_in(usb_ep_t endpoint)
779+
void USBEndpointTester::_cb_iso_in()
780780
{
781781
_cnt_cb_iso_in++;
782-
write_finish(endpoint);
782+
write_finish(_endpoints[EP_ISO_IN]);
783783
// Receive more data from the host using the OUT endpoint.
784784
read_start(_endpoints[EP_ISO_OUT], _endpoint_buffs[EP_ISO_OUT], (*_endpoint_configs)[EP_ISO_OUT].max_packet);
785785
}

TESTS/usb_device/basic/USBEndpointTester.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class USBEndpointTester: public USBDevice {
3333
public:
3434
USBEndpointTester(USBPhy *phy, uint16_t vendor_id, uint16_t product_id, uint16_t product_release,
3535
bool abort_transfer_test);
36-
~USBEndpointTester();
36+
virtual ~USBEndpointTester();
3737
const char *get_serial_desc_string();
3838
void start_ep_in_abort_test();
3939

@@ -94,12 +94,12 @@ class USBEndpointTester: public USBDevice {
9494
void _setup_non_zero_endpoints();
9595
bool _setup_interface(uint16_t interface, uint8_t alternate);
9696

97-
virtual void _cb_bulk_out(usb_ep_t endpoint);
98-
virtual void _cb_bulk_in(usb_ep_t endpoint);
99-
virtual void _cb_int_out(usb_ep_t endpoint);
100-
virtual void _cb_int_in(usb_ep_t endpoint);
101-
virtual void _cb_iso_out(usb_ep_t endpoint);
102-
virtual void _cb_iso_in(usb_ep_t endpoint);
97+
virtual void _cb_bulk_out();
98+
virtual void _cb_bulk_in();
99+
virtual void _cb_int_out();
100+
virtual void _cb_int_in();
101+
virtual void _cb_iso_out();
102+
virtual void _cb_iso_in();
103103

104104
private:
105105
const char *get_desc_string(const uint8_t *desc);

0 commit comments

Comments
 (0)