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
6 changes: 6 additions & 0 deletions Test/shimmer_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <stdio.h>

#include "log_and_stream_includes.h"
#include "version.h"

factory_test_target_t factoryTestTarget = PRINT_TO_DEBUGGER;
factory_test_t factoryTestToRun;
Expand All @@ -23,6 +24,11 @@ uint32_t ShimFactoryTest_run(void)
ShimFactoryTest_sendReport("//**************************** TEST START "
"************************************//\r\n");

/* Record the firmware version running this test so the captured report
* documents exactly which build was used for testing. FW_VERSION_STRING is
* the compile-time version baked into this binary. Prints on every report. */
ShimFactoryTest_sendReport("Firmware version: " FW_VERSION_STRING "\r\n");

shimmerStatus.testResult = 0;

if (factoryTestToRun == FACTORY_TEST_LED_STATES)
Expand Down
6 changes: 4 additions & 2 deletions scripts/increment_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ typedef struct
uint8_t patch;
} firmware_version_t;

__attribute__((section(".version"), used)) static const firmware_version_t fw_version_struct
= { .major = FW_VERSION_MAJOR, .minor = FW_VERSION_MINOR, .patch = FW_VERSION_PATCH };
/* The definition lives in each firmware's main.c so this header can be included
* by multiple translation units without emitting a duplicate object into the
* .version linker section. */
extern const firmware_version_t fw_version_struct;
Comment thread
marknolan marked this conversation as resolved.

#endif //VERSION_H
EOF
Expand Down