From 4aa69b4eaf44757aa71997e4a59f0889ea6e23f4 Mon Sep 17 00:00:00 2001 From: Amir Hammad Date: Thu, 1 Sep 2016 14:16:17 +0200 Subject: make usbh_packet->data of union type out: const void * in: void * Signed-off-by: Amir Hammad --- include/driver/usbh_device_driver.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include/driver') 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 -- cgit