Host driver/HAL to build a LoRa Picocell Gateway which communicates through USB with a concentrator board based on Semtech SX1308 multi-channel modem and SX1257/SX1255 RF transceivers.

Committer:
dgabino
Date:
Wed Apr 11 14:38:42 2018 +0000
Revision:
0:102b50f941d0
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dgabino 0:102b50f941d0 1 ### Application-specific constants
dgabino 0:102b50f941d0 2
dgabino 0:102b50f941d0 3 APP_NAME := util_tx_continuous
dgabino 0:102b50f941d0 4
dgabino 0:102b50f941d0 5 ### Environment constants
dgabino 0:102b50f941d0 6
dgabino 0:102b50f941d0 7 LGW_PATH ?= ../libloragw
dgabino 0:102b50f941d0 8 ARCH ?=
dgabino 0:102b50f941d0 9 CROSS_COMPILE ?=
dgabino 0:102b50f941d0 10
dgabino 0:102b50f941d0 11 ### External constant definitions
dgabino 0:102b50f941d0 12 # must get library build option to know if mpsse must be linked or not
dgabino 0:102b50f941d0 13
dgabino 0:102b50f941d0 14 include $(LGW_PATH)/library.cfg
dgabino 0:102b50f941d0 15
dgabino 0:102b50f941d0 16 ### Constant symbols
dgabino 0:102b50f941d0 17
dgabino 0:102b50f941d0 18 CC := $(CROSS_COMPILE)gcc
dgabino 0:102b50f941d0 19 AR := $(CROSS_COMPILE)ar
dgabino 0:102b50f941d0 20
dgabino 0:102b50f941d0 21 CFLAGS=-O2 -Wall -Wextra -std=c99 -Iinc -I.
dgabino 0:102b50f941d0 22
dgabino 0:102b50f941d0 23 OBJDIR = obj
dgabino 0:102b50f941d0 24
dgabino 0:102b50f941d0 25 ### Constants for LoRa concentrator HAL library
dgabino 0:102b50f941d0 26 # List the library sub-modules that are used by the application
dgabino 0:102b50f941d0 27
dgabino 0:102b50f941d0 28 LGW_INC = $(LGW_PATH)/inc/config.h
dgabino 0:102b50f941d0 29 LGW_INC += $(LGW_PATH)/inc/loragw_hal.h
dgabino 0:102b50f941d0 30 LGW_INC += $(LGW_PATH)/inc/loragw_reg.h
dgabino 0:102b50f941d0 31 LGW_INC += $(LGW_PATH)/inc/loragw_aux.h
dgabino 0:102b50f941d0 32
dgabino 0:102b50f941d0 33 ### Linking options
dgabino 0:102b50f941d0 34
dgabino 0:102b50f941d0 35 LIBS := -lloragw -lrt -lm
dgabino 0:102b50f941d0 36
dgabino 0:102b50f941d0 37 ### General build targets
dgabino 0:102b50f941d0 38
dgabino 0:102b50f941d0 39 all: $(APP_NAME)
dgabino 0:102b50f941d0 40
dgabino 0:102b50f941d0 41 clean:
dgabino 0:102b50f941d0 42 rm -f $(OBJDIR)/*.o
dgabino 0:102b50f941d0 43 rm -f $(APP_NAME)
dgabino 0:102b50f941d0 44
dgabino 0:102b50f941d0 45 ### HAL library (do no force multiple library rebuild even with 'make -B')
dgabino 0:102b50f941d0 46
dgabino 0:102b50f941d0 47 $(LGW_PATH)/inc/config.h:
dgabino 0:102b50f941d0 48 @if test ! -f $@; then \
dgabino 0:102b50f941d0 49 $(MAKE) all -C $(LGW_PATH); \
dgabino 0:102b50f941d0 50 fi
dgabino 0:102b50f941d0 51
dgabino 0:102b50f941d0 52 $(LGW_PATH)/libloragw.a: $(LGW_INC)
dgabino 0:102b50f941d0 53 @if test ! -f $@; then \
dgabino 0:102b50f941d0 54 $(MAKE) all -C $(LGW_PATH); \
dgabino 0:102b50f941d0 55 fi
dgabino 0:102b50f941d0 56
dgabino 0:102b50f941d0 57 ### Main program compilation and assembly
dgabino 0:102b50f941d0 58
dgabino 0:102b50f941d0 59 $(OBJDIR):
dgabino 0:102b50f941d0 60 mkdir -p $(OBJDIR)
dgabino 0:102b50f941d0 61
dgabino 0:102b50f941d0 62 $(OBJDIR)/$(APP_NAME).o: src/$(APP_NAME).c $(LGW_INC) | $(OBJDIR)
dgabino 0:102b50f941d0 63 $(CC) -c $(CFLAGS) -I$(LGW_PATH)/inc $< -o $@
dgabino 0:102b50f941d0 64
dgabino 0:102b50f941d0 65 $(APP_NAME): $(OBJDIR)/$(APP_NAME).o $(LGW_PATH)/libloragw.a
dgabino 0:102b50f941d0 66 $(CC) -L$(LGW_PATH) $< -o $@ $(LIBS)
dgabino 0:102b50f941d0 67
dgabino 0:102b50f941d0 68 ### EOF