Skip to content

Commit

Permalink
digital-pot: Fix build
Browse files Browse the repository at this point in the history
Cannot test, requires special hardware.

Signed-off-by: Ola Jeppsson <ola@adapteva.com>
  • Loading branch information
olajep committed Dec 14, 2016
1 parent 9f1d343 commit 5667e52
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion digital-pot/README.md
Expand Up @@ -41,7 +41,7 @@ Instead, please use my updated version, which can be found [here](https://github
Compiling Code (assuming ProgramName.cpp is in the same directory as the
parallella-utils you downlaoded earlier)
```bash
$ gcc -o [OutputName] [ProgramName].cpp para_spi.cpp para_gpio.cpp para_gpio.c -lstdc++ -Wall
$ ./build.sh
```

##Usage
Expand Down
35 changes: 35 additions & 0 deletions digital-pot/build.sh
@@ -0,0 +1,35 @@
#!/bin/bash

set -e

ESDK=${EPIPHANY_HOME}
ELIBS=${ESDK}/tools/host/lib
EINCS=${ESDK}/tools/host/include
ELDF=${ESDK}/bsps/current/internal.ldf

SCRIPT=$(readlink -f "$0")
EXEPATH=$(dirname "$SCRIPT")
cd $EXEPATH

CROSS_PREFIX=
case $(uname -p) in
arm*)
# Use native arm compiler (no cross prefix)
CROSS_PREFIX=
;;
*)
# Use cross compiler
CROSS_PREFIX="arm-linux-gnueabihf-"
;;
esac


GPIO=./parallella-utils/gpio_dir

GPIOSRCS="$GPIO/para_spi.cpp $GPIO/para_gpio.cpp $GPIO/para_gpio.c"

# Build HOST side applications
[ -e parallella-utils ] || git clone https://github.com/parallella/parallella-utils

${CROSS_PREFIX}g++ -o digital-pot -I$GPIO digital-pot.cpp $GPIOSRCS
${CROSS_PREFIX}g++ -o digital-pot-ledfade -I$GPIO digital-pot-ledfade.cpp $GPIOSRCS

0 comments on commit 5667e52

Please sign in to comment.