diff options
-rw-r--r-- | libloragw/Makefile | 3 | ||||
-rw-r--r-- | libloragw/src/loragw_spi.native.c | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/libloragw/Makefile b/libloragw/Makefile index 7e95eca..16ba23c 100644 --- a/libloragw/Makefile +++ b/libloragw/Makefile @@ -9,8 +9,9 @@ ARCH ?= CROSS_COMPILE ?= CC := $(CROSS_COMPILE)gcc AR := $(CROSS_COMPILE)ar +HOSTNAME=$(shell hostname) -CFLAGS := -O2 -Wall -Wextra -std=c99 -Iinc -I. -isystem =/usr/include/gps -DLIBLORAGW_VERSION=\"$(LIBLORAGW_VERSION)\" +CFLAGS := -O2 -Wall -Wextra -std=c99 -Iinc -I. -isystem =/usr/include/gps -HOSTNAME=\"$(HOSTNAME)\ -DLIBLORAGW_VERSION=\"$(LIBLORAGW_VERSION)\" OBJDIR = obj INCLUDES = $(wildcard inc/*.h) diff --git a/libloragw/src/loragw_spi.native.c b/libloragw/src/loragw_spi.native.c index a26fc22..b0c9e23 100644 --- a/libloragw/src/loragw_spi.native.c +++ b/libloragw/src/loragw_spi.native.c @@ -53,7 +53,15 @@ Maintainer: Sylvain Miermont #define READ_ACCESS 0x00 #define WRITE_ACCESS 0x80 -#define SPI_SPEED 8000000 + +#define HOST_MTCDT3 "mtcdt3ac" + +#if HOSTNAME == MTCDT3 + #define SPI_SPEED 6000000 +#else + #define SPI_SPEED 8000000 +#endif + #define SPI_DEV_PATH "/dev/spidev0.0" //#define SPI_DEV_PATH "/dev/spidev32766.0" //char* spi_dev_path = SPI_DEV_PATH; |