Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: M5Stack library version tracking #53

Closed
tobozo opened this issue Apr 18, 2018 · 2 comments
Closed

Feature request: M5Stack library version tracking #53

tobozo opened this issue Apr 18, 2018 · 2 comments

Comments

@tobozo
Copy link
Contributor

tobozo commented Apr 18, 2018

Hello,

In order to prevent conflicts and path problems with pre-existing libraries, may I suggest M5Stack is bundled with a variable that contains its own version?

Currently, if I have a M5 project using qrcode.h, it works fine with 0.1.6 but breaks with 0.1.7.
This is because M5 suddenly decided to embed a library that is not made for embedding.

Since there's no way to detect from the .ino sketch what version of M5Stack lib has been loaded in the Arduino IDE, doing so with 0.1.7 causes duplicate declarations errors,

This creates a situation where every M5 project using one of the new libs will break, or will have to maintain two codebases until the M5Stack 0.1.7 lands in the ESP32 environment.

In order to prevent such a SNAFU, M5 library should take care of the problem it created by giving the possibility to the developer or the compiler to avoid the breaking situation.

Suggested solution: "tattoo" all upcoming versions (including 0.1.7)

This could be done every time a new release is produced:

echo "#define M5_LIB_VERSION F(\"$(git describe --tags --always --dirty)\")" > gitTagVersion.h

and of course including it from somewhere in the stack:

#include <gitTagVersion.h>

so we can easily use something like this:

#ifdef M5_LIB_VERSION  // or any valid comparison
  #include "utilities/qrcode.h" // M5Stack 0.1.7
#else 
  #include "qrcode.h"   // M5Stack 0.1.6 and earlier
#endif 

and not being forced to maintain our project code every time M5 maintains its code :-)

@0x1abin
Copy link
Contributor

0x1abin commented Apr 19, 2018

Hi,
Thank you so much for your suggestion, and sorry for the inconvenience. I added the gitTagVersion in next version :-)

@tobozo
Copy link
Contributor Author

tobozo commented Apr 19, 2018

working well, thanks for the quick implementation 👍

@tobozo tobozo closed this as completed Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants