diff --git a/README.md b/README.md index 32f44724..57d73e0b 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,11 @@ A 3d-printable housing can be found here: https://www.thingiverse.com/thing:4571 -##### Rolling - (2020-09-16) +##### Rolling - (2020-09-20) + +* Update HTML-Backround (thanks to michaeljoos72) + +2020-09-16 * Impovements in hostname diff --git a/code/src/CMakeLists.txt b/code/src/CMakeLists.txt index 3a4eaf13..26822ce5 100644 --- a/code/src/CMakeLists.txt +++ b/code/src/CMakeLists.txt @@ -1,6 +1,14 @@ # This file was automatically generated for projects # without default 'CMakeLists.txt' file. +if(NOT CMAKE_BUILD_EARLY_EXPANSION) +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.cpp + ${CMAKE_CURRENT_BINARY_DIR}/_version.cpp + COMMAND ${CMAKE_COMMAND} -P + ${CMAKE_CURRENT_SOURCE_DIR}/version.cmake) +endif() + FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*) # idf_component_register(SRCS ${app_sources}) diff --git a/code/src/main.cpp b/code/src/main.cpp index 82f56d05..67cbf1cd 100644 --- a/code/src/main.cpp +++ b/code/src/main.cpp @@ -5,6 +5,7 @@ #include "driver/gpio.h" #include "sdkconfig.h" +//#include "version.h" #include "ClassLogFile.h" diff --git a/code/src/version.cmake b/code/src/version.cmake new file mode 100644 index 00000000..20c189b0 --- /dev/null +++ b/code/src/version.cmake @@ -0,0 +1,43 @@ +execute_process(COMMAND git log --pretty=format:'%h' -n 1 + OUTPUT_VARIABLE GIT_REV + ERROR_QUIET) + +# Check whether we got any revision (which isn't +# always the case, e.g. when someone downloaded a zip +# file from Github instead of a checkout) +if ("${GIT_REV}" STREQUAL "") + set(GIT_REV "N/A") + set(GIT_DIFF "") + set(GIT_TAG "N/A") + set(GIT_BRANCH "N/A") +else() + execute_process( + COMMAND bash -c "git diff --quiet --exit-code || echo +" + OUTPUT_VARIABLE GIT_DIFF) + execute_process( + COMMAND git describe --exact-match --tags + OUTPUT_VARIABLE GIT_TAG ERROR_QUIET) + execute_process( + COMMAND git rev-parse --abbrev-ref HEAD + OUTPUT_VARIABLE GIT_BRANCH) + + string(STRIP "${GIT_REV}" GIT_REV) + string(SUBSTRING "${GIT_REV}" 1 7 GIT_REV) + string(STRIP "${GIT_DIFF}" GIT_DIFF) + string(STRIP "${GIT_TAG}" GIT_TAG) + string(STRIP "${GIT_BRANCH}" GIT_BRANCH) +endif() + +set(VERSION "const char* GIT_REV=\"${GIT_REV}${GIT_DIFF}\"; +const char* GIT_TAG=\"${GIT_TAG}\"; +const char* GIT_BRANCH=\"${GIT_BRANCH}\";") + +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp) + file(READ ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp VERSION_) +else() + set(VERSION_ "") +endif() + +if (NOT "${VERSION}" STREQUAL "${VERSION_}") + file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp "${VERSION}") +endif() \ No newline at end of file diff --git a/firmware/bootloader.bin b/firmware/bootloader.bin index a62e024e..cd992d7d 100644 Binary files a/firmware/bootloader.bin and b/firmware/bootloader.bin differ diff --git a/firmware/firmware.bin b/firmware/firmware.bin index 9ad3245c..0d0e3cce 100644 Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ diff --git a/firmware/html.zip b/firmware/html.zip index 7e430bca..776a0f20 100644 Binary files a/firmware/html.zip and b/firmware/html.zip differ