summaryrefslogtreecommitdiffstats
path: root/firmware/usbstack/usb_class_driver.h
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2009-04-18 20:04:52 +0000
committerFrank Gevaerts <frank@gevaerts.be>2009-04-18 20:04:52 +0000
commitab09322b7acfa1667f3124612735ea83ce5342d5 (patch)
treec3b35f6bc62e95dfc7b1ac6840564f24e4bca557 /firmware/usbstack/usb_class_driver.h
parent8b6b46f3c47aa3772598b359b43e3efe1138e9e6 (diff)
downloadrockbox-ab09322b7acfa1667f3124612735ea83ce5342d5.tar.gz
rockbox-ab09322b7acfa1667f3124612735ea83ce5342d5.tar.bz2
rockbox-ab09322b7acfa1667f3124612735ea83ce5342d5.zip
Add a PACK_DESCRIPTOR macro to make the class drivers a bit more readable (FS#10145 by Tomer Shalev)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20733 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usbstack/usb_class_driver.h')
-rw-r--r--firmware/usbstack/usb_class_driver.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/usbstack/usb_class_driver.h b/firmware/usbstack/usb_class_driver.h
index 22b1c6888c..b51eb3e93f 100644
--- a/firmware/usbstack/usb_class_driver.h
+++ b/firmware/usbstack/usb_class_driver.h
@@ -85,4 +85,10 @@ struct usb_class_driver {
#endif
};
+#define PACK_DESCRIPTOR(dest, descriptor) \
+ do { \
+ memcpy(dest, &(descriptor), sizeof(descriptor)); \
+ dest += sizeof(descriptor); \
+ } while (0)
+
#endif