Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/internal/AsyncOp.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class AsyncOp: public LinkEntry {
*
* @note - the host object's lock MUST NOT be held when this call is made
*/
void wait(rtos::Mutex *host_mutex, uint32_t milliseconds = osWaitForever);
void wait(rtos::Mutex *host_mutex, rtos::Kernel::Clock::duration_u32 rel_time = rtos::Kernel::wait_for_u32_forever);

/**
* Abort this asynchronous operation
Expand Down
4 changes: 2 additions & 2 deletions drivers/source/usb/AsyncOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ AsyncOp::~AsyncOp()
MBED_ASSERT(_list == NULL);
}

void AsyncOp::wait(rtos::Mutex *host_mutex, uint32_t milliseconds)
void AsyncOp::wait(rtos::Mutex *host_mutex, rtos::Kernel::Clock::duration_u32 rel_time)
{
// Optimization so semaphore is only created if necessary
core_util_critical_section_enter();
Expand All @@ -63,7 +63,7 @@ void AsyncOp::wait(rtos::Mutex *host_mutex, uint32_t milliseconds)
return;
}

if (sem.try_acquire_for(milliseconds)) {
if (sem.try_acquire_for(rel_time)) {
// Operation completion signaled semaphore
return;
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/source/usb/USBMouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "ThisThread.h"
#include "usb_phy_api.h"

using namespace std::chrono_literals;

USBMouse::USBMouse(bool connect_blocking, MOUSE_TYPE mouse_type, uint16_t vendor_id, uint16_t product_id, uint16_t product_release):
USBHID(get_usb_phy(), 0, 0, vendor_id, product_id, product_release)
Expand Down Expand Up @@ -157,7 +158,7 @@ bool USBMouse::double_click()
_mutex.unlock();
return false;
}
rtos::ThisThread::sleep_for(100);
rtos::ThisThread::sleep_for(100ms);
bool ret = click(MOUSE_LEFT);

_mutex.unlock();
Expand All @@ -172,7 +173,7 @@ bool USBMouse::click(uint8_t button)
_mutex.unlock();
return false;
}
rtos::ThisThread::sleep_for(10);
rtos::ThisThread::sleep_for(10ms);
bool ret = update(0, 0, 0, 0);

_mutex.unlock();
Expand Down
6 changes: 4 additions & 2 deletions drivers/source/usb/USBMouseKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include "usb_phy_api.h"
#include "ThisThread.h"

using namespace std::chrono_literals;

typedef struct {
unsigned char usage;
unsigned char modifier;
Expand Down Expand Up @@ -709,7 +711,7 @@ bool USBMouseKeyboard::doubleClick()
_mutex.unlock();
return false;
}
rtos::ThisThread::sleep_for(100);
rtos::ThisThread::sleep_for(100ms);
bool ret = click(MOUSE_LEFT);

_mutex.unlock();
Expand All @@ -724,7 +726,7 @@ bool USBMouseKeyboard::click(uint8_t button)
_mutex.unlock();
return false;
}
rtos::ThisThread::sleep_for(10);
rtos::ThisThread::sleep_for(10ms);
bool ret = update(0, 0, 0, 0);

_mutex.unlock();
Expand Down