Add Git ID to MMDVM description

pull/10/head
phl0 9 years ago
parent d7a40757d5
commit be8318a66a
No known key found for this signature in database
GPG Key ID: 48EA1E640798CA9A

@ -107,8 +107,8 @@ BINBIN=outp.bin
MCFLAGS=-mcpu=cortex-m3 -march=armv7-m -mthumb -Wall -Wextra MCFLAGS=-mcpu=cortex-m3 -march=armv7-m -mthumb -Wall -Wextra
# COMPILE FLAGS # COMPILE FLAGS
DEFS_HS=-DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -DHSE_VALUE=$(OSC) -DVECT_TAB_OFFSET=0x0 DEFS_HS=-DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -DHSE_VALUE=$(OSC) -DVECT_TAB_OFFSET=0x0 -DMADEBYMAKEFILE
DEFS_HS_BL=-DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -DHSE_VALUE=$(OSC) -DVECT_TAB_OFFSET=0x2000 DEFS_HS_BL=-DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -DHSE_VALUE=$(OSC) -DVECT_TAB_OFFSET=0x2000 -DMADEBYMAKEFILE
CFLAGS=-c $(MCFLAGS) $(INCLUDES) -DCUSTOM_NEW -DNO_EXCEPTIONS -Wno-unused-parameter CFLAGS=-c $(MCFLAGS) $(INCLUDES) -DCUSTOM_NEW -DNO_EXCEPTIONS -Wno-unused-parameter
CXXFLAGS=-c $(MCFLAGS) $(INCLUDES) -DCUSTOM_NEW -DNO_EXCEPTIONS -Wno-unused-parameter CXXFLAGS=-c $(MCFLAGS) $(INCLUDES) -DCUSTOM_NEW -DNO_EXCEPTIONS -Wno-unused-parameter
@ -138,6 +138,7 @@ debug: CXXFLAGS+=-g $(DEFS_HS)
debug: LDFLAGS+=-g debug: LDFLAGS+=-g
debug: release debug: release
release: GitVersion.h
release: $(BINDIR) release: $(BINDIR)
release: $(BINDIR)/$(BINHEX) release: $(BINDIR)/$(BINHEX)
release: $(BINDIR)/$(BINBIN) release: $(BINDIR)/$(BINBIN)
@ -172,6 +173,7 @@ $(BINDIR)/$(BINELF): $(OBJECTS)
clean: clean:
$(CLEANCMD) $(CLEANCMD)
$(RM) GitVersion.h
stlink: stlink:
$(ST_FLASH) write bin/$(BINBIN) 0x8000000 $(ST_FLASH) write bin/$(BINBIN) 0x8000000
@ -230,3 +232,14 @@ ifneq ($(wildcard /opt/openocd/bin/openocd),)
/opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program STM32F10X_Lib/utils/bootloader/generic_boot20_pc13.bin verify reset exit 0x08000000" /opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program STM32F10X_Lib/utils/bootloader/generic_boot20_pc13.bin verify reset exit 0x08000000"
/opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINBIN) verify reset exit 0x08002000" /opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINBIN) verify reset exit 0x08002000"
endif endif
# Export the current git version if the index file exists, else 000...
GitVersion.h: .FORCE
ifneq ("$(wildcard .git/index)","")
echo "#define GITVERSION \"$(shell git rev-parse --short HEAD)\"" > $@
else
echo "#define GITVERSION \"0000000\"" > $@
endif
.FORCE:

@ -23,6 +23,10 @@
#include "Config.h" #include "Config.h"
#include "Globals.h" #include "Globals.h"
#if defined(MADEBYMAKEFILE)
#include "GitVersion.h"
#endif
#include "SerialPort.h" #include "SerialPort.h"
const uint8_t MMDVM_FRAME_START = 0xE0U; const uint8_t MMDVM_FRAME_START = 0xE0U;
@ -74,9 +78,14 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U;
#define DESCRIPTION "MMDVM_HS-ADF7021 20170521 (D-Star/DMR/YSF/P25)" #define DESCRIPTION "MMDVM_HS-ADF7021 20170521 (D-Star/DMR/YSF/P25)"
#endif #endif
#if defined(GITVERSION)
#define concat(a, b) a " GitID #" b ""
const char HARDWARE[] = concat(DESCRIPTION, GITVERSION);
#else
#define concat(a, b, c) a " (Build: " b " " c ")" #define concat(a, b, c) a " (Build: " b " " c ")"
const char HARDWARE[] = concat(DESCRIPTION, __TIME__, __DATE__); const char HARDWARE[] = concat(DESCRIPTION, __TIME__, __DATE__);
#endif
const uint8_t PROTOCOL_VERSION = 1U; const uint8_t PROTOCOL_VERSION = 1U;
CSerialPort::CSerialPort() : CSerialPort::CSerialPort() :

Loading…
Cancel
Save

Powered by TurnKey Linux.