summaryrefslogtreecommitdiff
path: root/libloragw
diff options
context:
space:
mode:
authorHarsh Sharma <harsh.sharma@multitech.com>2022-10-13 18:21:26 -0500
committerHarsh Sharma <harsh.sharma@multitech.com>2022-10-13 18:21:26 -0500
commit36b276dc48316938af1e9d177d828bafbe10b3b9 (patch)
treec36a7bb80bd449c0c2a2bcd7da6db361002d5797 /libloragw
parentf6c2760fa5c4c27014454014d38dffe361a24bac (diff)
downloadlora_gateway_mtac_full-36b276dc48316938af1e9d177d828bafbe10b3b9.tar.gz
lora_gateway_mtac_full-36b276dc48316938af1e9d177d828bafbe10b3b9.tar.bz2
lora_gateway_mtac_full-36b276dc48316938af1e9d177d828bafbe10b3b9.zip
Reduced spi speed for mtcdt35.0.15
Diffstat (limited to 'libloragw')
-rw-r--r--libloragw/Makefile3
-rw-r--r--libloragw/src/loragw_spi.native.c10
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;