Skip to content

Commit 8281836

Browse files
committed
USBHost: Silence unused variable warnings.
I removed the initialization of some variables which were never used to silence GCC warnings. One of them had me removing the following line from USBHostMouse::rxHandler(): int len = int_in->getLengthTransferred(); The variable len is never used again in this method and it doesn't appear that the int_in->getLengthTransferred() call has any side effects which would require this extraneous call to remain in the code.
1 parent ddb3fbe commit 8281836

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

libraries/USBHost/USBHostHID/USBHostMouse.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ bool USBHostMouse::connect() {
8282

8383
void USBHostMouse::rxHandler() {
8484
int len_listen = int_in->getSize();
85-
int len = int_in->getLengthTransferred();
8685

8786
if (onUpdate) {
8887
(*onUpdate)(report[0] & 0x07, report[1], report[2], report[3]);

libraries/USBHost/USBHostSerial/USBHostSerial.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ void USBHostSerial::format(int bits, Parity parity, int stop_bits) {
131131
line_coding.stop_bits = (stop_bits == 1) ? 0 : 2;
132132

133133
// set line coding
134-
int res = host->controlWrite( dev,
135-
USB_RECIPIENT_INTERFACE | USB_HOST_TO_DEVICE | USB_REQUEST_TYPE_CLASS,
136-
SET_LINE_CODING,
137-
0, serial_intf, (uint8_t *)&line_coding, 7);
134+
host->controlWrite( dev,
135+
USB_RECIPIENT_INTERFACE | USB_HOST_TO_DEVICE | USB_REQUEST_TYPE_CLASS,
136+
SET_LINE_CODING,
137+
0, serial_intf, (uint8_t *)&line_coding, 7);
138138
}
139139

140140
int USBHostSerial::_getc() {

0 commit comments

Comments
 (0)