summaryrefslogtreecommitdiff
path: root/tinyusb/class
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-06-03 14:37:41 +0700
committerhathach <[email protected]>2013-06-03 14:37:41 +0700
commit52f18f37848615b9ebe8d749c16eea114b24f524 (patch)
tree8941fc7f468005afc4f681a6e69321dddae86004 /tinyusb/class
parentb527e6ec4a9d0b6ecad5a6ce74b27458d1cd24be (diff)
refractor device mouse main.c & tusbd_hid_mouse_send_report
Diffstat (limited to 'tinyusb/class')
-rw-r--r--tinyusb/class/hid_device.c7
-rw-r--r--tinyusb/class/hid_device.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/tinyusb/class/hid_device.c b/tinyusb/class/hid_device.c
index 6d4d46fc9..958d7489e 100644
--- a/tinyusb/class/hid_device.c
+++ b/tinyusb/class/hid_device.c
@@ -200,7 +200,7 @@ tusb_error_t tusbd_hid_keyboard_send_report(tusb_keyboard_report_t *p_kbd_report
#endif
#if TUSB_CFG_DEVICE_HID_MOUSE
-tusb_error_t tusb_hid_mouse_send(uint8_t buttons, int8_t x, int8_t y)
+tusb_error_t tusbd_hid_mouse_send_report(tusb_mouse_report_t *p_mouse_report)
{
// uint32_t start_time = systickGetSecondsActive();
// while (bMouseChanged) // TODO Block while previous key hasn't been sent - can use fifo to improve this
@@ -213,10 +213,7 @@ tusb_error_t tusb_hid_mouse_send(uint8_t buttons, int8_t x, int8_t y)
return TUSB_ERROR_FAILED;
}
- hid_mouse_report.buttons = buttons;
- hid_mouse_report.x = x;
- hid_mouse_report.y = y;
-
+ hid_mouse_report = *p_mouse_report;
bMouseChanged = true;
return TUSB_ERROR_NONE;
diff --git a/tinyusb/class/hid_device.h b/tinyusb/class/hid_device.h
index d3a87fb84..b4d980286 100644
--- a/tinyusb/class/hid_device.h
+++ b/tinyusb/class/hid_device.h
@@ -58,7 +58,7 @@
// KEYBOARD Application API
//--------------------------------------------------------------------+
tusb_error_t tusbd_hid_keyboard_send_report(tusb_keyboard_report_t *p_kbd_report);
-tusb_error_t tusbd_hid_mouse_send_report(uint8_t buttons, int8_t x, int8_t y);
+tusb_error_t tusbd_hid_mouse_send_report(tusb_mouse_report_t *p_mouse_report);
//--------------------------------------------------------------------+
// USBD-CLASS DRIVER API