summaryrefslogtreecommitdiff
path: root/src/usbh_driver_hid_mouse.c
diff options
context:
space:
mode:
authorAmir Hammad <amir.hammad@hotmail.com>2015-04-08 08:04:27 +0200
committerAmir Hammad <amir.hammad@hotmail.com>2015-04-08 08:08:48 +0200
commit6625cda9f3eea899c41d1ee5b14913e691075e8a (patch)
tree22da81627a638523b00cb0e725963c1ab26ef777 /src/usbh_driver_hid_mouse.c
parentba197f8007901be20620935b614f68798dd23f26 (diff)
downloadsecure-hid-6625cda9f3eea899c41d1ee5b14913e691075e8a.tar.gz
secure-hid-6625cda9f3eea899c41d1ee5b14913e691075e8a.tar.bz2
secure-hid-6625cda9f3eea899c41d1ee5b14913e691075e8a.zip
Device drivers: Refactor: Move driver declaration to the end of file
forward declarations are not needed Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
Diffstat (limited to 'src/usbh_driver_hid_mouse.c')
-rw-r--r--src/usbh_driver_hid_mouse.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/src/usbh_driver_hid_mouse.c b/src/usbh_driver_hid_mouse.c
index 782cac5..0435138 100644
--- a/src/usbh_driver_hid_mouse.c
+++ b/src/usbh_driver_hid_mouse.c
@@ -27,30 +27,6 @@
#include <libopencm3/usb/usbstd.h>
-static void *mouse_init(void *usbh_dev);
-static bool mouse_analyze_descriptor(void *drvdata, void *descriptor);
-static void mouse_poll(void *drvdata, uint32_t time_curr_us);
-static void mouse_remove(void *drvdata);
-
-static const usbh_dev_driver_info_t usbh_hid_mouse_driver_info = {
- .deviceClass = -1,
- .deviceSubClass = -1,
- .deviceProtocol = -1,
- .idVendor = -1,
- .idProduct = -1,
- .ifaceClass = 0x03,
- .ifaceSubClass = -1,
- .ifaceProtocol = 0x02
-};
-
-const usbh_dev_driver_t usbh_hid_mouse_driver = {
- .init = mouse_init,
- .analyze_descriptor = mouse_analyze_descriptor,
- .poll = mouse_poll,
- .remove = mouse_remove,
- .info = &usbh_hid_mouse_driver_info
-};
-
enum STATES {
STATE_INACTIVE,
STATE_READING_COMPLETE,
@@ -292,3 +268,22 @@ static void mouse_remove(void *drvdata)
mouse->state_next = STATE_INACTIVE;
mouse->endpoint_in_address = 0;
}
+
+static const usbh_dev_driver_info_t usbh_hid_mouse_driver_info = {
+ .deviceClass = -1,
+ .deviceSubClass = -1,
+ .deviceProtocol = -1,
+ .idVendor = -1,
+ .idProduct = -1,
+ .ifaceClass = 0x03,
+ .ifaceSubClass = -1,
+ .ifaceProtocol = 0x02
+};
+
+const usbh_dev_driver_t usbh_hid_mouse_driver = {
+ .init = mouse_init,
+ .analyze_descriptor = mouse_analyze_descriptor,
+ .poll = mouse_poll,
+ .remove = mouse_remove,
+ .info = &usbh_hid_mouse_driver_info
+};