version information added

This commit is contained in:
Martin Brodbeck 2023-01-04 10:59:16 +01:00
parent f510d07360
commit 3e29f56402
3 changed files with 9 additions and 0 deletions

View file

@ -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

View file

@ -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);

6
src/config.h.in Normal file
View file

@ -0,0 +1,6 @@
#ifndef CONFIG_H
#define CONFIG_H
#cmakedefine PROJECT_VERSION "@PROJECT_VERSION@"
#endif