Skip to content

Commit 38a5685

Browse files
author
Cruz Monrreal
authored
Merge pull request #7233 from c1728p9/usb_cleanup
Fix various USB warnings
2 parents 4b8e340 + c4862c1 commit 38a5685

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

TESTS/usb_device/basic/USBTester.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@
4141

4242

4343
USBTester::USBTester(USBPhy *phy, uint16_t vendor_id, uint16_t product_id, uint16_t product_release):
44-
USBDevice(phy, vendor_id, product_id, product_release), reset_count(0), suspend_count(0),
45-
resume_count(0), interface_0_alt_set(NONE), interface_1_alt_set(NONE), configuration_set(NONE)
44+
USBDevice(phy, vendor_id, product_id, product_release), interface_0_alt_set(NONE),
45+
interface_1_alt_set(NONE), configuration_set(NONE), reset_count(0),
46+
suspend_count(0), resume_count(0)
4647
{
4748

4849
EndpointResolver resolver(endpoint_table());

TESTS/usb_device/basic/USBTester.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class USBTester: public USBDevice {
3838
*/
3939
USBTester(USBPhy *phy, uint16_t vendor_id, uint16_t product_id, uint16_t product_release);
4040

41-
~USBTester();
41+
virtual ~USBTester();
4242

4343
/*
4444
*

usb/device/USBAudio/USBAudio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ float USBAudio::get_volume()
342342
{
343343
lock();
344344

345-
float ret = _mute ? 0.0 : _volume;
345+
float ret = _mute ? 0.0f : _volume;
346346

347347
unlock();
348348
return ret;

usb/device/USBDevice/EndpointResolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ int EndpointResolver::next_index(usb_ep_type_t type, bool in_not_out)
122122
continue;
123123
}
124124

125-
if (shared && (1 << other)) {
125+
if (shared && (_used & (1 << other))) {
126126
// This endpoint can only be one direction at a time and is in
127127
// use by the other direction
128128
continue;

usb/device/USBHID/USBHID.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class USBHID::AsyncSend: public AsyncOp {
2626

2727
}
2828

29-
~AsyncSend()
29+
virtual ~AsyncSend()
3030
{
3131

3232
}
@@ -58,7 +58,7 @@ class USBHID::AsyncRead: public AsyncOp {
5858

5959
}
6060

61-
~AsyncRead()
61+
virtual ~AsyncRead()
6262
{
6363

6464
}
@@ -90,7 +90,7 @@ class USBHID::AsyncWait: public AsyncOp {
9090

9191
}
9292

93-
~AsyncWait()
93+
virtual ~AsyncWait()
9494
{
9595

9696
}

0 commit comments

Comments
 (0)