Skip to content

Commit d4ddb66

Browse files
Links2004igrr
authored andcommitted
update SDK to v1.2.0_15_07_03
1 parent 39883f5 commit d4ddb66

27 files changed

+193
-15
lines changed

cores/esp8266/Esp.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,25 @@ EspClass ESP;
8181

8282
void EspClass::wdtEnable(uint32_t timeout_ms)
8383
{
84+
/// This API can only be called if software watchdog is stopped
85+
system_soft_wdt_restart();
8486
}
8587

8688
void EspClass::wdtEnable(WDTO_t timeout_ms)
8789
{
90+
wdtEnable((uint32_t) timeout_ms);
8891
}
8992

9093
void EspClass::wdtDisable(void)
9194
{
95+
/// Please don’t stop software watchdog too long (less than 6 seconds),
96+
/// otherwise it will trigger hardware watchdog reset.
97+
system_soft_wdt_stop();
9298
}
9399

94100
void EspClass::wdtFeed(void)
95101
{
102+
96103
}
97104

98105
void EspClass::deepSleep(uint32_t time_us, WakeMode mode)

libraries/ESP8266WiFi/src/ESP8266WiFi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ void ESP8266WiFiClass::beginSmartConfig()
599599
_smartConfigDone = false;
600600

601601
//SC_TYPE_ESPTOUCH use ESPTOUCH for smartconfig, or use SC_TYPE_AIRKISS for AIRKISS
602-
smartconfig_start(SC_TYPE_ESPTOUCH, reinterpret_cast<sc_callback_t>(&ESP8266WiFiClass::_smartConfigCallback), 1);
602+
smartconfig_start(reinterpret_cast<sc_callback_t>(&ESP8266WiFiClass::_smartConfigCallback), 1);
603603
}
604604

605605
void ESP8266WiFiClass::stopSmartConfig()

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ compiler.S.flags=-c -g -x assembler-with-cpp -MMD
2424
compiler.c.elf.flags=-g -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-T{build.flash_ld}" -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy
2525

2626
compiler.c.elf.cmd=xtensa-lx106-elf-gcc
27-
compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig
27+
compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig -lwps
2828

2929
compiler.cpp.cmd=xtensa-lx106-elf-g++
3030
compiler.cpp.flags=-c -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD

