Browse Source

Version information

main 0.5.1-alpha.2
Hendrik Langer 4 years ago
parent
commit
070a2d7c57
  1. 6
      script/autoversioning.py
  2. 8
      src/main.cpp
  3. 4
      src/network/XD0OTA.h

6
script/autoversioning.py

@ -11,3 +11,9 @@ f.close()
env.Append(CPPDEFINES=[ env.Append(CPPDEFINES=[
("FW_VERSION", ver) ("FW_VERSION", ver)
]) ])
drone_semver = env["ENV"].get("DRONE_SEMVER")
if drone_semver:
env.Append(CPPDEFINES=[
("DRONE_SEMVER", "\"" + drone_semver.replace("\"", "\\\"") + "\"")
])

8
src/main.cpp

@ -256,7 +256,15 @@ void helloWorld()
display.setCursor(5, display.height()-5); display.setCursor(5, display.height()-5);
display.setFont(&Org_01); display.setFont(&Org_01);
#if defined DRONE_SEMVER
display.print("Version ");
#define xstr(s) str(s)
#define str(s) #s
display.print(xstr(DRONE_SEMVER));
#elif defined FW_VERSION
display.print("Build ");
display.print(FW_VERSION); display.print(FW_VERSION);
#endif
} }
while (display.nextPage()); while (display.nextPage());
//Serial.println("helloWorld done"); //Serial.println("helloWorld done");

4
src/network/XD0OTA.h

@ -13,6 +13,10 @@
#include <Arduino.h> #include <Arduino.h>
#ifndef FW_VERSION
#define FW_VERSION 0
#endif
class XD0OTA { class XD0OTA {
public: public:
XD0OTA(String deviceName); XD0OTA(String deviceName);

Loading…
Cancel
Save