cherry-embedded / CherryUSB

CherryUSB is a tiny, beautiful and portable USB host and device stack for embedded system with USB IP
https://cherryusb.readthedocs.io/
Apache License 2.0
1.21k stars 256 forks source link

Version in project specific file? #226

Closed harbaum closed 1 month ago

harbaum commented 1 month ago

What's the idea behind putting the version and version string into the usb_config.h ?

These are imho to be handled in the projects and thus won't reflect the state of cherryusb.

Can the version please be moved into the charryusb main files? I can then do things like #if CHERRYUSB_VERSION > 0x010300 and the like.

sakumisu commented 1 month ago

You can include xxx_core.h and it inculdes usb_config.h. The reason why version is in usb_config is that anyone who wants to ask some questions and they do not use git, they should provide version and then i can know the changes, this version in usb_config is readonly.

harbaum commented 1 month ago

Yes. But a project like mine comes with it's own project specific usb_config.h and that won't necessarily match the cherryusb stack. E.g. here: https://github.com/harbaum/FPGA-Companion/blob/main/src/bl616/usb_config.h#L9

Without that compilation will fail due to: https://github.com/cherry-embedded/CherryUSB/blob/c766cbe91ec7e538995eddf6155e778ed0f5f1b0/core/usbh_core.c#L881

sakumisu commented 1 month ago

OK, i know, you use the older usb_config and latest stack, i only suggest you to sync your config.

harbaum commented 1 month ago

Ok, will do that.

sakumisu commented 3 weeks ago

Moved macros into usb_version.h