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.
parent
3f4d0967
Please register or sign in to comment