From 8bc96ac57174692b7604ddc65e22dea6ddb1824b Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 11 Sep 2013 13:44:54 +0900 Subject: [PATCH] Add version string --- common.mk | 4 ++++ common/command.c | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/common.mk b/common.mk index 47d5c852..64ef86c4 100644 --- a/common.mk +++ b/common.mk @@ -69,5 +69,9 @@ ifdef BACKLIGHT_ENABLE endif +# Version string +OPT_DEFS += -DVERSION=$(shell (git describe --dirty || echo 'unknown') 2> /dev/null) + + # Search Path VPATH += $(TOP_DIR)/common diff --git a/common/command.c b/common/command.c index 4649e00a..7415645b 100644 --- a/common/command.c +++ b/common/command.c @@ -252,9 +252,10 @@ static bool command_common(uint8_t code) case KC_V: // print version & information print("\n\n----- Version -----\n"); print(STR(DESCRIPTION) "\n"); - print(STR(MANUFACTURER) "(" STR(VENDOR_ID) ")/"); - print(STR(PRODUCT) "(" STR(PRODUCT_ID) ") "); - print("VERSION: " STR(DEVICE_VER) "\n"); + print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") VER: " STR(DEVICE_VER) "\n"); + print("SRC: " STR(VERSION) "\n"); + print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__) "\n"); + print("AVR-LIBC: " __AVR_LIBC_VERSION_STRING__ "\n"); break; case KC_T: // print timer print_val_hex32(timer_count);