Skip to content

Commit

Permalink
use APP_VERSION_MAJOR and APP_VERSION_MINOR defines instead of git_so…
Browse files Browse the repository at this point in the history
…ftware_version.h (#19)
  • Loading branch information
PonomarevDA authored Apr 17, 2024
1 parent 6b48fc0 commit 6c0d834
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions Cyphal/cyphal_subscribers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@
#include "params.hpp"
#include "algorithms.hpp"
#include "storage.h"
#include "git_software_version.h"

#ifndef GIT_HASH
#define GIT_HASH 0xBADC0FFEEFFF
#define GIT_HASH 0xBADC0FFEE000
#endif
#if GIT_HASH == 0xBADC0FFEEFFF
#pragma message "GIT_HASH is not provided"
#if GIT_HASH == 0xBADC0FFEE000
#warning "GIT_HASH has not been provided!"
#endif

#ifndef APP_VERSION_MAJOR
#warning "APP_VERSION_MAJOR has been assigned to 0 by default."
#define APP_VERSION_MAJOR 0
#endif

#ifndef APP_VERSION_MINOR
#warning "APP_VERSION_MINOR has been assigned to 0 by default."
#define APP_VERSION_MINOR 0
#endif

namespace cyphal {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ It is nice to fill GetInfo with an information specific to your application:

|||
|-|-|
| Software version | Defined on the compile time with `APP_VERSION_MAJOR` define. |
| Software version | Defined on the compile time with `APP_VERSION_MAJOR` and `APP_VERSION_MINOR` defines. |
| Hardware version | Should be defined on the initialization time. |
| Certificate of authenticity | Not supported by this example yet. |
| Unique ID | It is expected to provide `HAL_GetUIDw0`, `HAL_GetUIDw1` and `HAL_GetUIDw2`. By default, it is provided by STM32 HAL. |
Expand Down

0 comments on commit 6c0d834

Please sign in to comment.