tools/sdk/changelog.txt

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1+
esp_iot_sdk_v1.2.0_15_07_03 Release Note
2+
-------------------------------------------
3+
Resolved Issues(Bugs below are eligible for Bug Bounty Program):
4+
1.TLS server disconnect to ESP8266 may cause crash. [孙新虎]
5+
6+
Optimization:
7+
1.Update SmartConfig to version 2.4 , corresponding to ESPTOUCH APP v0.3.4 (https://github.com/EspressifApp/), delete parameter "sc_type type" in smartconfig_start, SmartConfig type can be got automatically.
8+
2.Add parameter "sint16 freq_offset; " in structure "bss_info" to get AP's frequency offset.
9+
3.Folder "ld" is updated, please use the latest one (\esp_iot_sdk_v1.2.0\ld )
10+
4.Add UDP transparent transmission example in documentation "4B-ESP8266__AT Command Examples"
11+
5.Revise the scan issue that may cause Wi-Fi connection break.
12+
6.Add ESP-NOW function, more details in "Add APIs"
13+
7.Add WPS function,more details in "Add APIs"
14+
8.Fixed a DNS fail issue with special router
15+
9.Optimize espconn,revise issues below:
16+
(1) enter sent callback late in UDP transmission
17+
(2) TCP shakehand may fail issue
18+
(3) SSL connection fail may cause crash
19+
(4) optimize SSL error handler
20+
10. Memory optimization
21+
22+
Add APIs:
23+
1.ESP-NOW APIs
24+
esp_now_init: init ESP-NOW function
25+
esp_now_deinit: deinit ESP-NOW function
26+
esp_now_register_recv_cb: register ESP-NOW receive callback
27+
esp_now_unregister_recv_cb: unregister ESP-NOW receive callback
28+
esp_now_send: send ESP-NOW packet
29+
esp_now_add_peer: add an ESP-NOW peer
30+
esp_now_del_peer: delete an ESP-NOW peer
31+
esp_now_set_self_role: set ESP-NOW role of device itself
32+
esp_now_get_self_role: get ESP-NOW role of device itself
33+
esp_now_set_peer_role: set ESP-NOW role about another device
34+
esp_now_get_peer_role: get ESP-NOW role about another device
35+
esp_now_set_peer_key: set ESP-NOW key of a device
36+
esp_now_get_peer_key: get ESP-NOW key of a device
37+
38+
2. WPS APIs
39+
wifi_wps_enable : enable WPS function
40+
wifi_wps_disable: disable WPS function
41+
wifi_wps_start: start WPS communication
42+
wifi_set_wps_cb: set WPS callback
43+
44+
3.software watchdog APIs
45+
system_soft_wdt_stop: stop software watchdog
46+
system_soft_wdt_restart: restart software watchdog
47+
48+
4.sntp_get_timezone: get SNTP timezone
49+
50+
AT_v0.30 Release Note:
51+
Note: For AT firmware to support FOTA, flash size need to be 1024KB or more than that.
52+
53+
1.Command "AT+CWSTARTSMART" need not parameter any more, SmartConfig type can be got automatically.
54+
2.AP's frequency offset can be got by command "AT+CWLAP"
55+
3.Memory optimization
56+
57+
58+
59+
160
esp_iot_sdk_1.1.2_15_06_25_p2 Release Note
261
-------------------------------------------
362

tools/sdk/include/eagle_soc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,11 @@
300300

301301
#define PIN_PULLUP_DIS(PIN_NAME) CLEAR_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLUP)
302302
#define PIN_PULLUP_EN(PIN_NAME) SET_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLUP)
303-
#define PIN_PULLDWN_DIS(PIN_NAME) CLEAR_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLDWN)
304-
#define PIN_PULLDWN_EN(PIN_NAME) SET_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLDWN)
305303
#define PIN_FUNC_SELECT(PIN_NAME, FUNC) do { \
306-
CLEAR_PERI_REG_MASK(PIN_NAME, (PERIPHS_IO_MUX_FUNC<<PERIPHS_IO_MUX_FUNC_S)); \
307-
SET_PERI_REG_MASK(PIN_NAME, (((FUNC&BIT2)<<2)|(FUNC&0x3))<<PERIPHS_IO_MUX_FUNC_S); \
304+
WRITE_PERI_REG(PIN_NAME, \
305+
READ_PERI_REG(PIN_NAME) \
306+
& (~(PERIPHS_IO_MUX_FUNC<<PERIPHS_IO_MUX_FUNC_S)) \
307+
|( (((FUNC&BIT2)<<2)|(FUNC&0x3))<<PERIPHS_IO_MUX_FUNC_S) ); \
308308
} while (0)
309309

310310
//}}

tools/sdk/include/espnow.h

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright (C) 2015 -2018 Espressif System
3+
*
4+
*/
5+
6+
#ifndef __ESPNOW_H__
7+
#define __ESPNOW_H__
8+
9+
enum esp_now_role {
10+
ESP_NOW_ROLE_IDLE = 0,
11+
ESP_NOW_ROLE_CONTROLLER,
12+
ESP_NOW_ROLE_SLAVE,
13+
ESP_NOW_ROLE_MAX,
14+
};
15+
16+
typedef void (*esp_now_cb_t)(u8 *mac_addr, u8 *data, u8 len);
17+
18+
int esp_now_init(void);
19+
int esp_now_deinit(void);
20+
21+
int esp_now_register_recv_cb(esp_now_cb_t cb);
22+
int esp_now_unregister_recv_cb(void);
23+
24+
int esp_now_send(u8 *da, u8 *data, int len);
25+
26+
int esp_now_add_peer(u8 *mac_addr, u8 role, u8 channel, u8 *key, u8 key_len);
27+
int esp_now_del_peer(u8 *mac_addr);
28+
29+
int esp_now_set_self_role(u8 role);
30+
int esp_now_get_self_role(void);
31+
32+
int esp_now_set_peer_role(u8 *mac_addr, u8 role);
33+
int esp_now_get_peer_role(u8 *mac_addr);
34+
35+
int esp_now_set_peer_channel(u8 *mac_addr, u8 channel);
36+
int esp_now_get_peer_channel(u8 *mac_addr);
37+
38+
int esp_now_set_peer_key(u8 *mac_addr, u8 *key, u8 key_len);
39+
int esp_now_get_peer_key(u8 *mac_addr, u8 *key, u8 *key_len);
40+
41+
u8 *esp_now_fetch_peer(bool restart);
42+
43+
int esp_now_is_peer_exist(u8 *mac_addr);
44+
45+
int esp_now_get_cnt_info(u8 *all_cnt, u8 *encrypt_cnt);
46+
47+
#endif

