versioning: tag must contain patch, minor & major

This commit is contained in:
Dario Röthlisberger 2017-10-09 11:19:07 +02:00 committed by Beat Küng
parent 3dd4454a87
commit 6abe198226
1 changed files with 11 additions and 3 deletions

View File

@ -119,11 +119,19 @@ uint32_t version_tag_to_number(const char *tag)
if (buffer >= 0) {
version[buffer_counter] = buffer;
buffer_counter++;
}
if (buffer_counter <= 0) {
firmware_type = 0x00;
}
version_number = ((uint8_t)version[0] << 8 * 3) |
((uint8_t)version[1] << 8 * 2) |
((uint8_t)version[2] << 8 * 1) | firmware_type;
if (buffer_counter == 3 || buffer_counter == 6) {
version_number = ((uint8_t)version[0] << 8 * 3) |
((uint8_t)version[1] << 8 * 2) |
((uint8_t)version[2] << 8 * 1) | firmware_type;
} else {
version_number = 0;
}
return version_number;
}