diff options
| author | hathach <[email protected]> | 2018-07-24 20:41:06 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-07-24 20:41:06 +0700 |
| commit | b370283174fbdb066bc662f8885956dbf947559b (patch) | |
| tree | b586774d3dccec53ec402242da369611570b7f1f | |
| parent | 17369cfda0f077c29eea1f7ab486d60167511f36 (diff) | |
rename tud_hid_mouse_busy to tud_hid_mouse_ready
| -rw-r--r-- | examples/device/nrf52840/src/main.c | 2 | ||||
| -rw-r--r-- | src/class/hid/hid_device.c | 9 | ||||
| -rw-r--r-- | src/class/hid/hid_device.h | 8 |
3 files changed, 7 insertions, 12 deletions
diff --git a/examples/device/nrf52840/src/main.c b/examples/device/nrf52840/src/main.c index b8f1674a7..000adb9dc 100644 --- a/examples/device/nrf52840/src/main.c +++ b/examples/device/nrf52840/src/main.c @@ -132,7 +132,7 @@ void usb_hid_task(void) /*------------- Mouse -------------*/ - // if ( !tud_hid_mouse_busy() ) + // if ( tud_hid_mouse_ready() ) // { // // Poll every 10ms // static tu_timeout_t tm = { .start = 0, .interval = 10 }; diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c index 9f54da34f..292024a61 100644 --- a/src/class/hid/hid_device.c +++ b/src/class/hid/hid_device.c @@ -173,14 +173,15 @@ bool tud_hid_keyboard_key_sequence(const char* str, uint32_t interval_ms) // MOUSE APPLICATION API
//--------------------------------------------------------------------+
#if CFG_TUD_HID_MOUSE
-bool tud_hid_mouse_busy(void)
+bool tud_hid_mouse_ready(void)
{
- return dcd_edpt_busy(TUD_OPT_RHPORT, _mse_itf.ep_in);
+ VERIFY( _mse_itf.ep_in != 0 );
+ return !dcd_edpt_busy(TUD_OPT_RHPORT, _mse_itf.ep_in);
}
-bool tud_hid_mouse_report(hid_mouse_report_t const *p_report)
+static bool hidd_mouse_report(hid_mouse_report_t const *p_report)
{
- VERIFY( tud_mounted() && !tud_hid_mouse_busy() );
+ VERIFY( tud_hid_mouse_ready() );
hidd_interface_t * p_hid = &_mse_itf;
memcpy(p_hid->report_buf, p_report, sizeof(hid_mouse_report_t));
diff --git a/src/class/hid/hid_device.h b/src/class/hid/hid_device.h index 76a59e13a..ba8a5a4a1 100644 --- a/src/class/hid/hid_device.h +++ b/src/class/hid/hid_device.h @@ -119,15 +119,9 @@ ATTR_WEAK void tud_hid_keyboard_set_report_cb(hid_report_type_t report_type, uin * \retval false if the interface is not busy meaning the stack successfully transferred data from/to host
* \note This function is primarily used for polling/waiting result after \ref tusbd_hid_mouse_send.
*/
-bool tud_hid_mouse_busy(void);
+bool tud_hid_mouse_ready(void);
-/** \brief Perform transfer queuing
- * \param[in,out] p_report Report data, if NULL, an empty report (all zeroes) is used
- * \returns true on success, false otherwise (not mounted or busy)
- */
-bool tud_hid_mouse_report(hid_mouse_report_t const *p_report);
bool tud_hid_mouse_data(uint8_t buttons, int8_t x, int8_t y, int8_t scroll, int8_t pan);
-
bool tud_hid_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan);
bool tud_hid_mouse_button_press(uint8_t buttons);
|
