diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/usbh_driver_hid_mouse.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/usbh_driver_hid_mouse.c b/src/usbh_driver_hid_mouse.c index dc6ab84..0a575f2 100644 --- a/src/usbh_driver_hid_mouse.c +++ b/src/usbh_driver_hid_mouse.c @@ -56,11 +56,14 @@ static const hid_mouse_config_t *mouse_config; #include <stdint.h> - +static bool initialized = false; void hid_mouse_driver_init(const hid_mouse_config_t *config) { uint32_t i; + + initialized = true; + mouse_config = config; for (i = 0; i < USBH_HID_MOUSE_MAX_DEVICES; i++) { mouse_device[i].state_next = STATE_INACTIVE; @@ -73,6 +76,11 @@ void hid_mouse_driver_init(const hid_mouse_config_t *config) */ static void *init(void *usbh_dev) { + if (!initialized) { + LOG_PRINTF("\n%s/%d : driver not initialized\r\n", __FILE__, __LINE__); + return 0; + } + uint32_t i; hid_mouse_device_t *drvdata = 0; |