libopencm3/lib/usb
Andrey Smirnov 113e5c22e6 Change the way buffer for control requests data is allocated
Current way of having a globally, but weakly defined static buffer has
several shortcomings:
 - It forces user to have a certain "magic" byte array variable if
   they want to have a control buffer of different size.
 - Having a globally defined static array and a separate function to
   tell USB core about its size is error prone.
 - Its inner workings are not easily understandable form cursory look
   at API and one needs to go and look at the implementation code to
   connect all the pieces into a solid picture of how it works

This commit adds two parameters to 'usbd_init' call that allow user to
specify the pointer to the area of memory and a size of that memory
which would be used by the USB core to store the data received during
DATA stage of control requests. This approach, while further
complicating the prototype of 'usbd_init', provides user with more
flexibility allowing for any custom area of memory of any size to be
used as control buffer. It also forces user to provide both address
and memory size at the same time thus avoiding the possibility of user
redefining 'usbd_control_buffer', but not calling
'usbd_set_control_buffer_size' after that.
2013-04-25 17:24:27 -07:00
..
usb.c Change the way buffer for control requests data is allocated 2013-04-25 17:24:27 -07:00
usb_control.c Place generic USB header and source files into the documentation tree. 2013-04-19 10:26:01 +09:30
usb_f103.c Fix all warnings for stm32f1 lib. 2013-02-26 17:14:31 -08:00
usb_f107.c USB core updated for reentrance based on Christian Cier-Zniewski's branch 2012-09-13 10:43:35 -07:00
usb_f207.c USB core updated for reentrance based on Christian Cier-Zniewski's branch 2012-09-13 10:43:35 -07:00
usb_fx07_common.c USB core updated for reentrance based on Christian Cier-Zniewski's branch 2012-09-13 10:43:35 -07:00
usb_fx07_common.h USB core updated for reentrance based on Christian Cier-Zniewski's branch 2012-09-13 10:43:35 -07:00
usb_private.h Place generic USB header and source files into the documentation tree. 2013-04-19 10:26:01 +09:30
usb_standard.c Place generic USB header and source files into the documentation tree. 2013-04-19 10:26:01 +09:30