Skip to content

Commit

Permalink
try actions
Browse files Browse the repository at this point in the history
  • Loading branch information
henkwiedig committed Oct 23, 2024
1 parent 8abb831 commit beef9d8
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 13 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build
on:
push:
branches:
- master
- github-actions
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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ toolchain/
majestic.yaml
/msposd
firmware/

msposd_goke
msposd_hisi
msposd_star6b0
msposd_star6e
msposd_x86
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
11 changes: 5 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion osd/util/interface.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <bits/stdint-uintn.h>
#include "interface.h"

#define BUFFER_SIZE 1024
Expand Down
24 changes: 24 additions & 0 deletions osd/util/interface.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
#pragma once

#if defined(__GOKE__) || defined(__INFINITY6B0__)
// Ensure the compiler supports the necessary features
#include <limits.h>
#include <stddef.h>

// 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 <bits/stdint-uintn.h>
#endif


#include "../msp/msp.h"

#define MAX_ENTRIES 100 // Maximum number of frequency-channel pairs to store
Expand Down
Binary file removed release/goke/msposd
Binary file not shown.
Binary file removed release/hisi/msposd
Binary file not shown.
Binary file removed release/star6e/msposd
Binary file not shown.
Binary file removed release/x86/msposd
Binary file not shown.

0 comments on commit beef9d8

Please sign in to comment.