summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-07-24 20:41:06 +0700
committerhathach <[email protected]>2018-07-24 20:41:06 +0700
commitb370283174fbdb066bc662f8885956dbf947559b (patch)
treeb586774d3dccec53ec402242da369611570b7f1f /src
parent17369cfda0f077c29eea1f7ab486d60167511f36 (diff)
rename tud_hid_mouse_busy to tud_hid_mouse_ready
Diffstat (limited to 'src')
-rw-r--r--src/class/hid/hid_device.c9
-rw-r--r--src/class/hid/hid_device.h8
2 files changed, 6 insertions, 11 deletions
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);