Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"F_CPU=8000000",
"_DEBUG=1",
"_BUILD_TYPE=\"Debug\"",
"_VERSION_MAJOR=0",
"_VERSION_MINOR=0",
"_VERSION_REVISION=0",
"_CONFIG_DFLT_WPM=200",
"_CONFIG_DFLT_BUZZER_ENABLED=true",
"_CONFIG_DFLT_BUZZER_FREQUENCY=700",
Expand Down
20 changes: 19 additions & 1 deletion configuration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,26 @@
# @date 2025-08-19
#

# -- Versioning --

# Define values
set(VERSION_MAJOR 0
CACHE STRING "The major version number.")
set(VERSION_MINOR 1
CACHE STRING "The minor version number.")
set(VERSION_REVISION 0
CACHE STRING "The revision version number.")

# Set compile definitions
add_compile_definitions(
_VERSION_MAJOR=${VERSION_MAJOR}
_VERSION_MINOR=${VERSION_MINOR}
_VERSION_REVISION=${VERSION_REVISION}
)

# -- Configuration Defaults --

# Define values
set(CONFIG_DFLT_WPM 200
CACHE STRING "Default words per minute, in tenths of a WPM. (10 - 1000)")
set(CONFIG_DFLT_BUZZER_ENABLED true
Expand Down Expand Up @@ -49,7 +67,7 @@ set(CONFIG_DFLT_KEYER_OUTPUT_ACTIVE_LOW true
set(CONFIG_DFLT_KEYER_INVERT_PADDLES false
CACHE STRING "Set to true to invert the paddles. (true / false)")

# Set defines
# Set compile definitions
add_compile_definitions(
_CONFIG_DFLT_WPM=${CONFIG_DFLT_WPM}
_CONFIG_DFLT_BUZZER_ENABLED=${CONFIG_DFLT_BUZZER_ENABLED}
Expand Down
36 changes: 9 additions & 27 deletions src/main/core/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,17 @@

/* --------------------------------------------------- CONSTANTS ---------------------------------------------------- */

/**
* @def VERSION_MAJOR
* @brief The application's current major version number.
*/
#define VERSION_MAJOR 0

/**
* @def VERSION_MINOR
* @brief The application's current minor version number.
*/
#define VERSION_MINOR 1

/**
* @def VERSION_REVISION
* @brief The application's current revision version number.
*/
#define VERSION_REVISION 0

// Public variables
uint8_t const PRODUCT_VERSION_MAJOR = VERSION_MAJOR;
uint8_t const PRODUCT_VERSION_MINOR = VERSION_MINOR;
uint8_t const PRODUCT_VERSION_REVISION = VERSION_REVISION;
uint8_t const PRODUCT_VERSION_MAJOR = _VERSION_MAJOR;
uint8_t const PRODUCT_VERSION_MINOR = _VERSION_MINOR;
uint8_t const PRODUCT_VERSION_REVISION = _VERSION_REVISION;

// Auto-generated variables
static char const * const PRODUCT_NAME = _EXECUTABLE_PROJECT_NAME;
static char const * const EXECUTABLE_NAME = _EXECUTABLE_NAME;
static char const * const VERSION = stringize_value( VERSION_MAJOR ) "."
stringize_value( VERSION_MINOR ) "."
stringize_value( VERSION_REVISION );
static char const * const VERSION = stringize_value( _VERSION_MAJOR ) "."
stringize_value( _VERSION_MINOR ) "."
stringize_value( _VERSION_REVISION );
static char const * const BUILD_TYPE = _BUILD_TYPE;
static char const * const BUILD_DIR = _EXECUTABLE_PROJECT_BUILD_DIR;
static char const * const BUILD_DATE = _EXECUTABLE_BUILD_DATE;
Expand All @@ -58,9 +40,9 @@ void version_get( version_t * version )
version->product_name = PRODUCT_NAME;
version->executable_name = EXECUTABLE_NAME;
version->version = VERSION;
version->version_major = VERSION_MAJOR;
version->version_minor = VERSION_MINOR;
version->version_revision = VERSION_REVISION;
version->version_major = PRODUCT_VERSION_MAJOR;
version->version_minor = PRODUCT_VERSION_MINOR;
version->version_revision = PRODUCT_VERSION_REVISION;
version->build_type = BUILD_TYPE;
version->build_dir = BUILD_DIR;
version->build_date = BUILD_DATE;
Expand Down