Display git revision information on MateCard terminal

This commit is contained in:
Laura Hausmann 2023-02-10 01:25:54 +01:00
parent 82a677eacc
commit 1a1dab926f
Signed by: zotan
GPG key ID: D044E84C5BE01605
2 changed files with 6 additions and 1 deletions

View file

@ -26,3 +26,4 @@ lib_deps =
check_tool = clangtidy
check_flags =
clangtidy: --checks=*,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-modernize-macro-to-enum
build_flags = !echo '-DAFRAPAY_REVISION=\\"'$(git describe --long --always --dirty --exclude=* --abbrev=8)'\\"'

View file

@ -4,6 +4,7 @@
#include "U8g2lib.h"
#include "logos.h"
#include "utils.h"
#include "vars.h"
void drawCurvedLineV(U8G2 u8g2, int xStart, int yStart, int vert, int horiz) {
u8g2.drawVLine(xStart, yStart + 1, vert);
@ -126,5 +127,8 @@ void updateOLED(U8G2 u8g2, e_state state, String statusText, String statusTextRi
void updateOLED(U8G2 u8g2, e_state state) {
String time = DateTime.format(DateFormatter::TIME_ONLY);
updateOLED(u8g2, state, time, WiFi.localIP().toString());
if (!digitalRead(PIN_INTERRUPT_CANCEL) || millis()%10000 < 5000)
updateOLED(u8g2, state, time, AFRAPAY_REVISION);
else
updateOLED(u8g2, state, time, WiFi.localIP().toString());
}