sparkfun / Arduino_Apollo3

Arduino core to support the Apollo3 microcontroller from Ambiq Micro
83 stars 39 forks source link

printing the version of the Arduino package of the board in a script #339

Closed jerabaul29 closed 2 years ago

jerabaul29 commented 3 years ago

For testing / "auditing" of boards with some code running on it, it would be very convenient to be able to print the version of the Arduino_Apollo3 core. Is this already possible / is there a way to / could you add a way to do something like this? Should be enough with a simple macro definition somewhere I think:

void setup(){
    Serial.begin(115200);
    delay(10);
    Serial.println(ARDUINO_APOLLO_CORE_VERSION);  // print the version of the core, for example 2.0.5
    Serial.println(ARDUINO_APOLLO_CORE_COMMIT);  // print the hash of the commit used by the core release version, from the https://github.com/sparkfun/Arduino_Apollo3 page
}

void loop(){

}
Wenn0101 commented 2 years ago

Realistically, I don't know if I am going to implement this feature.

These features always have a way of being forgotten during a release, causing new releases whose only content is updating the version number you forgot in the previous. This can be worked around with some automated tasks, but these have a way of cluttering up the commit history with minutia, something that I already fear is happening so much with the automated mbed core build pipeline.

I left this open thinking that I or someone on GitHub might come up with a more elegant process. but since it has been a year. I think it is safe to say this will likely not happen. Closing, but if you have a good idea for an implementation of this that works around these problems, feel free to comment back or submit a PR.