mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-14 14:33:07 +01:00
Add display library version info to page system
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#define BOARDINFO STRINGIZE(BOARD)
|
||||
#define PCBINFO STRINGIZE(PCBVERS)
|
||||
#define DISPLAYINFO STRINGIZE(EPDTYPE)
|
||||
#define GXEPD2INFO STRINGIZE(GXEPD2VERS)
|
||||
|
||||
/*
|
||||
* Special system page, called directly with fast key sequence 5,4
|
||||
@@ -207,19 +208,21 @@ public:
|
||||
|
||||
getdisplay().setCursor(8, 95);
|
||||
getdisplay().print("Firmware version: ");
|
||||
getdisplay().setCursor(160, 95);
|
||||
getdisplay().setCursor(150, 95);
|
||||
getdisplay().print(VERSINFO);
|
||||
|
||||
getdisplay().setCursor(8, 113);
|
||||
getdisplay().print("Board version: ");
|
||||
getdisplay().setCursor(160, 113);
|
||||
getdisplay().setCursor(150, 113);
|
||||
getdisplay().print(BOARDINFO);
|
||||
getdisplay().print(String(" HW ") + String(PCBINFO));
|
||||
|
||||
getdisplay().setCursor(8, 131);
|
||||
getdisplay().print("Display version: ");
|
||||
getdisplay().setCursor(160, 131);
|
||||
getdisplay().setCursor(150, 131);
|
||||
getdisplay().print(DISPLAYINFO);
|
||||
getdisplay().print("; GxEPD2 v");
|
||||
getdisplay().print(GXEPD2INFO);
|
||||
|
||||
getdisplay().setCursor(8, 265);
|
||||
#ifdef BOARD_OBP60S3
|
||||
|
||||
30
lib/obp60task/extra_task.py
Normal file
30
lib/obp60task/extra_task.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# PlatformIO extra script for obp60task
|
||||
|
||||
epdtype = "unknown"
|
||||
pcbvers = "unknown"
|
||||
for x in env["BUILD_FLAGS"]:
|
||||
if x.startswith("-D HARDWARE_"):
|
||||
pcbvers = x.split('_')[1]
|
||||
if x.startswith("-D DISPLAY_"):
|
||||
epdtype = x.split('_')[1]
|
||||
|
||||
propfilename = os.path.join(env["PROJECT_LIBDEPS_DIR"], env["PIOENV"], "GxEPD2/library.properties")
|
||||
properties = {}
|
||||
with open(propfilename, 'r') as file:
|
||||
for line in file:
|
||||
match = re.match(r'^([^=]+)=(.*)$', line)
|
||||
if match:
|
||||
key = match.group(1).strip()
|
||||
value = match.group(2).strip()
|
||||
properties[key] = value
|
||||
|
||||
gxepd2vers = "unknown"
|
||||
try:
|
||||
if properties["name"] == "GxEPD2":
|
||||
gxepd2vers = properties["version"]
|
||||
except:
|
||||
pass
|
||||
|
||||
env["CPPDEFINES"].extend([("BOARD", env["BOARD"]), ("EPDTYPE", epdtype), ("PCBVERS", pcbvers), ("GXEPD2VERS", gxepd2vers)])
|
||||
|
||||
print("added hardware info to CPPDEFINES")
|
||||
Reference in New Issue
Block a user