diff --git a/hardware/arduino/esp8266/platform.txt b/hardware/arduino/esp8266/platform.txt index 171b2d30c..ab9179bcd 100644 --- a/hardware/arduino/esp8266/platform.txt +++ b/hardware/arduino/esp8266/platform.txt @@ -20,7 +20,7 @@ compiler.c.flags=-c -Os -Wpointer-arith -Wno-implicit-function-declaration -Wl,- compiler.c.elf.ldscript=eagle.app.v6.ld compiler.c.elf.flags=-nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -L{compiler.sdk.path}/lib -L{compiler.sdk.path}/ld -T{compiler.c.elf.ldscript} compiler.c.elf.cmd=xtensa-lx106-elf-gcc -compiler.c.elf.libs=-lc -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain +compiler.c.elf.libs=-lc -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp compiler.cpp.cmd=xtensa-lx106-elf-g++ compiler.cpp.flags=-c -Os -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -std=c++11 -MMD diff --git a/hardware/tools/esp8266/sdk/include/c_types.h b/hardware/tools/esp8266/sdk/include/c_types.h index 5e2410e22..e6c450cdf 100755 --- a/hardware/tools/esp8266/sdk/include/c_types.h +++ b/hardware/tools/esp8266/sdk/include/c_types.h @@ -6,18 +6,12 @@ #ifndef _C_TYPES_H_ #define _C_TYPES_H_ #include +#include -// typedef unsigned char uint8_t; typedef signed char sint8_t; -// typedef signed char int8_t; -// typedef unsigned short uint16_t; typedef signed short sint16_t; -// typedef signed short int16_t; -// typedef unsigned long uint32_t; typedef signed long sint32_t; -// typedef signed long int32_t; typedef signed long long sint64_t; -// typedef unsigned long long uint64_t; typedef unsigned long long u_int64_t; typedef float real32_t; typedef double real64_t; @@ -45,8 +39,6 @@ typedef double real64; #define __le16 u16 -//typedef unsigned int size_t; - #define __packed __attribute__((packed)) #define LOCAL static @@ -78,5 +70,12 @@ typedef enum { #define ICACHE_FLASH_ATTR #endif /* ICACHE_FLASH */ +#ifndef __cplusplus +#define BOOL bool +#define TRUE true +#define FALSE false + + +#endif /* !__cplusplus */ #endif /* _C_TYPES_H_ */ diff --git a/hardware/tools/esp8266/sdk/include/user_interface.h b/hardware/tools/esp8266/sdk/include/user_interface.h index 28a9391b9..f261735b2 100755 --- a/hardware/tools/esp8266/sdk/include/user_interface.h +++ b/hardware/tools/esp8266/sdk/include/user_interface.h @@ -22,6 +22,22 @@ #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" #endif +enum rst_reason { + DEFAULT_RST_FLAG = 0, + WDT_RST_FLAG = 1, + EXP_RST_FLAG = 2 +}; + +struct rst_info{ + uint32 flag; + uint32 exccause; + uint32 epc1; + uint32 epc2; + uint32 epc3; + uint32 excvaddr; + uint32 depc; +}; + #define UPGRADE_FW_BIN1 0x00 #define UPGRADE_FW_BIN2 0x01 @@ -79,6 +95,16 @@ typedef void (* init_done_cb_t)(void); void system_init_done_cb(init_done_cb_t cb); +uint32 system_rtc_clock_cali_proc(void); +uint32 system_get_rtc_time(void); + +bool system_rtc_mem_read(uint8 src_addr, void *des_addr, uint16 load_size); +bool system_rtc_mem_write(uint8 des_addr, const void *src_addr, uint16 save_size); + +void system_uart_swap(void); + +uint16 system_adc_read(void); + #define NULL_MODE 0x00 #define STATION_MODE 0x01 #define SOFTAP_MODE 0x02 @@ -90,20 +116,21 @@ bool wifi_set_opmode(uint8 opmode); struct bss_info { STAILQ_ENTRY(bss_info) next; - u8 bssid[6]; - u8 ssid[32]; - u8 channel; - s8 rssi; - u8 authmode; + uint8 bssid[6]; + uint8 ssid[32]; + uint8 channel; + sint8 rssi; + uint8 authmode; + uint8 is_hidden; }; typedef struct _scaninfo { STAILQ_HEAD(, bss_info) *pbss; struct espconn *pespconn; - u8 totalpage; - u8 pagenum; - u8 page_sn; - u8 data_cnt; + uint8 totalpage; + uint8 pagenum; + uint8 page_sn; + uint8 data_cnt; } scaninfo; typedef void (* scan_done_cb_t)(void *arg, STATUS status); @@ -111,6 +138,8 @@ typedef void (* scan_done_cb_t)(void *arg, STATUS status); struct station_config { uint8 ssid[32]; uint8 password[64]; + uint8 bssid_set; + uint8 bssid[6]; }; bool wifi_station_get_config(struct station_config *config); @@ -123,6 +152,7 @@ struct scan_config { uint8 *ssid; uint8 *bssid; uint8 channel; + uint8 show_hidden; }; bool wifi_station_scan(struct scan_config *config, scan_done_cb_t cb); @@ -141,6 +171,13 @@ enum { uint8 wifi_station_get_connect_status(void); +uint8 wifi_station_get_current_ap_id(void); +bool wifi_station_ap_change(uint8 current_ap_id); +bool wifi_station_ap_number_set(uint8 ap_number); + +bool wifi_station_dhcpc_start(void); +bool wifi_station_dhcpc_stop(void); + typedef enum _auth_mode { AUTH_OPEN = 0, AUTH_WEP, @@ -152,6 +189,7 @@ typedef enum _auth_mode { struct softap_config { uint8 ssid[32]; uint8 password[64]; + uint8 ssid_len; uint8 channel; uint8 authmode; uint8 ssid_hidden; @@ -168,9 +206,18 @@ struct station_info { struct ip_addr ip; }; +struct dhcps_lease { + uint32 start_ip; + uint32 end_ip; +}; + struct station_info * wifi_softap_get_station_info(void); void wifi_softap_free_station_info(void); +bool wifi_softap_dhcps_start(void); +bool wifi_softap_dhcps_stop(void); +bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please); + #define STATION_IF 0x00 #define SOFTAP_IF 0x01 @@ -194,8 +241,13 @@ typedef void (* wifi_promiscuous_cb_t)(uint8 *buf, uint16 len); void wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb); -uint8 wifi_station_get_current_ap_id(void); -bool wifi_station_ap_change(uint8 current_ap_id); -bool wifi_station_ap_number_set(uint8 ap_number); +enum phy_mode { + PHY_MODE_11B = 1, + PHY_MODE_11G = 2, + PHY_MODE_11N = 3 +}; + +enum phy_mode wifi_get_phy_mode(void); +bool wifi_set_phy_mode(enum phy_mode mode); #endif diff --git a/hardware/tools/esp8266/sdk/include/version.h b/hardware/tools/esp8266/sdk/include/version.h index 4d13b458f..f6866a012 100755 --- a/hardware/tools/esp8266/sdk/include/version.h +++ b/hardware/tools/esp8266/sdk/include/version.h @@ -3,7 +3,7 @@ #define SDK_VERSION_MAJOR 0U #define SDK_VERSION_MINOR 9U -#define SDK_VERSION_REVISION 2U +#define SDK_VERSION_REVISION 3U #define SDK_VERSION_INTERNAL 0U #define SDK_VERSION (SDK_VERSION_MAJOR << 16 | SDK_VERSION_MINOR << 8 | SDK_VERSION_REVISION) diff --git a/hardware/tools/esp8266/sdk/ld/eagle.rom.addr.v6.ld b/hardware/tools/esp8266/sdk/ld/eagle.rom.addr.v6.ld index d72e7be00..c61f176a7 100755 --- a/hardware/tools/esp8266/sdk/ld/eagle.rom.addr.v6.ld +++ b/hardware/tools/esp8266/sdk/ld/eagle.rom.addr.v6.ld @@ -16,6 +16,7 @@ PROVIDE ( SHA1Final = 0x4000b648 ); PROVIDE ( SHA1Init = 0x4000b584 ); PROVIDE ( SHA1Transform = 0x4000a364 ); PROVIDE ( SHA1Update = 0x4000b5a8 ); +PROVIDE ( Wait_SPI_Idle = 0x4000448c ); PROVIDE ( SPIEraseArea = 0x40004b44 ); PROVIDE ( SPIEraseBlock = 0x400049b4 ); PROVIDE ( SPIEraseChip = 0x40004984 ); diff --git a/hardware/tools/esp8266/sdk/lib/liblwip.a b/hardware/tools/esp8266/sdk/lib/liblwip.a index 887d7c4b1..794a84a69 100755 Binary files a/hardware/tools/esp8266/sdk/lib/liblwip.a and b/hardware/tools/esp8266/sdk/lib/liblwip.a differ diff --git a/hardware/tools/esp8266/sdk/lib/libmain.a b/hardware/tools/esp8266/sdk/lib/libmain.a index 93aec3a47..f552fff2d 100755 Binary files a/hardware/tools/esp8266/sdk/lib/libmain.a and b/hardware/tools/esp8266/sdk/lib/libmain.a differ diff --git a/hardware/tools/esp8266/sdk/lib/libnet80211.a b/hardware/tools/esp8266/sdk/lib/libnet80211.a index c5aca6bd5..63d443738 100755 Binary files a/hardware/tools/esp8266/sdk/lib/libnet80211.a and b/hardware/tools/esp8266/sdk/lib/libnet80211.a differ diff --git a/hardware/tools/esp8266/sdk/lib/libphy.a b/hardware/tools/esp8266/sdk/lib/libphy.a index 914840248..5679e419c 100755 Binary files a/hardware/tools/esp8266/sdk/lib/libphy.a and b/hardware/tools/esp8266/sdk/lib/libphy.a differ diff --git a/hardware/tools/esp8266/sdk/lib/libpp.a b/hardware/tools/esp8266/sdk/lib/libpp.a new file mode 100755 index 000000000..13dafb7da Binary files /dev/null and b/hardware/tools/esp8266/sdk/lib/libpp.a differ diff --git a/hardware/tools/esp8266/sdk/lib/libssl.a b/hardware/tools/esp8266/sdk/lib/libssl.a index f1a299e90..a51d04a61 100755 Binary files a/hardware/tools/esp8266/sdk/lib/libssl.a and b/hardware/tools/esp8266/sdk/lib/libssl.a differ diff --git a/hardware/tools/esp8266/sdk/lib/libwpa.a b/hardware/tools/esp8266/sdk/lib/libwpa.a index 0f593c6c0..dcf924897 100755 Binary files a/hardware/tools/esp8266/sdk/lib/libwpa.a and b/hardware/tools/esp8266/sdk/lib/libwpa.a differ diff --git a/hardware/tools/esp8266/sdk/version b/hardware/tools/esp8266/sdk/version index f76f91317..b3ec1638f 100644 --- a/hardware/tools/esp8266/sdk/version +++ b/hardware/tools/esp8266/sdk/version @@ -1 +1 @@ -0.9.2 \ No newline at end of file +0.9.3 \ No newline at end of file