Closed puzrin closed 3 years ago
These are currently passed in as constructor params?
Ah, sorry for buss.
The only note: https://github.com/Ralim/usb-pd/blob/main/lib/Inc/policy_engine.h#L43 first param seem to be generic driver (base driver class), not fusb.
Not sure what you mean by your note. At the moment it is the FUSB class (not a generic) as have not refactored for generic yet
Currently user has to create global functions to make library work:
That works, but a bit dirty. IMO it would be nice to pass such things as constructor params. The same about driver - it can be passed as policy engine param. That will be more clean & flexible than hardcoding/globals.
For example, anyone will be able to experiment with alternate drivers without intruding into library code.
PS. If you feel uncomfortable from multiple open issues i can close all those. I just post notes after code review, according to my experience, no mean to push you do something. Or i can suggest PRs and so on. Let me know about preferable way.