Skip to content

Commit 6919355

Browse files
authored
Merge pull request #558 from jvaque/master
Fix compilation warning on sleep_for
2 parents 67166f8 + e9ed8ce commit 6919355

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

libraries/USBHID/src/USBMouse.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "usb_phy_api.h"
2222

2323
using namespace arduino;
24+
using namespace std::chrono_literals;
2425

2526
USBMouse::USBMouse(bool connect_blocking, MOUSE_TYPE mouse_type, uint16_t vendor_id, uint16_t product_id, uint16_t product_release):
2627
USBHID(get_usb_phy(), 0, 0, vendor_id, product_id, product_release)
@@ -149,7 +150,7 @@ bool USBMouse::double_click()
149150
_mutex.unlock();
150151
return false;
151152
}
152-
rtos::ThisThread::sleep_for(100);
153+
rtos::ThisThread::sleep_for(100ms);
153154
bool ret = click(MOUSE_LEFT);
154155

155156
_mutex.unlock();
@@ -164,7 +165,7 @@ bool USBMouse::click(uint8_t button)
164165
_mutex.unlock();
165166
return false;
166167
}
167-
rtos::ThisThread::sleep_for(10);
168+
rtos::ThisThread::sleep_for(10ms);
168169
bool ret = update(0, 0, 0, 0);
169170

170171
_mutex.unlock();

libraries/USBHID/src/USBMouseKeyboard.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "ThisThread.h"
2222

2323
using namespace arduino;
24+
using namespace std::chrono_literals;
2425

2526
typedef struct {
2627
unsigned char usage;
@@ -703,7 +704,7 @@ bool USBMouseKeyboard::doubleClick()
703704
_mutex.unlock();
704705
return false;
705706
}
706-
rtos::ThisThread::sleep_for(100);
707+
rtos::ThisThread::sleep_for(100ms);
707708
bool ret = click(MOUSE_LEFT);
708709

709710
_mutex.unlock();
@@ -718,7 +719,7 @@ bool USBMouseKeyboard::click(uint8_t button)
718719
_mutex.unlock();
719720
return false;
720721
}
721-
rtos::ThisThread::sleep_for(10);
722+
rtos::ThisThread::sleep_for(10ms);
722723
bool ret = update(0, 0, 0, 0);
723724

724725
_mutex.unlock();

0 commit comments

Comments
 (0)