use short version string on bootscreen

1.2-legacy
Kevin Hester 2021-05-03 09:50:06 +08:00
rodzic f40c6f21d4
commit 218d841511
4 zmienionych plików z 12 dodań i 10 usunięć

Wyświetl plik

@ -3,5 +3,5 @@ import configparser
from readprops import readProps
verStr = readProps('version.properties')
print(f"{verStr}")
verObj = readProps('version.properties')
print(f"{verObj['long']}")

Wyświetl plik

@ -9,11 +9,12 @@ from readprops import readProps
Import("projenv")
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
verStr = readProps(prefsLoc)
print("Using meshtastic platform-custom.py, firmare version " + verStr)
verObj = readProps(prefsLoc)
print("Using meshtastic platform-custom.py, firmare version " + verObj['long'])
# print("path is" + ','.join(sys.path))
# General options that are passed to the C and C++ compilers
projenv.Append(CCFLAGS=[
"-DAPP_VERSION=" + verStr
"-DAPP_VERSION=" + verObj['long'],
"-DAPP_VERSION_SHORT=" + verObj['short']
])

Wyświetl plik

@ -12,6 +12,8 @@ def readProps(prefsLoc):
config = configparser.RawConfigParser()
config.read(prefsLoc)
version = dict(config.items('VERSION'))
verObj = dict(short = "{}.{}.{}".format(version["major"], version["minor"], version["build"]),
long = "unset")
# Try to find current build SHA if if the workspace is clean. This could fail if git is not installed
try:
@ -23,14 +25,13 @@ def readProps(prefsLoc):
if isDirty:
# short for 'dirty', we want to keep our verstrings source for protobuf reasons
suffix = sha + "-d"
verStr = "{}.{}.{}.{}".format(
verObj['long'] = "{}.{}.{}.{}".format(
version["major"], version["minor"], version["build"], suffix)
except:
# print("Unexpected error:", sys.exc_info()[0])
# traceback.print_exc()
verStr = "{}.{}.{}".format(
version["major"], version["minor"], version["build"])
verObj['long'] = verObj['short']
# print("firmare version " + verStr)
return verStr
return verObj
# print("path is" + ','.join(sys.path))

Wyświetl plik

@ -130,7 +130,7 @@ static void drawIconScreen(const char *upperMsg, OLEDDisplay *display, OLEDDispl
// Draw version in upper right
char buf[16];
snprintf(buf, sizeof(buf), "%s",
xstr(APP_VERSION)); // Note: we don't bother printing region or now, it makes the string too long
xstr(APP_VERSION_SHORT)); // Note: we don't bother printing region or now, it makes the string too long
display->drawString(x + SCREEN_WIDTH - display->getStringWidth(buf), y + 0, buf);
screen->forceDisplay();