From 5acc4ee43b89dad58a5c27be1c9406484bd5e582 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 12 Jun 2015 06:54:04 -1000 Subject: [PATCH] Back Port of Git Versioning - without side effects Part 2 --- makefiles/firmware_posix.mk | 2 +- makefiles/posix/config_posix_default.mk | 1 + src/platforms/posix/include/board_config.h | 2 ++ src/platforms/px4_defines.h | 1 + src/systemcmds/ver/ver.c | 7 +++++-- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/makefiles/firmware_posix.mk b/makefiles/firmware_posix.mk index 912e7bcc3f..f88caf569a 100644 --- a/makefiles/firmware_posix.mk +++ b/makefiles/firmware_posix.mk @@ -42,7 +42,7 @@ all: $(FIRMWARES) .PHONY: $(FIRMWARES) $(BUILD_DIR)%.build/firmware.a: config = $(patsubst $(BUILD_DIR)%.build/firmware.a,%,$@) $(BUILD_DIR)%.build/firmware.a: work_dir = $(BUILD_DIR)$(config).build/ -$(FIRMWARES): $(BUILD_DIR)%.build/firmware.a: generateuorbtopicheaders +$(FIRMWARES): $(BUILD_DIR)%.build/firmware.a: checkgitversion generateuorbtopicheaders @$(ECHO) %%%% @$(ECHO) %%%% Building $(config) in $(work_dir) @$(ECHO) %%%% diff --git a/makefiles/posix/config_posix_default.mk b/makefiles/posix/config_posix_default.mk index 30dada7bbd..f479505b30 100644 --- a/makefiles/posix/config_posix_default.mk +++ b/makefiles/posix/config_posix_default.mk @@ -19,6 +19,7 @@ MODULES += modules/sensors MODULES += systemcmds/param MODULES += systemcmds/mixer MODULES += systemcmds/topic_listener +MODULES += systemcmds/ver # # General system control diff --git a/src/platforms/posix/include/board_config.h b/src/platforms/posix/include/board_config.h index a03b8c3e20..6413bb780b 100644 --- a/src/platforms/posix/include/board_config.h +++ b/src/platforms/posix/include/board_config.h @@ -9,3 +9,5 @@ #define PX4_I2C_BUS_LED 3 #define PX4_I2C_OBDEV_LED 0x55 + +#define STM32_SYSMEM_UID "SIMULATIONID" diff --git a/src/platforms/px4_defines.h b/src/platforms/px4_defines.h index ba5f716945..ac3b15eb9b 100644 --- a/src/platforms/px4_defines.h +++ b/src/platforms/px4_defines.h @@ -125,6 +125,7 @@ typedef param_t px4_param_t; /* FIXME - Used to satisfy build */ //STM DocID018909 Rev 8 Sect 39.1 (Unique device ID Register) #define UNIQUE_ID 0x1FFF7A10 +#define STM32_SYSMEM_UID "SIMULATIONID" /* FIXME - Used to satisfy build */ #define getreg32(a) (*(volatile uint32_t *)(a)) diff --git a/src/systemcmds/ver/ver.c b/src/systemcmds/ver/ver.c index caac93024a..0328621b3d 100644 --- a/src/systemcmds/ver/ver.c +++ b/src/systemcmds/ver/ver.c @@ -41,6 +41,7 @@ */ #include +#include #include #include #include @@ -91,7 +92,8 @@ int ver_main(int argc, char *argv[]) return ret; } else { - errx(1, "Not enough arguments, try 'ver hwcmp PX4FMU_V2'"); + warn("Not enough arguments, try 'ver hwcmp PX4FMU_V2'"); + return 1; } } @@ -158,7 +160,8 @@ int ver_main(int argc, char *argv[]) if (ret == 1) { - errx(1, "unknown command.\n"); + warn("unknown command.\n"); + return 1; } } else {