git version
This commit is contained in:
parent
c7f8d83c2b
commit
21558d7383
4 changed files with 22 additions and 1 deletions
|
@ -43,6 +43,7 @@
|
|||
#include "memory.h"
|
||||
#include "tty.h"
|
||||
#include "utils.h"
|
||||
#include "version.h"
|
||||
|
||||
|
||||
constexpr const char NET_DISK_CFG_FILE[] = "/net-disk.json";
|
||||
|
@ -547,7 +548,8 @@ void setup() {
|
|||
delay(100);
|
||||
|
||||
Serial.println(F("This PDP-11 emulator is called \"kek\" (reason for that is forgotten) and was written by Folkert van Heusden."));
|
||||
|
||||
Serial.print(F("GIT hash: "));
|
||||
Serial.println(version_str);
|
||||
Serial.println(F("Build on: " __DATE__ " " __TIME__));
|
||||
|
||||
Serial.print(F("Size of int: "));
|
||||
|
|
|
@ -19,6 +19,7 @@ lib_deps = greiman/SdFat@^2.1.2
|
|||
bblanchon/ArduinoJson@^6.19.4
|
||||
build_flags = -std=gnu++17 -Ofast -DESP32=1 -ggdb3 -D_GLIBCXX_USE_C99
|
||||
build_unflags = -std=gnu++11 -Os
|
||||
extra_scripts = pre:prepare.py
|
||||
|
||||
[env:SHA2017-badge]
|
||||
build_src_filter = +<*> -<.git/> -<.svn/> -<example/> -<examples/> -<test/> -<tests/> -<build> -<player.cpp> -<SHAdisplay/main/> -<SHAdisplay/components> -<SHAdisplay/Arduino/epd2in9-badge>
|
||||
|
|
17
ESP32/prepare.py
Executable file
17
ESP32/prepare.py
Executable file
|
@ -0,0 +1,17 @@
|
|||
#! /usr/bin/python3
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def get_git_hash():
|
||||
ret = subprocess.run(["git", "diff", "--quiet"], stdout=subprocess.PIPE, text=True)
|
||||
add = '*' if ret.returncode != 0 else ''
|
||||
|
||||
ret = subprocess.run(["git", "rev-parse", "--short", "HEAD"], stdout=subprocess.PIPE, text=True)
|
||||
return ret.stdout.strip() + add
|
||||
|
||||
fh = open('version.cpp', 'w')
|
||||
fh.write('const char *version_str = "' + get_git_hash() + '";\n')
|
||||
fh.close()
|
1
ESP32/version.h
Normal file
1
ESP32/version.h
Normal file
|
@ -0,0 +1 @@
|
|||
extern const char *version_str;
|
Loading…
Add table
Reference in a new issue