Skip to content

Commit

Permalink
Add core version (#309)
Browse files Browse the repository at this point in the history
* add core version in OnGetInfo

* for Core FW both versions are always the same
  • Loading branch information
elral authored Jan 10, 2024
1 parent f971fba commit f883fe9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions get_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@
firmware_version = firmware_version.lstrip("v")
firmware_version = firmware_version.strip(".")

# The community devices have a slightly different version where the
# core firmware version is defined within there .ini file
# For the core FW both versions are always the same
core_firmware_version = firmware_version

print(f'Using version {firmware_version} for the build')
print(f'Using version {core_firmware_version} as core version')

# Append the version to the build defines so it gets baked into the firmware
# Append the version and core version to the build defines so it gets baked into the firmware
env.Append(CPPDEFINES=[
f'BUILD_VERSION={firmware_version}'
f'BUILD_VERSION={firmware_version}', f'CORE_BUILD_VERSION={core_firmware_version}'
])

# Set the output filename to the name of the board and the version
Expand Down
2 changes: 2 additions & 0 deletions src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#define STRINGIZER(arg) #arg
#define STR_VALUE(arg) STRINGIZER(arg)
#define VERSION STR_VALUE(BUILD_VERSION)
#define CORE_VERSION STR_VALUE(CORE_BUILD_VERSION)

MFEEPROM MFeeprom;

Expand Down Expand Up @@ -554,6 +555,7 @@ void OnGetInfo()
cmdMessenger.sendCmdArg(name);
cmdMessenger.sendCmdArg(serial);
cmdMessenger.sendCmdArg(VERSION);
cmdMessenger.sendCmdArg(CORE_VERSION);
cmdMessenger.sendCmdEnd();
}

Expand Down

0 comments on commit f883fe9

Please sign in to comment.