Skip to content

Commit

Permalink
[link] Pprzlink router (for herelink) (#2497)
Browse files Browse the repository at this point in the history
  • Loading branch information
fvantienen committed Dec 19, 2023
1 parent 20ef416 commit 3a956fa
Show file tree
Hide file tree
Showing 5 changed files with 638 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ paparazzi.sublime-workspace
*.files
*.includes

# VSCode IDE
.vscode/ipch/

# Vagrant VM files
/.vagrant

Expand Down Expand Up @@ -145,6 +148,10 @@ Cargo.lock
/sw/logalizer/disp3d
/sw/logalizer/sdlogger_download

# /sw/misc
/sw/misc/link/pprzlink_router
/sw/misc/link/pprzlink_router_cc

# /sw/simulator/
/sw/simulator/gaia
/sw/simulator/simhitl
Expand Down
13 changes: 13 additions & 0 deletions sw/misc/link/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Quiet compilation
Q=@

all: pprzlink_router pprzlink_router_cc

pprzlink_router: pprzlink_router.c
gcc -g -O2 -Wall -o $@ $^ -lpthread

pprzlink_router_cc:pprzlink_router.c
arm-linux-gnueabi-gcc -static -g -O2 -Wall -o $@ $^ -lpthread

clean:
$(Q)rm -f pprzlink_router pprzlink_router_cc
38 changes: 38 additions & 0 deletions sw/misc/link/mass_storage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/system/bin/sh
/data/init.sh &
# Copyright (c) 2009-2018, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
FILE=/data/.format_vfat.userdata
STORAGE=/dev/block/platform/soc/by-name/storage
TARGET=/sdcard
ATTR= "-o iocharset=utf8,rw,sync,umask=0000,dmask=0000,fmask=0000"
TYPE="-t vfat"
if [ -f "$FILE" ]; then
/bin/busybox mkfs.vfat $STORAGE
rm $FILE
fi
/bin/busybox mount $TYPE $ATTR $STORAGE $TARGET

0 comments on commit 3a956fa

Please sign in to comment.