Skip to content

Commit

Permalink
fix(build): set SPI_DEV_DIR and SPI_SPEED macros
Browse files Browse the repository at this point in the history
Also improved logging.
  • Loading branch information
marvinmarnold committed Oct 18, 2021
1 parent ad32b84 commit bdea0fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
# $OUTPUT_DIR/$SPI_BUS respectively. Also copies reset_lgw.sh
# to $OUTPUT_DIR.

FROM balenalib/raspberry-pi-debian:buster-build as sx1301-builder
FROM balenalib/raspberry-pi-debian:buster-build as lora-gateway-sx1301-builder

ENV ROOT_DIR=/opt

# Output built files to this location
ENV OUTPUT_DIR="$ROOT_DIR/output"

# Overwirtes value in loragw_spi.native.c
Expand Down
4 changes: 2 additions & 2 deletions compile_libloragw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ compile_libloragw_for_spi_bus() {
cd "$ROOT_DIR"
cp -r "$ROOT_DIR/libloragw/" "$OUTPUT_DIR/$spi_bus"

echo "Finished building libloragw for sx1301 on $spi_bus in $ROOT_DIR"
echo "Finished building libloragw for sx1301 on $spi_bus in $OUTPUT_DIR"
}

compile_libloragw() {
echo "Compiling libloragw for sx1301 concentrator on all the necessary SPI buses in $ROOT_DIR"
echo "Compiling libloragw for sx1301 concentrator on all the necessary SPI buses in $OUTPUT_DIR"

# Built outputs will be copied to this directory
mkdir -p "$OUTPUT_DIR"
Expand Down
3 changes: 2 additions & 1 deletion libloragw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ CROSS_COMPILE ?=
CC := $(CROSS_COMPILE)gcc
AR := $(CROSS_COMPILE)ar

CFLAGS := -O2 -Wall -Wextra -std=c99 -Iinc -I.
# Modified to include SPI_DEV_PATH and SPI_SPEED macros
CFLAGS := -O2 -Wall -Wextra -std=c99 -Iinc -I. -D'SPI_DEV_PATH="${SPI_DEV_DIR}"' -D'SPI_SPEED=${SPI_SPEED}'

OBJDIR = obj
INCLUDES = $(wildcard inc/*.h)
Expand Down

0 comments on commit bdea0fb

Please sign in to comment.