Skip to content

Commit

Permalink
Goke/Hisi compile&binaries fixed. Commit version added in binary
Browse files Browse the repository at this point in the history
  • Loading branch information
tipoman9 committed Nov 21, 2024
1 parent 786ee76 commit c1ffa36
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 12 deletions.
29 changes: 20 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_.
Expand Down
3 changes: 2 additions & 1 deletion msposd.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <termios.h>
#include <assert.h>
#include <time.h>
#include "version.h"

#include <event2/event.h>
#include <event2/util.h>
Expand Down Expand Up @@ -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;
Expand Down
Binary file modified release/goke/msposd
Binary file not shown.
Binary file modified release/hisi/msposd
Binary file not shown.
Binary file modified release/star6e/msposd
Binary file not shown.
Binary file modified release/x86/msposd
Binary file not shown.
4 changes: 4 additions & 0 deletions version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#ifndef VERSION_H
#define VERSION_H
#define GIT_VERSION "786ee76-dirty"
#endif // VERSION_H

0 comments on commit c1ffa36

Please sign in to comment.