diff --git a/Makefile b/Makefile index 4d524bb..f5a1768 100644 --- a/Makefile +++ b/Makefile @@ -5,43 +5,54 @@ CFLAGS += -Wno-address-of-packed-member -DVERSION_STRING="\"$(VERSION_STRING)\"" SRCS := compat.c msposd.c bmp/bitmap.c bmp/region.c bmp/lib/schrift.c bmp/text.c osd/net/network.c osd/msp/msp.c osd/msp/msp_displayport.c libpng/lodepng.c osd/util/interface.c osd/util/settings.c osd/util/ini_parser.c osd/msp/vtxmenu.c OUTPUT ?= $(PWD) -BUILD = $(CC) $(SRCS) -I $(SDK)/include -I$(TOOLCHAIN)/usr/include -L$(DRV) $(CFLAGS) $(LIB) -levent_core -Os -s $(CFLAGS) -o $(OUTPUT) +BUILD = $(CC) $(SRCS) -I $(SDK)/include -I$(TOOLCHAIN)/usr/include -I$(PWD) -L$(DRV) $(CFLAGS) $(LIB) -levent_core -Os -s $(CFLAGS) -o $(OUTPUT) + +VERSION := $(shell git describe --always --dirty) + +version.h: + echo "Git version: $(VERSION)" + echo "#ifndef VERSION_H" > version.h + echo "#define VERSION_H" >> version.h + echo "#define GIT_VERSION \"$(VERSION)\"" >> version.h + echo "#endif // VERSION_H" >> version.h + +all: version.h clean: rm -f *.o msposd_x86 msposd_goke msposd_hisi msposd_star6b0 msposd_star6e -goke: +goke: version.h $(eval SDK = ./sdk/gk7205v300) $(eval CFLAGS += -D__GOKE__) - $(eval LIB = -shared -ldl -ldnvqe -lgk_api -lhi_mpi -lsecurec -lupvqe -lvoice_engine -ldnvqe) + $(eval LIB = -ldl -ldnvqe -lgk_api -lhi_mpi -lsecurec -lupvqe -lvoice_engine -ldnvqe) $(BUILD) -hisi: +hisi: version.h $(eval SDK = ./sdk/hi3516ev300) $(eval CFLAGS += -D__GOKE__) - $(eval LIB = -shared -ldnvqe -lmpi -lsecurec -lupvqe -lVoiceEngine) + $(eval LIB = -ldnvqe -lmpi -lsecurec -lupvqe -lVoiceEngine) $(BUILD) -star6b0: +star6b0: version.h $(eval SDK = ./sdk/infinity6) $(eval CFLAGS += -D__SIGMASTAR__ -D__INFINITY6__ -D__INFINITY6B0__) $(eval LIB = -lcam_os_wrapper -lm -lmi_rgn -lmi_sys) $(BUILD) -star6e: +star6e: version.h $(eval SDK = ./sdk/infinity6) $(eval CFLAGS += -D__SIGMASTAR__ -D__INFINITY6__ -D__INFINITY6E__) $(eval LIB = -lcam_os_wrapper -lm -lmi_rgn -lmi_sys -lmi_venc) $(BUILD) -jetson: +jetson: version.h $(eval SDK = ./sdk/gk7205v300) $(eval CFLAGS += -D_x86 -D_jetson) $(eval LIB = -lcsfml-graphics -lcsfml-window -lcsfml-system `pkg-config --libs cairo x11` -lm) $(eval BUILD = $(CC) $(SRCS) -I $(SDK)/include -L $(DRV) $(CFLAGS) $(LIB) -levent_core -O0 -g -o $(OUTPUT)) $(BUILD) -x86: +x86: version.h $(eval SDK = ./sdk/gk7205v300) $(eval CFLAGS += -D_x86) $(eval LIB = -lcsfml-graphics -lcsfml-window -lcsfml-system `pkg-config --libs cairo x11` -lm) diff --git a/README.md b/README.md index da8873a..575bf31 100644 --- a/README.md +++ b/README.md @@ -182,13 +182,14 @@ reboot On lower-end cameras like gk7205v200/v210 the OSD will work only in 1280x720 mode! ## Rendering on the ground station -This mode uses one MSPOSD running on the air unit, collecting MSP DisplayPort data, aggregating it and sending it via wfb_ng to the ground. +This mode uses one MSPOSD running on the air unit, receiving MSP DisplayPort data from the FC, aggregating it and sending it via wfb_ng to the ground. On the ground another instance of MSPOSD renders these data and overlays it on the screen. Tested on x86 Ubuntu 6.5.0.28 On the cam msposd can be started like this to forward via port 14550 (default mavlink, should not be used) ```msposd --channels 7 --master /dev/ttyS2 --baudrate 115200 --out 127.0.0.1:14550 --matrix 11 --ahi 3 -r 30``` On the ground: -```msposd --master 127.0.0.1:14550 --osd -r 50 --ahi 3 --matrix 11 -v``` +```msposd --master 127.0.0.1:14550 --osd -r 50 --ahi 3 --matrix 11 -v``` +Use ALT+Up/Down Arrow to center the AHI over horizon. ### Diagnosing Q: _I see a static map of all characters on the screen but no realtime OSD_. diff --git a/msposd.c b/msposd.c index 8b51a23..61199c8 100644 --- a/msposd.c +++ b/msposd.c @@ -14,6 +14,7 @@ #include #include #include +#include "version.h" #include #include @@ -1198,7 +1199,7 @@ int main(int argc, char **argv) MinTimeBetweenScreenRefresh=50; last_board_temp=-100; - printf("Ver: %s\n", VERSION_STRING); + printf("Ver: %s Compiled at: %s\n", GIT_VERSION, VERSION_STRING); int opt; int r; int long_index = 0; diff --git a/release/goke/msposd b/release/goke/msposd index ba456c4..7d32153 100755 Binary files a/release/goke/msposd and b/release/goke/msposd differ diff --git a/release/hisi/msposd b/release/hisi/msposd index 5cd29ca..ade5386 100755 Binary files a/release/hisi/msposd and b/release/hisi/msposd differ diff --git a/release/star6e/msposd b/release/star6e/msposd index 5d5c246..066550b 100755 Binary files a/release/star6e/msposd and b/release/star6e/msposd differ diff --git a/release/x86/msposd b/release/x86/msposd index 60cfb1d..c7e9410 100755 Binary files a/release/x86/msposd and b/release/x86/msposd differ diff --git a/version.h b/version.h new file mode 100644 index 0000000..0adb010 --- /dev/null +++ b/version.h @@ -0,0 +1,4 @@ +#ifndef VERSION_H +#define VERSION_H +#define GIT_VERSION "786ee76-dirty" +#endif // VERSION_H