Skip to content

Commit d587762

Browse files
committed
example: Add wps demo project
1 parent 17c4971 commit d587762

File tree

7 files changed

+715
-0
lines changed

7 files changed

+715
-0
lines changed

examples/wps_demo/Makefile

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#############################################################
2+
# Required variables for each makefile
3+
# Discard this section from all parent makefiles
4+
# Expected variables (with automatic defaults):
5+
# CSRCS (all "C" files in the dir)
6+
# SUBDIRS (all subdirs with a Makefile)
7+
# GEN_LIBS - list of libs to be generated ()
8+
# GEN_IMAGES - list of object file images to be generated ()
9+
# GEN_BINS - list of binaries to be generated ()
10+
# COMPONENTS_xxx - a list of libs/objs in the form
11+
# subdir/lib to be extracted and rolled up into
12+
# a generated lib/image xxx.a ()
13+
#
14+
TARGET = eagle
15+
#FLAVOR = release
16+
FLAVOR = debug
17+
18+
#EXTRA_CCFLAGS += -u
19+
20+
ifndef PDIR # {
21+
GEN_IMAGES= eagle.app.v6.out
22+
GEN_BINS= eagle.app.v6.bin
23+
SPECIAL_MKTARGETS=$(APP_MKTARGETS)
24+
SUBDIRS= \
25+
user
26+
27+
endif # } PDIR
28+
29+
LDDIR = $(SDK_PATH)/ld
30+
31+
CCFLAGS += -Os
32+
33+
TARGET_LDFLAGS = \
34+
-nostdlib \
35+
-Wl,-EL \
36+
--longcalls \
37+
--text-section-literals
38+
39+
ifeq ($(FLAVOR),debug)
40+
TARGET_LDFLAGS += -g -O2
41+
endif
42+
43+
ifeq ($(FLAVOR),release)
44+
TARGET_LDFLAGS += -g -O0
45+
endif
46+
47+
COMPONENTS_eagle.app.v6 = \
48+
user/libuser.a
49+
50+
LINKFLAGS_eagle.app.v6 = \
51+
-L$(SDK_PATH)/lib \
52+
-Wl,--gc-sections \
53+
-nostdlib \
54+
-T$(LD_FILE) \
55+
-Wl,--no-check-sections \
56+
-u call_user_start \
57+
-Wl,-static \
58+
-Wl,--start-group \
59+
-lcirom \
60+
-lcrypto \
61+
-lespconn \
62+
-lespnow \
63+
-lfreertos \
64+
-lgcc \
65+
-lhal \
66+
-ljson \
67+
-llwip \
68+
-lmain \
69+
-lmesh \
70+
-lmirom \
71+
-lnet80211 \
72+
-lnopoll \
73+
-lphy \
74+
-lpp \
75+
-lpwm \
76+
-lmbedtls \
77+
-lopenssl \
78+
-lsmartconfig \
79+
-lspiffs \
80+
-lwpa \
81+
-lwps \
82+
$(DEP_LIBS_eagle.app.v6) \
83+
-Wl,--end-group
84+
85+
DEPENDS_eagle.app.v6 = \
86+
$(LD_FILE) \
87+
$(LDDIR)/eagle.rom.addr.v6.ld
88+
89+
#############################################################
90+
# Configuration i.e. compile options etc.
91+
# Target specific stuff (defines etc.) goes in here!
92+
# Generally values applying to a tree are captured in the
93+
# makefile at its root level - these are then overridden
94+
# for a subtree within the makefile rooted therein
95+
#
96+
97+
#UNIVERSAL_TARGET_DEFINES = \
98+
99+
# Other potential configuration flags include:
100+
# -DTXRX_TXBUF_DEBUG
101+
# -DTXRX_RXBUF_DEBUG
102+
# -DWLAN_CONFIG_CCX
103+
CONFIGURATION_DEFINES = -DICACHE_FLASH -D__STDC_NO_ATOMICS__=1 -DESP8266_RTOS -D__STDC_VERSION__=201112L -DFREERTOS_ARCH_ESP8266
104+
#-DNO_LOGGING=1
105+
106+
DEFINES += \
107+
$(UNIVERSAL_TARGET_DEFINES) \
108+
$(CONFIGURATION_DEFINES)
109+
110+
DDEFINES += \
111+
$(UNIVERSAL_TARGET_DEFINES) \
112+
$(CONFIGURATION_DEFINES)
113+
114+
115+
#############################################################
116+
# Recursion Magic - Don't touch this!!
117+
#
118+
# Each subtree potentially has an include directory
119+
# corresponding to the common APIs applicable to modules
120+
# rooted at that subtree. Accordingly, the INCLUDE PATH
121+
# of a module can only contain the include directories up
122+
# its parent path, and not its siblings
123+
#
124+
# Required for each makefile to inherit from the parent
125+
#
126+
127+
INCLUDES := $(INCLUDES) -I $(PDIR)include
128+
sinclude $(SDK_PATH)/Makefile
129+
130+
.PHONY: FORCE
131+
FORCE:
132+

