diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 16e330d..d7a5a9a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,5 @@ #set(CMAKE_INCLUDE_CURRENT_DIR ON) +configure_file(${CMAKE_CURRENT_LIST_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) set(SOURCES ws2812.cpp diff --git a/src/abfall.cpp b/src/abfall.cpp index d095c5b..002ee9a 100644 --- a/src/abfall.cpp +++ b/src/abfall.cpp @@ -13,6 +13,7 @@ #include "pico/stdlib.h" #include "pico/util/datetime.h" +#include "config.h" #include "http_client.h" #include "ntp_client.h" #include "utils.h" @@ -29,6 +30,7 @@ int main() { #ifdef DEBUG printf("!!! DEBUG mode !!!\n"); #endif + printf("Firmware version: %s\n", PROJECT_VERSION); WS2812 led(WS2812_PIN); diff --git a/src/config.h.in b/src/config.h.in new file mode 100644 index 0000000..b3f9bae --- /dev/null +++ b/src/config.h.in @@ -0,0 +1,6 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#cmakedefine PROJECT_VERSION "@PROJECT_VERSION@" + +#endif \ No newline at end of file