bootloader: display fork version

This commit is contained in:
Raphael Coeffic
2021-05-23 19:09:42 +02:00
parent 20f5f3c4d1
commit f97843c746
5 changed files with 13 additions and 5 deletions
@@ -121,15 +121,19 @@ void extractFirmwareVersion(VersionTag* tag)
if (!vers || (vers[0] == 'n' && vers[1] == 'o')) { // "no version found"
memcpy(tag->flavour, "unknown", sizeof("unknown"));
tag->version = "unknown";
return;
}
// skip "opentx-"
vers += sizeof("opentx-") - 1;
tag->fork = vers;
// skip 'edgetx-' / 'opentx-'
vers += sizeof("edgetx-") - 1;
char* fl = tag->flavour;
while(*vers != '-')
*(fl++) = *(vers++);
// skip '-'
tag->version = ++vers;
}
@@ -72,6 +72,7 @@ struct VersionTag
{
char flavour[8];
const char* version;
const char* fork;
};
// Can be called right after openBinFile() to extract the version information
@@ -435,7 +435,6 @@ int main()
state = ST_FLASHING;
}
}
else if (state == ST_FLASHING) {
// commit to flashing
if (!unlocked && (memoryType == MEM_FLASH)) {