tools/sdk/include/ets_sys.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@ inline uint32_t ETS_INTR_PENDING(void)
9191
#define ETS_FRC_TIMER1_NMI_INTR_ATTACH(func) \
9292
NmiTimSetFunc(func)
9393

94-
#define ETS_FRC1_INTR_ENABLE() \
95-
ETS_INTR_ENABLE(ETS_FRC_TIMER1_INUM)
96-
97-
#define ETS_FRC1_INTR_DISABLE() \
98-
ETS_INTR_DISABLE(ETS_FRC_TIMER1_INUM)
99-
100-
10194
#define ETS_GPIO_INTR_ATTACH(func, arg) \
10295
ets_isr_attach(ETS_GPIO_INUM, (int_handler_t)(func), (void *)(arg))
10396

@@ -117,6 +110,12 @@ inline uint32_t ETS_INTR_PENDING(void)
117110
#define ETS_UART_INTR_DISABLE() \
118111
ETS_INTR_DISABLE(ETS_UART_INUM)
119112

113+
#define ETS_FRC1_INTR_ENABLE() \
114+
ETS_INTR_ENABLE(ETS_FRC_TIMER1_INUM)
115+
116+
#define ETS_FRC1_INTR_DISABLE() \
117+
ETS_INTR_DISABLE(ETS_FRC_TIMER1_INUM)
118+
120119

121120
#define ETS_SPI_INTR_ATTACH(func, arg) \
122121
ets_isr_attach(ETS_SPI_INUM, (int_handler_t)(func), (void *)(arg))

tools/sdk/include/pwm.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#ifndef __PWM_H__
2+
#define __PWM_H__
3+
4+
/*pwm.h: function and macro definition of PWM API , driver level */
5+
/*user_light.h: user interface for light API, user level*/
6+
/*user_light_adj: API for color changing and lighting effects, user level*/
7+
8+
9+
/*NOTE!! : DO NOT CHANGE THIS FILE*/
10+
11+
/*SUPPORT UP TO 8 PWM CHANNEL*/
12+
#define PWM_CHANNEL_NUM_MAX 8
13+
14+
struct pwm_param {
15+
uint32 period;
16+
uint32 freq;
17+
uint32 duty[PWM_CHANNEL_NUM_MAX]; //PWM_CHANNEL<=8
18+
};
19+
20+
21+
/* pwm_init should be called only once, for now */
22+
void pwm_init(uint32 period, uint32 *duty,uint32 pwm_channel_num,uint32 (*pin_info_list)[3]);
23+
void pwm_start(void);
24+
25+
void pwm_set_duty(uint32 duty, uint8 channel);
26+
uint32 pwm_get_duty(uint8 channel);
27+
void pwm_set_period(uint32 period);
28+
uint32 pwm_get_period(void);
29+
30+
uint32 get_pwm_version(void);
31+
void set_pwm_debug_en(uint8 print_en);
32+
33+
#endif
34+

