summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAmir Hammad <amir.hammad@hotmail.com>2016-09-01 14:16:17 +0200
committerAmir Hammad <amir.hammad@hotmail.com>2016-09-08 07:54:06 +0200
commit4aa69b4eaf44757aa71997e4a59f0889ea6e23f4 (patch)
tree27f495b1bd6e0e1569ee66275d21d25d1c13974f /include
parente0fbb799bd0dcf8592d08d6a8734e0afcb7e2b81 (diff)
downloadsecure-hid-4aa69b4eaf44757aa71997e4a59f0889ea6e23f4.tar.gz
secure-hid-4aa69b4eaf44757aa71997e4a59f0889ea6e23f4.tar.bz2
secure-hid-4aa69b4eaf44757aa71997e4a59f0889ea6e23f4.zip
make usbh_packet->data of union type
out: const void * in: void * Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/driver/usbh_device_driver.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/driver/usbh_device_driver.h b/include/driver/usbh_device_driver.h
index 6dd53c3..76e2619 100644
--- a/include/driver/usbh_device_driver.h
+++ b/include/driver/usbh_device_driver.h
@@ -129,7 +129,10 @@ typedef void (*usbh_packet_callback_t)(usbh_device_t *dev, usbh_packet_callback_
struct _usbh_packet {
/// pointer to data
- void *data;
+ union {
+ const void *out;
+ void *in;
+ } data;
/// length of the data (up to 1023)
uint16_t datalen;
@@ -234,8 +237,8 @@ void usbh_write(usbh_device_t *dev, const usbh_packet_t *packet);
/* Helper functions used by device drivers */
void device_xfer_control_read(void *data, uint16_t datalen, usbh_packet_callback_t callback, usbh_device_t *dev);
-void device_xfer_control_write_setup(void *data, uint16_t datalen, usbh_packet_callback_t callback, usbh_device_t *dev);
-void device_xfer_control_write_data(void *data, uint16_t datalen, usbh_packet_callback_t callback, usbh_device_t *dev);
+void device_xfer_control_write_setup(const void *data, uint16_t datalen, usbh_packet_callback_t callback, usbh_device_t *dev);
+void device_xfer_control_write_data(const void *data, uint16_t datalen, usbh_packet_callback_t callback, usbh_device_t *dev);
END_DECLS