Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Slavey Karadzhov committed Mar 5, 2018
2 parents 4a0fec1 + 4e24d53 commit fa39c52
Show file tree
Hide file tree
Showing 253 changed files with 19,766 additions and 2,192 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@
path = Sming/third-party/ESP8266_NONOS_SDK
url = https://github.com/espressif/ESP8266_NONOS_SDK.git
ignore = dirty
[submodule "tools/esptool2"]
path = tools/esptool2
url = https://github.com/raburton/esptool2.git
ignore = dirty
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ install:
- if [ "$SDK_VERSION" == "1.5.0" ]; then wget https://bintray.com/artifact/download/kireevco/generic/${SDK_FILE_NAME}; fi
- if [ "$SDK_VERSION" == "1.5.0" ]; then bsdtar -xf ${SDK_FILE_NAME} -C $TRAVIS_BUILD_DIR/opt/esp-alt-sdk; fi
- if [[ "$SDK_VERSION" != "1.5.0" && "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/nodemcu/nodemcu-firmware/raw/master/tools/esp-open-sdk.tar.xz; tar -Jxvf esp-open-sdk.tar.xz; ln -s `pwd`/esp-open-sdk/xtensa-lx106-elf $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/. ; fi
- if [ "$SDK_VERSION" == "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then wget http://bbs.espressif.com/download/file.php?id=1690 -O sdk.zip; unzip sdk.zip; ln -s `pwd`/ESP8266_NONOS_SDK/ $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/sdk; export DEPLOY='true'; fi
- if [ "$SDK_VERSION" == "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then wget https://www.espressif.com/sites/default/files/sdks/esp8266_nonos_sdk_v2.0.0_16_08_10.zip -O sdk.zip; unzip sdk.zip; ln -s `pwd`/ESP8266_NONOS_SDK/ $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/sdk; export DEPLOY='true'; fi

script:
- env
- unset SPIFFY
- unset ESPTOOL2
- export CHANGED_FILES=`git diff --diff-filter=AMD HEAD HEAD^ --name-only`
- export CHANGED_PROJECTS=`for i in $CHANGED_FILES; do echo "$i" | grep '^samples/' | cut -d'/' -f2; done | uniq`
- export SMING_HOME=$TRAVIS_BUILD_DIR/Sming
Expand Down
2 changes: 1 addition & 1 deletion Sming/Libraries/ArduCAM/ArduCAMStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ArduCAMStream::~ArduCAMStream() {
}


size_t ArduCAMStream::available() {
int ArduCAMStream::available() {
// int len = myCAM.read_fifo_length();
// ACAM_DEBUG("Stream available (%d bytes)\n", len);
return len;
Expand Down
2 changes: 1 addition & 1 deletion Sming/Libraries/ArduCAM/ArduCAMStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ArduCAMStream: public ReadWriteStream {
}

bool dataReady();
size_t available();
int available();

private:

Expand Down
94 changes: 59 additions & 35 deletions Sming/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,48 @@ COM_SPEED = 115200
# Git command
GIT ?= git

# Detect OS and build environment
UNAME := $(shell uname -s)

ifeq ($(OS),Windows_NT)
# Windows detected
# Convert Windows paths to POSIX paths
SMING_HOME := $(subst \,/,$(addprefix /,$(subst :,,$(SMING_HOME))))
SMING_HOME := $(subst //,/,$(SMING_HOME))
ESP_HOME := $(subst \,/,$(addprefix /,$(subst :,,$(ESP_HOME))))
ESP_HOME := $(subst //,/,$(ESP_HOME))
endif

ifneq ($(filter MINGW32_NT%,$(UNAME)),)
UNAME := Windows

else ifneq ($(filter CYGWIN%,$(UNAME)),)
# Cygwin Detected
UNAME := Linux
else ifneq ($(filter CYGWIN%WOW,$(UNAME)),)
#Cygwin32
UNAME := Linux
else ifneq ($(filter MSYS%WOW,$(UNAME)),)
#Msys32
UNAME := Linux
else ifeq ($(UNAME), Linux)
#Linux
else ifeq ($(UNAME), Darwin)
#OS X
else ifeq ($(UNAME), Freebsd)
#BSD
endif

# OS specific configuration
ifeq ($(UNAME),Windows)
# Windows detected

# Default SMING_HOME. Can be overriden.
SMING_HOME ?= c:\tools\Sming\Sming

# Default ESP_HOME. Can be overriden.
ESP_HOME ?= c:\Espressif

# Making proper path adjustments - replace back slashes, remove colon and add forward slash.
SMING_HOME := $(subst \,/,$(addprefix /,$(subst :,,$(SMING_HOME))))
ESP_HOME := $(subst \,/,$(addprefix /,$(subst :,,$(ESP_HOME))))

# Remove possible double escaping...
SMING_HOME := $(subst //,/, $(SMING_HOME))
ESP_HOME := $(subst //,/, $(ESP_HOME))

include Makefile-windows.mk
include $(SMING_HOME)/Makefile-windows.mk
else
UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin)
# MacOS Detected
UNAME := MacOS
Expand All @@ -68,8 +88,7 @@ else
ESP_HOME ?= /opt/esp-open-sdk

include Makefile-macos.mk
endif
ifeq ($(UNAME),Linux)
else ifeq ($(UNAME),Linux)
# Linux Detected
UNAME := Linux

Expand All @@ -78,9 +97,8 @@ else

# Default ESP_HOME. Can be overriden.
ESP_HOME ?= /opt/esp-open-sdk
include Makefile-linux.mk
endif
ifeq ($(UNAME),FreeBSD)
include Makefile-linux.mk
else ifeq ($(UNAME),FreeBSD)
# Freebsd Detected
UNAME := FreeBSD

Expand Down Expand Up @@ -150,12 +168,13 @@ TARGET = app

CUSTOM_TARGETS ?=

ARDUINO_LIBRARIES = $(shell git submodule status Libraries | cut -c2- | cut -f2 -d ' ' | sed -r 's/Libraries\/(.*?)/Libraries\/\1\/library.properties/g' )
ARDUINO_LIBRARIES = $(shell git submodule status Libraries | cut -c2- | cut -f2 -d ' ' | sed -r 's/Libraries\/([^/]*)/Libraries\/\1\/library.properties/g' )

# which modules (subdirectories) of the project to include in compiling
MODULES = system system/helpers Wiring appinit \
$(sort $(dir $(wildcard SmingCore/*/ SmingCore/*/*/ SmingCore/*/*/*/))) \
$(filter %/, $(wildcard Services/*/)) $(filter %/, $(wildcard Libraries/*/))
$(filter %/, $(wildcard Services/*/)) \
$(filter %/, $(wildcard Libraries/*/)) $(wildcard Libraries/*/src/)
EXTRA_INCDIR = include system/include Wiring Libraries SmingCore $(SDK_BASE)/../include

# Place a file that should exist in a submodule that is fetched separately
Expand Down Expand Up @@ -247,7 +266,7 @@ MFORCE32 := $(shell $(CC) --help=target | grep mforce-l32)

# compiler flags using during compilation of source files. Add '-pg' for debugging
CFLAGS += -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections \
-D__ets__ -DICACHE_FLASH -DARDUINO=106 -DCOM_SPEED_SERIAL=$(COM_SPEED_SERIAL) -DENABLE_CMD_EXECUTOR=$(ENABLE_CMD_EXECUTOR) -DESP8266=1
-D__ets__ -DICACHE_FLASH -DARDUINO=106 -DCOM_SPEED_SERIAL=$(COM_SPEED_SERIAL) -DENABLE_CMD_EXECUTOR=$(ENABLE_CMD_EXECUTOR) -DESP8266=1 -DSMING_INCLUDED=1
ifeq ($(SMING_RELEASE),1)
# See: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
# for full list of optimization options
Expand Down Expand Up @@ -293,7 +312,7 @@ ifeq ($(ENABLE_SSL),1)
AXTLS_FLAGS += -DSSL_DEBUG=1 -DDEBUG_TLS_MEM=1 -DAXL_DEBUG=1
endif
CUSTOM_TARGETS += $(USER_LIBDIR)/libaxtls.a
EXTRA_CFLAGS_AXTLS = -I../../system/include -I../../Wiring
# EXTRA_CFLAGS_AXTLS = -I../../system/include -I../../Wiring
CFLAGS += $(AXTLS_FLAGS)
CXXFLAGS += $(AXTLS_FLAGS)
endif
Expand Down Expand Up @@ -334,6 +353,7 @@ EXTRA_INCDIR := $(addprefix -I,$(EXTRA_INCDIR))
MODULE_INCDIR := $(addsuffix /include,$(INCDIR))

SAMPLES_DIRS := $(shell ls -1 ../samples)
TOOLS_DIRS := $(shell ls -1 ../tools)
THIRD_PARTY_DIRS := $(shell ls -1 third-party )
DOXYGEN := $(shell command -v doxygen 2> /dev/null)

Expand Down Expand Up @@ -376,9 +396,9 @@ $1/%.cpp.d: %.cpp
.PRECIOUS: $1/%.c.d $1/%.cpp.d
endef

.PHONY: all checkdirs clean spiffy test samples-clean samples $(SAMPLES_DIRS) docs api wiki
.PHONY: all checkdirs clean tools $(TOOLS_DIRS) test samples-clean samples $(SAMPLES_DIRS) docs api wiki

all: checkdirs $(APP_AR) spiffy
all: checkdirs $(APP_AR) tools

ifeq ($(ENABLE_CUSTOM_PWM), 1)
$(USER_LIBDIR)/libpwm_open.a: third-party/pwm/pwm.c
Expand Down Expand Up @@ -407,13 +427,6 @@ $(USER_LIBDIR)/liblwip%.a: third-party/lwip2/Makefile.sming
$(Q) $(MAKE) -C third-party/lwip2/ -f Makefile.sming ENABLE_ESPCONN=$(ENABLE_ESPCONN) SDK_BASE="$(SDK_BASE)" USER_LIBDIR="$(SMING_HOME)/$(USER_LIBDIR)/" CFLAGS_EXTRA="$(EXTRA_CFLAGS_LWIP)" all
endif

spiffy: spiffy/spiffy

spiffy/spiffy: third-party/spiffs/makefile
$(vecho) "Making spiffy utility"
$(Q) $(MAKE) --no-print-directory -C spiffy V=$(V)
$(vecho) "Done"

$(APP_AR): $(OBJ)
$(vecho) "AR $@"
$(Q) $(AR) cru $@ $^
Expand All @@ -435,8 +448,6 @@ $(FW_BASE):
$(Q) mkdir -p $@
$(Q) mkdir -p $@/upgrade

rebuild: clean all

clean:
$(Q) rm -f $(APP_AR)
$(Q) rm -f $(TARGET_OUT)
Expand All @@ -445,8 +456,6 @@ clean:
$(Q) rm -rf $(FW_BASE)
ifeq ($(ENABLE_SSL), 1)
$(Q) -$(MAKE) --no-print-directory -C third-party/axtls-8266 clean -e V=$(V) BIN_DIR="$(SMING_HOME)/$(USER_LIBDIR)" CFLAGS_EXTRA="$(EXTRA_CFLAGS_AXTLS)"
else
$(Q) $(MAKE) --no-print-directory -C spiffy clean V=$(V)
endif
ifeq ($(ENABLE_CUSTOM_LWIP), 1)
$(Q) -$(MAKE) -C third-party/esp-open-lwip/ -f Makefile.open ENABLE_ESPCONN=$(ENABLE_ESPCONN) SDK_BASE="$(SDK_BASE)" USER_LIBDIR="$(SMING_HOME)/$(USER_LIBDIR)/" CFLAGS_EXTRA="$(EXTRA_CFLAGS_LWIP)" clean
Expand Down Expand Up @@ -523,8 +532,23 @@ third-party-clean:
libraries-clean:
$(Q) rm -rf Libraries
$(Q) $(GIT) checkout Libraries

tools: third-party/spiffs/makefile $(TOOLS_DIRS)

$(TOOLS_DIRS):
$(Q) if [ -d $(SMING_HOME)/../tools/$@ ]; then \
echo "Making $@"; \
if [ ! -e $(SMING_HOME)/../tools/$@/Makefile ]; then (cd $(SMING_HOME)/../; $(GIT) submodule update --init --recursive tools/$@/;); fi; \
$(MAKE) --no-print-directory -C $(SMING_HOME)/../tools/$@ V=$(V); \
fi

tools-clean:
$(Q) for dir in $(TOOLS_DIRS); do \
if [ ! -d $(SMING_HOME)/../tools/$$dir ]; then continue; fi; \
$(MAKE) --no-print-directory -C $(SMING_HOME)/../tools/$$dir clean V=$(V); \
done

dist-clean: clean samples-clean third-party-clean libraries-clean
dist-clean: clean samples-clean third-party-clean libraries-clean tools-clean
$(Q) for file in $(shell ls $(USER_LIBDIR)/lib*.a ); do \
rm $$file; \
done
Expand Down
Loading

0 comments on commit fa39c52

Please sign in to comment.