Commit 0f928c04 authored by mz-fuzzy's avatar mz-fuzzy

pthread switch added to compile phase

interrupt module added to SPIDEV
changed to Ofast optimization
littlewire example fix
Signed-off-by: default avatarmz-fuzzy <mzfuzzy800@gmail.com>
parent ef1914b4
...@@ -23,7 +23,7 @@ OBJECTS+=spi.o gpio.o compatibility.o ...@@ -23,7 +23,7 @@ OBJECTS+=spi.o gpio.o compatibility.o
else ifeq ($(DRIVER), RPi) else ifeq ($(DRIVER), RPi)
OBJECTS+=spi.o bcm2835.o interrupt.o OBJECTS+=spi.o bcm2835.o interrupt.o
else ifeq ($(DRIVER), SPIDEV) else ifeq ($(DRIVER), SPIDEV)
OBJECTS+=spi.o gpio.o compatibility.o OBJECTS+=spi.o gpio.o compatibility.o interrupt.o
endif endif
# make all # make all
...@@ -37,22 +37,22 @@ $(LIBNAME): $(OBJECTS) ...@@ -37,22 +37,22 @@ $(LIBNAME): $(OBJECTS)
# Library parts # Library parts
RF24.o: RF24.cpp RF24.o: RF24.cpp
$(CXX) -Wall -fPIC $(CFLAGS) -c $^ $(CXX) -fPIC $(CFLAGS) -c $^
bcm2835.o: $(DRIVER_DIR)/bcm2835.c bcm2835.o: $(DRIVER_DIR)/bcm2835.c
$(CC) -Wall -fPIC $(CFLAGS) -c $^ $(CC) -fPIC $(CFLAGS) -c $^
spi.o: $(DRIVER_DIR)/spi.cpp spi.o: $(DRIVER_DIR)/spi.cpp
$(CXX) -Wall -fPIC $(CFLAGS) -c $^ $(CXX) -fPIC $(CFLAGS) -c $^
compatibility.o: $(DRIVER_DIR)/compatibility.c compatibility.o: $(DRIVER_DIR)/compatibility.c
$(CC) -Wall -fPIC $(CFLAGS) -c $(DRIVER_DIR)/compatibility.c $(CC) -fPIC $(CFLAGS) -c $(DRIVER_DIR)/compatibility.c
gpio.o: $(DRIVER_DIR)/gpio.cpp gpio.o: $(DRIVER_DIR)/gpio.cpp
$(CXX) -Wall -fPIC $(CFLAGS) -c $(DRIVER_DIR)/gpio.cpp $(CXX) -fPIC $(CFLAGS) -c $(DRIVER_DIR)/gpio.cpp
interrupt.o: $(DRIVER_DIR)/interrupt.c interrupt.o: $(DRIVER_DIR)/interrupt.c
$(CXX) -Wall -fPIC $(CFLAGS) -c $(DRIVER_DIR)/interrupt.c $(CXX) -fPIC $(CFLAGS) -c $(DRIVER_DIR)/interrupt.c
# clear configuration files # clear configuration files
cleanconfig: cleanconfig:
......
...@@ -366,6 +366,7 @@ fi ...@@ -366,6 +366,7 @@ fi
case ${DRIVER} in case ${DRIVER} in
SPIDEV) SPIDEV)
SHARED_LINKER_FLAGS+=" -pthread"
;; ;;
RPi) RPi)
SHARED_LINKER_FLAGS+=" -pthread" SHARED_LINKER_FLAGS+=" -pthread"
...@@ -414,7 +415,7 @@ if [ "${LIB_DEPRECATE_NAME}" ]; then ...@@ -414,7 +415,7 @@ if [ "${LIB_DEPRECATE_NAME}" ]; then
fi fi
fi fi
DRIVER_DIR=${DRIVER_DIR:-${ARCH_DIR}/${DRIVER}} DRIVER_DIR=${DRIVER_DIR:-${ARCH_DIR}/${DRIVER}}
CFLAGS="$CPUFLAGS -O2 -Wall -g $CFLAGS" CFLAGS="$CPUFLAGS -Ofast -Wall -pthread $CFLAGS"
echo "[SECTION] Preparing configuration." echo "[SECTION] Preparing configuration."
cp ${DRIVER_DIR}/includes.h ${ARCH_DIR}/includes.h cp ${DRIVER_DIR}/includes.h ${ARCH_DIR}/includes.h
......
...@@ -14,10 +14,15 @@ ...@@ -14,10 +14,15 @@
BINARY_PREFIX = rf24 BINARY_PREFIX = rf24
SOURCES = $(PROGRAMS:=.cpp) SOURCES = $(PROGRAMS:=.cpp)
LIBS=-l$(LIB)
ifeq ($(DRIVER), LittleWire)
LIBS+= -llittlewire-spi
endif
all: $(PROGRAMS) all: $(PROGRAMS)
$(PROGRAMS): $(SOURCES) $(PROGRAMS): $(SOURCES)
$(CXX) $(CFLAGS) -I$(HEADER_DIR)/.. -I.. -L$(LIB_DIR) -l$(LIB) $@.cpp -o $@ $(CXX) $(CFLAGS) -I$(HEADER_DIR)/.. -I.. -L$(LIB_DIR) $(LIBS) $@.cpp -o $@
clean: clean:
@echo "[Cleaning]" @echo "[Cleaning]"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment