diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e8bd1ba --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,62 @@ +name: Build +on: + push: + branches: + - master + tags: + - '*' + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build + run: | + sudo apt-get update + DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo apt-get -y install git make wget gcc libevent-dev libcsfml-dev file g++ cpio unzip rsync bc bzip2 + ./build.sh goke + ./build.sh hisi + ./build.sh star6b0 + ./build.sh star6e + ./build.sh x86 + + - name: Upload binary + uses: actions/upload-artifact@v4 + with: + name: build-results + path: | + msposd_goke + msposd_hisi + msposd_star6b0 + msposd_star6e + msposd_x86 + + - name: Versioned release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v2 + with: + files: | + msposd_goke + msposd_hisi + msposd_star6b0 + msposd_star6e + msposd_x86 + + - name: Upload latest + if: github.event_name != 'pull_request' && startsWith(github.ref, 'main') + uses: softprops/action-gh-release@v2 + with: + tag_name: latest + files: | + msposd_goke + msposd_hisi + msposd_star6b0 + msposd_star6e + msposd_x86 diff --git a/.gitignore b/.gitignore index ecca573..2eb068e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,8 @@ toolchain/ majestic.yaml /msposd firmware/ - +msposd_goke +msposd_hisi +msposd_star6b0 +msposd_star6e +msposd_x86 \ No newline at end of file diff --git a/Makefile b/Makefile index bdd87d9..679cd77 100644 --- a/Makefile +++ b/Makefile @@ -5,21 +5,21 @@ 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 -L $(DRV) $(CFLAGS) $(LIB) -levent_core -Os -s $(CFLAGS) -o $(OUTPUT)/msposd +BUILD = $(CC) $(SRCS) -I $(SDK)/include -I$(TOOLCHAIN)/usr/include -L$(DRV) $(CFLAGS) $(LIB) -levent_core -Os -s $(CFLAGS) -o $(OUTPUT) clean: - rm -f *.o x86 goke hisi star6b0 star6e msposd + rm -f *.o msposd_x86 msposd_goke msposd_hisi msposd_star6b0 msposd_star6e goke: $(eval SDK = ./sdk/gk7205v300) $(eval CFLAGS += -D__GOKE__) - $(eval LIB = -ldl -ldnvqe -lgk_api -lhi_mpi -lsecurec -lupvqe -lvoice_engine -ldnvqe) + $(eval LIB = -shared -ldl -ldnvqe -lgk_api -lhi_mpi -lsecurec -lupvqe -lvoice_engine -ldnvqe) $(BUILD) hisi: $(eval SDK = ./sdk/hi3516ev300) $(eval CFLAGS += -D__GOKE__) - $(eval LIB = -ldnvqe -lmpi -lsecurec -lupvqe -lVoiceEngine) + $(eval LIB = -shared -ldnvqe -lmpi -lsecurec -lupvqe -lVoiceEngine) $(BUILD) star6b0: @@ -38,5 +38,5 @@ x86: $(eval SDK = ./sdk/gk7205v300) $(eval CFLAGS += -D_x86) $(eval LIB = -lcsfml-graphics -lcsfml-window -lcsfml-system -lm) - $(eval BUILD = $(CC) $(SRCS) -I $(SDK)/include -L $(DRV) $(CFLAGS) $(LIB) -levent_core -O0 -g -o $(OUTPUT)/msposd) + $(eval BUILD = $(CC) $(SRCS) -I $(SDK)/include -L $(DRV) $(CFLAGS) $(LIB) -levent_core -O0 -g -o $(OUTPUT)) $(BUILD) diff --git a/build.sh b/build.sh index dc23e52..40fe101 100755 --- a/build.sh +++ b/build.sh @@ -12,8 +12,7 @@ elif [[ "$1" == *"hisi" ]]; then fi GCC=$PWD/toolchain/$CC/bin/arm-linux-gcc -OUT=$PWD/release/$1 -mkdir -p $OUT +OUT=msposd_$1 if [ ! -e toolchain/$CC ]; then wget -c -q --show-progress $DL/$CC.tgz -P $PWD @@ -28,16 +27,16 @@ fi if [ "$1" = "goke" ]; then DRV=$PWD/firmware/general/package/goke-osdrv-gk7205v200/files/lib - make -B CC=$GCC DRV=$DRV OUTPUT=$OUT $1 + make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC OUTPUT=$OUT $1 elif [ "$1" = "hisi" ]; then DRV=$PWD/firmware/general/package/hisilicon-osdrv-hi3516ev200/files/lib - make -B CC=$GCC DRV=$DRV OUTPUT=$OUT $1 + make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC OUTPUT=$OUT $1 elif [ "$1" = "star6b0" ]; then DRV=$PWD/firmware/general/package/sigmastar-osdrv-infinity6b0/files/lib - make -B CC=$GCC DRV=$DRV OUTPUT=$OUT $1 + make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC OUTPUT=$OUT $1 elif [ "$1" = "star6e" ]; then DRV=$PWD/firmware/general/package/sigmastar-osdrv-infinity6e/files/lib - make -B CC=$GCC DRV=$DRV OUTPUT=$OUT $1 + make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC OUTPUT=$OUT $1 elif [ "$1" = "x86" ]; then DRV=$PWD make DRV=$DRV OUTPUT=$OUT $1 diff --git a/osd/util/interface.c b/osd/util/interface.c index 646f5e5..a1f10c5 100644 --- a/osd/util/interface.c +++ b/osd/util/interface.c @@ -1,7 +1,6 @@ #include #include #include -#include #include "interface.h" #define BUFFER_SIZE 1024 diff --git a/osd/util/interface.h b/osd/util/interface.h index 1a4cf93..9a55c0b 100644 --- a/osd/util/interface.h +++ b/osd/util/interface.h @@ -1,5 +1,29 @@ #pragma once + +#if defined(__GOKE__) || defined(__INFINITY6B0__) +// Ensure the compiler supports the necessary features +#include +#include + +// Define exact-width unsigned integer types + +typedef unsigned char uint8_t; // 8-bit unsigned integer +typedef unsigned short uint16_t; // 16-bit unsigned integer +typedef unsigned int uint32_t; // 32-bit unsigned integer +typedef unsigned long long uint64_t; // 64-bit unsigned integer + +// Define minimum and maximum values for these types +#define UINT8_MAX 255 +#define UINT16_MAX 65535 +#define UINT32_MAX 4294967295U +#define UINT64_MAX 18446744073709551615ULL + +// __GOKE__ end +#else #include +#endif + + #include "../msp/msp.h" #define MAX_ENTRIES 100 // Maximum number of frequency-channel pairs to store diff --git a/release/goke/msposd b/release/goke/msposd deleted file mode 100755 index aca620d..0000000 Binary files a/release/goke/msposd and /dev/null differ diff --git a/release/hisi/msposd b/release/hisi/msposd deleted file mode 100755 index fe61c6e..0000000 Binary files a/release/hisi/msposd and /dev/null differ diff --git a/release/star6e/msposd b/release/star6e/msposd deleted file mode 100755 index 0bae80e..0000000 Binary files a/release/star6e/msposd and /dev/null differ diff --git a/release/x86/msposd b/release/x86/msposd deleted file mode 100755 index f0aed70..0000000 Binary files a/release/x86/msposd and /dev/null differ