sforkowany z mirror/meshtastic-firmware
use short version string on bootscreen
rodzic
f40c6f21d4
commit
218d841511
|
@ -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']}")
|
||||
|
|
|
@ -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']
|
||||
])
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue