The use of globals in TinyUSB #773
mikemoretti3
started this conversation in
General
Replies: 1 comment 2 replies
-
Since I read C better than English, can you elaborate your issue with the actual project code
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
First off, I really like TinyUSB.
However, the architecture makes it somewhat difficult to not have to hack globals for stuff everywhere. It would've been so much better if it was a little more "object-oriented". E.g. maybe have a "context" with callback function pointers (that take the context as a parameter) and user data for each interface, and each configuration. It would make it easier to design an app that say has two cdc interfaces (or more than one of any class interface for that matter) that do something completely different and really should be separated code-wise, whereas right now there's one class task per class that has to loop through interface numbers and choose what to do.
Am I the only one that sees this as an issue? Maybe I'm looking at it wrong?
-m
Beta Was this translation helpful? Give feedback.
All reactions