Skip to content

Commit

Permalink
Add jetson orin nano support (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
lida2003 authored Nov 20, 2024
1 parent 403c56d commit fb40796
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ star6e:
$(eval LIB = -lcam_os_wrapper -lm -lmi_rgn -lmi_sys -lmi_venc)
$(BUILD)

jetson:
$(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:
$(eval SDK = ./sdk/gk7205v300)
$(eval CFLAGS += -D_x86)
Expand Down
18 changes: 12 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ fi
GCC=$PWD/toolchain/$CC/bin/arm-linux-gcc
OUT=msposd_$1

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


if [ ! -e firmware ]; then
git clone https://github.com/openipc/firmware --depth=1
fi
Expand All @@ -37,10 +40,13 @@ 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
DRV=$PWD
make DRV=$DRV OUTPUT=$OUT $1
else
echo "Usage: $0 [goke|hisi|star6b0|star6e]"
echo "Usage: $0 [goke|hisi|star6b0|star6e|jetson|x86]"
exit 1
fi
3 changes: 2 additions & 1 deletion msposd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,7 @@ int main(int argc, char **argv)

printf("Ver: %s\n", VERSION_STRING);
int opt;
int r;
int long_index = 0;
int rc_channel_no = 0;

Expand Down Expand Up @@ -1255,7 +1256,7 @@ int main(int argc, char **argv)
break;

case 'r':
int r=atoi(optarg);
r=atoi(optarg);
if (r>100){
enable_fast_layout=true;
r=r%100;
Expand Down
15 changes: 14 additions & 1 deletion osd/util/Render_x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,20 @@ 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);
}
#endif



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

0 comments on commit fb40796

Please sign in to comment.