rework start screen to be shorter

This commit is contained in:
iceman1001 2022-02-26 17:17:14 +01:00
commit 652affbfb1
5 changed files with 218 additions and 3 deletions

View file

@ -53,6 +53,27 @@ void FormatVersionInformation(char *dst, int len, const char *prefix, void *vers
strncat(dst, v->armsrc, len - strlen(dst) - 1);
}
void format_version_information_short(char *dst, int len, void *version_info) {
struct version_information_t *v = (struct version_information_t *)version_info;
dst[0] = 0;
if (v->magic != VERSION_INFORMATION_MAGIC) {
strncat(dst, "Missing/Invalid version information", len - strlen(dst) - 1);
return;
}
if (v->versionversion != 1) {
strncat(dst, "Version information not understood", len - strlen(dst) - 1);
return;
}
if (!v->present) {
strncat(dst, "Version information not available", len - strlen(dst) - 1);
return;
}
strncat(dst, v->gitversion, len - strlen(dst) - 1);
strncat(dst, " ", len - strlen(dst) - 1);
strncat(dst, v->buildtime, len - strlen(dst) - 1);
}
/*
ref http://www.csm.ornl.gov/~dunigan/crc.html
Returns the value v with the bottom b [0,32] bits reflected.

View file

@ -51,6 +51,7 @@
extern struct version_information_t g_version_information;
void FormatVersionInformation(char *dst, int len, const char *prefix, void *version_info);
void format_version_information_short(char *dst, int len, void *version_info);
uint32_t reflect(uint32_t v, int b); // used in crc.c ...
uint8_t reflect8(uint8_t b); // dedicated 8bit reversal