Skip to content

Commit

Permalink
Include lamp version
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterdevinck committed May 24, 2018
1 parent 7db0f58 commit 7dabb9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/mcu/components/updater/Updater.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "Updater.h"
#include "fpga_version.h"
#include "version.h"
#include "esp_log.h"
#include <iomanip>
#include <sstream>
Expand All @@ -13,6 +13,7 @@ Updater::Updater() {

// TEMP TEST
ESP_LOGD(tag, "FPGA version: %s", FPGA_HASH);
ESP_LOGD(tag, "Lamp version: %s", LAMP_VERSION);
ostringstream dbg;
dbg << endl;
for (int i = 0; i < fpga_image_end - fpga_image_start; ++i) {
Expand Down
10 changes: 6 additions & 4 deletions src/mcu/components/updater/component.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
COMPONENT_ADD_INCLUDEDIRS := .
COMPONENT_EMBED_FILES := ../../../../build/fpga/lamp.bin
COMPONENT_EXTRA_CLEAN := fpga_version.h
COMPONENT_EXTRA_CLEAN := version.h

fpga_version.h:
printf "#pragma once\n#define FPGA_HASH \"%s\"\n" `cat ../../../build/fpga/lamp.hash` > $@
version.h:
printf "#pragma once\n#define FPGA_HASH \"%s\"\n#define LAMP_VERSION \"%s\"\n" \
`cat ../../../build/fpga/lamp.hash` \
`git describe --tags --dirty` > $@

Updater.o: fpga_version.h
Updater.o: version.h

0 comments on commit 7dabb9e

Please sign in to comment.