[riot-notifications] [RIOT-OS/RIOT] usbus/hid_io: add missing header file, add RX callback function (#16689)

Nils Ollrogge notifications at github.com
Wed Aug 4 12:17:51 CEST 2021


@Ollrogge commented on this pull request.



> + */
+typedef struct {
+    usb_hid_io_cb_t cb;         /**< callback function to call */
+    void *arg;                  /**< argument to pass to callback function */
+} usb_hid_io_t;
+
+/**
+ * @brief Set USBUS HID IO RX callback
+ *
+ * @param[in]   usb_hid_io  usb_hid_io structure to use
+ */
+void usb_hid_io_set_rx_cb(usb_hid_io_t* usb_hid_io);
+
+/**
+ * @brief Write data to USB HID IN endpoint buffer
+ *

Just a general question: Why only check that buffer is null ? If I add this shouldn't I also add e.g. `assert(usbus)` in `usb_hid_io_init`? I gues any public function that gets passed a pointer should chechk that it is != NULL ?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16689#discussion_r682483625
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210804/bed0606e/attachment.htm>


More information about the notifications mailing list