Skip to content

Commit 10c666e

Browse files
USB devices: avoid unnecessary floats
1 parent dfd03ed commit 10c666e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

usb/device/USBHID/USBMouse.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ bool USBMouse::double_click()
155155
_mutex.unlock();
156156
return false;
157157
}
158-
wait(0.1);
158+
wait_ms(100);
159159
bool ret = click(MOUSE_LEFT);
160160

161161
_mutex.unlock();
@@ -170,7 +170,7 @@ bool USBMouse::click(uint8_t button)
170170
_mutex.unlock();
171171
return false;
172172
}
173-
wait(0.01);
173+
wait_ms(10);
174174
bool ret = update(0, 0, 0, 0);
175175

176176
_mutex.unlock();

usb/device/USBHID/USBMouseKeyboard.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ bool USBMouseKeyboard::doubleClick()
707707
_mutex.unlock();
708708
return false;
709709
}
710-
wait(0.1);
710+
wait_ms(100);
711711
bool ret = click(MOUSE_LEFT);
712712

713713
_mutex.unlock();
@@ -722,7 +722,7 @@ bool USBMouseKeyboard::click(uint8_t button)
722722
_mutex.unlock();
723723
return false;
724724
}
725-
wait(0.01);
725+
wait_ms(10);
726726
bool ret = update(0, 0, 0, 0);
727727

728728
_mutex.unlock();

usb/device/targets/TARGET_NXP/USBHAL_LPC17.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ void USBPhyHw::init(USBPhyEvents *events)
409409
LPC_PINCON->PINSEL4 |= 0x00040000;
410410

411411
// Connect must be low for at least 2.5uS
412-
wait(0.3);
412+
wait_ms(300);
413413

414414
// Disable control endpoints
415415
SIEsetEndpointStatus(EP0IN, SIE_SES_DA);

0 commit comments

Comments
 (0)