Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use native build instead of x86/jetson target #31

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
./build.sh hisi
./build.sh star6b0
./build.sh star6e
./build.sh x86
./build.sh native

- name: Upload binary
uses: actions/upload-artifact@v4
Expand All @@ -35,7 +35,7 @@ jobs:
msposd_hisi
msposd_star6b0
msposd_star6e
msposd_x86
msposd

- name: Versioned release
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -46,7 +46,7 @@ jobs:
msposd_hisi
msposd_star6b0
msposd_star6e
msposd_x86
msposd

- name: Upload latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
Expand All @@ -58,4 +58,4 @@ jobs:
msposd_hisi
msposd_star6b0
msposd_star6e
msposd_x86
msposd
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ msposd_goke
msposd_hisi
msposd_star6b0
msposd_star6e
msposd_x86
serial_monitor.c
serial_monitor.c
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ version.h:
all: version.h

clean:
rm -f *.o msposd_x86 msposd_goke msposd_hisi msposd_star6b0 msposd_star6e
rm -f *.o msposd msposd_goke msposd_hisi msposd_star6b0 msposd_star6e

goke: version.h
$(eval SDK = ./sdk/gk7205v300)
Expand All @@ -45,17 +45,10 @@ star6e: version.h
$(eval LIB = -lcam_os_wrapper -lm -lmi_rgn -lmi_sys -lmi_venc)
$(BUILD)

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: version.h
native: version.h
$(eval SDK = ./sdk/gk7205v300)
$(eval CFLAGS += -D_x86)
$(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)

17 changes: 8 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash
DL="https://github.com/OpenIPC/firmware/releases/download/toolchain/toolchain"

if [ "$#" -ne 1 ]; then
echo "Usage: $0 [goke|hisi|star6b0|star6e|native]"
exit 1
fi

if [[ "$1" == *"star6b0" ]]; then
CC=sigmastar-infinity6b0
Expand All @@ -13,15 +17,16 @@ elif [[ "$1" == *"hisi" ]]; then
fi

GCC=$PWD/toolchain/$CC/bin/arm-linux-gcc
OUT=msposd_$1
OUT=msposd

if [[ "$1" != *"jetson"* && "$1" != *"x86"* ]]; then
if [[ "$1" != *"native"* ]]; then
if [ ! -e toolchain/$CC ]; then
wget -c -q --show-progress $DL.$CC.tgz -P $PWD
mkdir -p toolchain/$CC
tar -xf toolchain.$CC.tgz -C toolchain/$CC --strip-components=1 || exit 1
rm -f $CC.tgz
fi
OUT=msposd_$1
fi


Expand All @@ -41,13 +46,7 @@ elif [ "$1" = "star6b0" ]; then
elif [ "$1" = "star6e" ]; then
DRV=$PWD/firmware/general/package/sigmastar-osdrv-infinity6e/files/lib
make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC OUTPUT=$OUT $1
elif [ "$1" = "jetson" ]; then
DRV=$PWD
make DRV=$DRV OUTPUT=$OUT $1
elif [ "$1" = "x86" ]; then
else
DRV=$PWD
make DRV=$DRV OUTPUT=$OUT $1
else
echo "Usage: $0 [goke|hisi|star6b0|star6e|jetson|x86]"
exit 1
fi
13 changes: 2 additions & 11 deletions osd/util/Render_x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,11 @@ int Init_x86(uint16_t *width, uint16_t *height) {
#ifdef _DEBUG_x86
forcefullscreen=false;
#endif


#ifdef _jetson
if (getenv("DISPLAY") == NULL) {
/*
* Use default display screen, especially launch from console
* ToDo: x86 linux should implement this code also, test needed.
*/
setenv("DISPLAY", ":0", 1);
}
#ifdef _x86
setenv("DISPLAY", ":0", 0);
#endif



display = XOpenDisplay(NULL);
if (!display) {
fprintf(stderr, "Cannot open display\n");
Expand Down