mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-12 08:02:04 +00:00
use short version string on bootscreen
This commit is contained in:
parent
f40c6f21d4
commit
218d841511
@ -3,5 +3,5 @@ import configparser
|
|||||||
from readprops import readProps
|
from readprops import readProps
|
||||||
|
|
||||||
|
|
||||||
verStr = readProps('version.properties')
|
verObj = readProps('version.properties')
|
||||||
print(f"{verStr}")
|
print(f"{verObj['long']}")
|
||||||
|
@ -9,11 +9,12 @@ from readprops import readProps
|
|||||||
Import("projenv")
|
Import("projenv")
|
||||||
|
|
||||||
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
|
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
|
||||||
verStr = readProps(prefsLoc)
|
verObj = readProps(prefsLoc)
|
||||||
print("Using meshtastic platform-custom.py, firmare version " + verStr)
|
print("Using meshtastic platform-custom.py, firmare version " + verObj['long'])
|
||||||
# print("path is" + ','.join(sys.path))
|
# print("path is" + ','.join(sys.path))
|
||||||
|
|
||||||
# General options that are passed to the C and C++ compilers
|
# General options that are passed to the C and C++ compilers
|
||||||
projenv.Append(CCFLAGS=[
|
projenv.Append(CCFLAGS=[
|
||||||
"-DAPP_VERSION=" + verStr
|
"-DAPP_VERSION=" + verObj['long'],
|
||||||
|
"-DAPP_VERSION_SHORT=" + verObj['short']
|
||||||
])
|
])
|
||||||
|
@ -12,6 +12,8 @@ def readProps(prefsLoc):
|
|||||||
config = configparser.RawConfigParser()
|
config = configparser.RawConfigParser()
|
||||||
config.read(prefsLoc)
|
config.read(prefsLoc)
|
||||||
version = dict(config.items('VERSION'))
|
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 to find current build SHA if if the workspace is clean. This could fail if git is not installed
|
||||||
try:
|
try:
|
||||||
@ -23,14 +25,13 @@ def readProps(prefsLoc):
|
|||||||
if isDirty:
|
if isDirty:
|
||||||
# short for 'dirty', we want to keep our verstrings source for protobuf reasons
|
# short for 'dirty', we want to keep our verstrings source for protobuf reasons
|
||||||
suffix = sha + "-d"
|
suffix = sha + "-d"
|
||||||
verStr = "{}.{}.{}.{}".format(
|
verObj['long'] = "{}.{}.{}.{}".format(
|
||||||
version["major"], version["minor"], version["build"], suffix)
|
version["major"], version["minor"], version["build"], suffix)
|
||||||
except:
|
except:
|
||||||
# print("Unexpected error:", sys.exc_info()[0])
|
# print("Unexpected error:", sys.exc_info()[0])
|
||||||
# traceback.print_exc()
|
# traceback.print_exc()
|
||||||
verStr = "{}.{}.{}".format(
|
verObj['long'] = verObj['short']
|
||||||
version["major"], version["minor"], version["build"])
|
|
||||||
|
|
||||||
# print("firmare version " + verStr)
|
# print("firmare version " + verStr)
|
||||||
return verStr
|
return verObj
|
||||||
# print("path is" + ','.join(sys.path))
|
# print("path is" + ','.join(sys.path))
|
||||||
|
@ -130,7 +130,7 @@ static void drawIconScreen(const char *upperMsg, OLEDDisplay *display, OLEDDispl
|
|||||||
// Draw version in upper right
|
// Draw version in upper right
|
||||||
char buf[16];
|
char buf[16];
|
||||||
snprintf(buf, sizeof(buf), "%s",
|
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);
|
display->drawString(x + SCREEN_WIDTH - display->getStringWidth(buf), y + 0, buf);
|
||||||
screen->forceDisplay();
|
screen->forceDisplay();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user