examples/wps_demo/gen_misc.bat

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
@echo off
2+
3+
Rem ******NOTICE******
4+
Rem MUST set SDK_PATH & BIN_PATH firstly!!!
5+
Rem example:
6+
Rem set SDK_PATH=/c/esp_iot_sdk_freertos
7+
Rem set BIN_PATH=/c/esp8266_bin
8+
9+
set SDK_PATH=""
10+
set BIN_PATH=""
11+
12+
echo gen_misc.bat version 20150911
13+
echo .
14+
15+
if not %SDK_PATH% == "" (
16+
echo SDK_PATH: %SDK_PATH%
17+
) else (
18+
echo ERROR: Please set SDK_PATH in gen_misc.bat firstly, exit!!!
19+
goto end
20+
)
21+
22+
if not %BIN_PATH% == "" (
23+
echo BIN_PATH: %BIN_PATH%
24+
) else (
25+
echo ERROR: Please set BIN_PATH in gen_misc.bat firstly, exit!!!
26+
goto end
27+
)
28+
29+
echo .
30+
echo Please check SDK_PATH/BIN_PATH, enter (Y/y) to continue:
31+
set input=default
32+
set /p input=
33+
34+
if not %input% == Y (
35+
if not %input% == y (
36+
goto end
37+
)
38+
)
39+
40+
echo .
41+
echo Please follow below steps(1-5) to generate specific bin(s):
42+
echo STEP 1: use boot_v1.2+ by default
43+
set boot=new
44+
45+
echo boot mode: %boot%
46+
echo.
47+
48+
echo STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
49+
set input=default
50+
set /p input=enter (0/1/2, default 0):
51+
52+
if %input% equ 1 (
53+
if %boot% equ none (
54+
set app=0
55+
echo choose no boot before
56+
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
57+
) else (
58+
set app=1
59+
echo generate bin: user1.bin
60+
)
61+
) else (
62+
if %input% equ 2 (
63+
if %boot% equ none (
64+
set app=0
65+
echo choose no boot before
66+
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
67+
) else (
68+
set app=2
69+
echo generate bin: user2.bin
70+
)
71+
) else (
72+
if %boot% neq none (
73+
set boot=none
74+
echo ignore boot
75+
)
76+
set app=0
77+
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
78+
))
79+
80+
echo.
81+
82+
echo STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)
83+
set input=default
84+
set /p input=enter (0/1/2/3, default 2):
85+
86+
if %input% equ 0 (
87+
set spi_speed=20
88+
) else (
89+
if %input% equ 1 (
90+
set spi_speed=26.7
91+
) else (
92+
if %input% equ 3 (
93+
set spi_speed=80
94+
) else (
95+
set spi_speed=40
96+
)))
97+
98+
echo spi speed: %spi_speed% MHz
99+
echo.
100+
101+
echo STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
102+
set input=default
103+
set /p input=enter (0/1/2/3, default 0):
104+
105+
if %input% equ 1 (
106+
set spi_mode=QOUT
107+
) else (
108+
if %input% equ 2 (
109+
set spi_mode=DIO
110+
) else (
111+
if %input% equ 3 (
112+
set spi_mode=DOUT
113+
) else (
114+
set spi_mode=QIO
115+
)))
116+
117+
echo spi mode: %spi_mode%
118+
echo.
119+
120+
echo STEP 5: choose flash size and map
121+
echo 0= 512KB( 256KB+ 256KB)
122+
echo 2=1024KB( 512KB+ 512KB)
123+
echo 3=2048KB( 512KB+ 512KB)
124+
echo 4=4096KB( 512KB+ 512KB)
125+
echo 5=2048KB(1024KB+1024KB)
126+
echo 6=4096KB(1024KB+1024KB)
127+
set input=default
128+
set /p input=enter (0/1/2/3/4/5/6, default 0):
129+
130+
if %input% equ 2 (
131+
set spi_size_map=2
132+
echo spi size: 1024KB
133+
echo spi ota map: 512KB + 512KB
134+
) else (
135+
if %input% equ 3 (
136+
set spi_size_map=3
137+
echo spi size: 2048KB
138+
echo spi ota map: 512KB + 512KB
139+
) else (
140+
if %input% equ 4 (
141+
set spi_size_map=4
142+
echo spi size: 4096KB
143+
echo spi ota map: 512KB + 512KB
144+
) else (
145+
if %input% equ 5 (
146+
set spi_size_map=5
147+
echo spi size: 2048KB
148+
echo spi ota map: 1024KB + 1024KB
149+
) else (
150+
if %input% equ 6 (
151+
set spi_size_map=6
152+
echo spi size: 4096KB
153+
echo spi ota map: 1024KB + 1024KB
154+
) else (
155+
set spi_size_map=0
156+
echo spi size: 512KB
157+
echo spi ota map: 256KB + 256KB
158+
)
159+
)
160+
)
161+
)
162+
)
163+
164+
echo.
165+
echo start...
166+
echo.
167+
168+
make clean
169+
170+
make COMPILE=xcc BOOT=%boot% APP=%app% SPI_SPEED=%spi_speed% SPI_MODE=%spi_mode% SPI_SIZE_MAP=%spi_size_map%
171+
172+
:end

0 commit comments

Comments
 (0)