tools/sdk/include/smartconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ typedef enum {
2222
typedef void (*sc_callback_t)(sc_status status, void *pdata);
2323

2424
const char *smartconfig_get_version(void);
25-
bool smartconfig_start(sc_type type, sc_callback_t cb, ...);
25+
bool smartconfig_start(sc_callback_t cb, ...);
2626
bool smartconfig_stop(void);
2727
bool esptouch_set_timeout(uint8 time_s); //15s~255s, offset:45s
2828

tools/sdk/include/sntp.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ uint32 sntp_get_current_timestamp();
1515
* get real time (GTM + 8 time zone)
1616
*/
1717
char* sntp_get_real_time(long t);
18+
/**
19+
* SNTP get time_zone default GMT + 8
20+
*/
21+
sint8 sntp_get_timezone(void);
1822
/**
1923
* SNTP set time_zone (default GMT + 8)
2024
*/

tools/sdk/include/user_interface.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ void system_phy_set_rfoption(uint8 option);
135135
bool system_param_save_with_protect(uint16 start_sec, void *param, uint16 len);
136136
bool system_param_load(uint16 start_sec, uint16 offset, void *param, uint16 len);
137137

138+
void system_soft_wdt_stop(void);
139+
void system_soft_wdt_restart(void);
140+
138141
#define NULL_MODE 0x00
139142
#define STATION_MODE 0x01
140143
#define SOFTAP_MODE 0x02
@@ -165,6 +168,7 @@ struct bss_info {
165168
sint8 rssi;
166169
AUTH_MODE authmode;
167170
uint8 is_hidden;
171+
sint16 freq_offset;
168172
};
169173

170174
typedef struct _scaninfo {
@@ -235,6 +239,9 @@ bool wifi_station_dhcpc_start(void);
235239
bool wifi_station_dhcpc_stop(void);
236240
enum dhcp_status wifi_station_dhcpc_status(void);
237241

242+
char* wifi_station_get_hostname(void);
243+
bool wifi_station_set_hostname(char *name);
244+
238245
struct softap_config {
239246
uint8 ssid[32];
240247
uint8 password[64];
@@ -415,4 +422,25 @@ typedef void (* wifi_event_handler_cb_t)(System_Event_t *event);
415422

416423
void wifi_set_event_handler_cb(wifi_event_handler_cb_t cb);
417424

425+
typedef enum wps_type {
426+
WPS_TYPE_DISABLE = 0,
427+
WPS_TYPE_PBC,
428+
WPS_TYPE_PIN,
429+
WPS_TYPE_DISPLAY,
430+
WPS_TYPE_MAX,
431+
} WPS_TYPE_t;
432+
433+
enum wps_cb_status {
434+
WPS_CB_ST_SUCCESS = 0,
435+
WPS_CB_ST_FAILED,
436+
WPS_CB_ST_TIMEOUT,
437+
};
438+
439+
bool wifi_wps_enable(WPS_TYPE_t wps_type);
440+
bool wifi_wps_disable(void);
441+
bool wifi_wps_start(void);
442+
443+
typedef void (*wps_st_cb_t)(int status);
444+
bool wifi_set_wps_cb(wps_st_cb_t cb);
445+
418446
#endif

tools/sdk/lib/libat.a

201 KB
Binary file not shown.

tools/sdk/lib/libcrypto.a

53.8 KB
Binary file not shown.

tools/sdk/lib/libespnow.a

26.1 KB
Binary file not shown.

tools/sdk/lib/libjson.a

116 Bytes
Binary file not shown.

tools/sdk/lib/liblwip.a

6.57 KB
Binary file not shown.

tools/sdk/lib/liblwip_536.a

304 KB
Binary file not shown.

tools/sdk/lib/libmain.a

3.81 KB
Binary file not shown.

tools/sdk/lib/libnet80211.a

24.9 KB
Binary file not shown.

tools/sdk/lib/libpp.a

22.7 KB
Binary file not shown.

tools/sdk/lib/libpwm.a

27.6 KB
Binary file not shown.

tools/sdk/lib/libsmartconfig.a

2.46 KB
Binary file not shown.

tools/sdk/lib/libssl.a

1.24 KB
Binary file not shown.

tools/sdk/lib/libupgrade.a

8 Bytes
Binary file not shown.

tools/sdk/lib/libwpa.a

2.57 KB
Binary file not shown.

tools/sdk/lib/libwps.a

209 KB
Binary file not shown.

tools/sdk/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.2_15_06_25_p2
1+
1.2.0_15_07_03

0 commit comments

Comments
 (0)