diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2011-08-10 17:13:18 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2011-10-18 13:30:18 -0400 |
commit | d4e9573d41e6a6601ba3f680487dd548b23bf680 (patch) | |
tree | 4902cc1cf8c157cea3b584f2638526687c2c3e4a /libmaple/fsmc.h | |
parent | 00c5efa7b637ee6ef1878eb870eff140f2af94a8 (diff) | |
download | librambutan-d4e9573d41e6a6601ba3f680487dd548b23bf680.tar.gz librambutan-d4e9573d41e6a6601ba3f680487dd548b23bf680.zip |
usb: Clean up some globals with new struct usblib_dev.
Add struct usblib_dev (and USBLIB, a pointer to the singleton) to
usb.h. USBLIB contains the global state which is used by
functionality imported from usb_lib/.
Consolidating global state into USBLIB will make it easier to remove
later.
Initial fields in struct usblib_dev are endpoint interrupt callbacks,
a mask for what to handle in the low-priority USB interrupt, and
device state. These replace pEpInt_IN, pEpInt_OUT; wInterrupt_Mask;
and bDeviceState, respectively from usb_lib/, so remove their
declarations from usb_lib_globals.h accordingly. Also remove unused
SaveState declaration from usblib_globals.h. Move bDeviceState into
'state' field in usblib_dev. Device state type changes from
DEVICE_STATE to usb_dev_state, volatile gets dropped, and enumerators
get a 'USB_' prefix, but it's otherwise the same.
usb_lib/ expects pInformation to point to Device_Info,
pUser_Standard_Requests -> User_Standard_Requests, and
pProperty -> Device_Property.
Alter usb_init_usblib() to reflect these assumptions. Reorganize
usb_lib_globals.h to make these assumptions more apparent to the
reader.
Modify usb_init_usblib() to take endpoint callbacks as arguments;
update its caller in usb_cdcacm.c.
usb_lib/ defines pInformation, pProperty, and pUser_Standard_Requests
itself (in usb_init.c), but we have our own definitions (in usb.c).
Remove the duplicates from usb.c. Also remove EPindex and Device_Info
definitions from usb.c. Unused, and anyways already defined in
usb_lib/usb_init.c.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/fsmc.h')
0 files changed, 0 insertions, 0 deletions