mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Kinetis:usbdev clean up ensuring proper use of HW.
Remove magic numbers from code, documented the use of undocumented bits. Remove comments and code that were not appropriate for this hardware. Removed ifdef that's that were always compiled and removed code blocks that were never compiled. Ensure proper access order to hardware. Per the reference manual: disable endpoints prior to configuring buffer descriptor, then enable endpoints Reorganize interrupt processing order to offload data after processing errors. Reorganize initialization so that there is a clear initialization phase, reset phase for both the hardware and software structures. By breaking the initialization into smaller pieces, the reset interrupt only resets the resources within the controller that should be reset. Rework suspend and resume logic so they perform properly Made attach and detach functions optional. As they do not make sense for a bus powered device. Ensured the calls to up_usbinitalize up_usbuninitalize do not violate the USB spec.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -66,6 +66,8 @@ struct usbotg_bdtentry_s
|
||||
struct usbdev_s;
|
||||
int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable);
|
||||
void kinetis_usbsuspend(FAR struct usbdev_s *dev, bool resume);
|
||||
#if defined(CONFIG_USBDEV_SELFPOWERED)
|
||||
void khci_usbattach(void);
|
||||
|
||||
void khci_usbdetach(void);
|
||||
#endif
|
||||
#endif /* __ARCH_ARM_SRC_KINETIS_KINETIS_USBOTG_H */
|
||||
|
||||
Reference in New Issue
Block a user