Open sterlinghughes opened 6 years ago
When constructing the version string, the firmware intentionally excludes the build ID if it is 0:
int
imgr_ver_str(struct image_version *ver, char *dst)
{
if (ver->iv_build_num) {
return sprintf(dst, "%u.%u.%u.%lu",
ver->iv_major, ver->iv_minor, ver->iv_revision,
(unsigned long)ver->iv_build_num);
} else {
return sprintf(dst, "%u.%u.%u",
ver->iv_major, ver->iv_minor, ver->iv_revision);
}
}
@mkiiskila , I know it has been a while, but do you recall the reason for doing this? Any reason it would be a bad idea to change this to always generate a uniform #.#.#.#
string?
On Apr 12, 2018, at 9:04 PM, ccollins476ad notifications@github.com wrote:
When constructing the version string, the firmware intentionally excludes the build ID if it is 0:
int imgr_ver_str(struct image_version ver, char dst) { if (ver->iv_build_num) { return sprintf(dst, "%u.%u.%u.%lu", ver->iv_major, ver->iv_minor, ver->iv_revision, (unsigned long)ver->iv_build_num); } else { return sprintf(dst, "%u.%u.%u", ver->iv_major, ver->iv_minor, ver->iv_revision); } } @mkiiskila https://github.com/mkiiskila , I know it has been a while, but do you recall the reason for doing this? Any reason it would be a bad idea to change this to always generate a uniform #.#.#.# string?
I assumed that not everyone will want to use build numbers within the versions, so I made it’s appearance here optional. Totally reversible decision. I doubt there’s anything which’ll break if ppl want to see the ‘0’ there in the end.
Hope this helps.
create-image split-microbit 0
andcreate-image split-microbit 0.0.0.0
both report 0.0.0but
create-image split-microbit 0.0.0.1
reports 0.0.0.1create-image split-microbit 1
reports 1.0.0In my mind this should always report four zeros.