Skip to content

[WIP] Update SDK to 2.0.0 (#2304) #2317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion cores/esp8266/core_esp8266_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct rst_info resetInfo;

extern "C" {
extern const uint32_t __attribute__((section(".ver_number"))) core_version = ARDUINO_ESP8266_GIT_VER;
const char* core_release =
const char* core_release =
#ifdef ARDUINO_ESP8266_RELEASE
ARDUINO_ESP8266_RELEASE;
#else
Expand Down Expand Up @@ -171,3 +171,34 @@ extern "C" void user_init(void) {

system_init_done_cb(&init_done);
}

extern "C" uint32 ICACHE_FLASH_ATTR user_rf_cal_sector_set(void) {
enum flash_size_map size_map = system_get_flash_size_map();
uint32 rf_cal_sec = 0;

switch (size_map) {
case FLASH_SIZE_4M_MAP_256_256:
rf_cal_sec = 128 - 5;
break;

case FLASH_SIZE_8M_MAP_512_512:
rf_cal_sec = 256 - 5;
break;

case FLASH_SIZE_16M_MAP_512_512:
case FLASH_SIZE_16M_MAP_1024_1024:
rf_cal_sec = 512 - 5;
break;

case FLASH_SIZE_32M_MAP_512_512:
case FLASH_SIZE_32M_MAP_1024_1024:
rf_cal_sec = 1024 - 5;
break;

default:
rf_cal_sec = 0;
break;
}

return rf_cal_sec;
}
9 changes: 9 additions & 0 deletions tools/sdk/include/c_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@
#include <stdarg.h>
#include <sys/cdefs.h>

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 int uint32_t;
typedef signed long sint32_t;
typedef signed int 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;
Expand Down Expand Up @@ -41,6 +48,8 @@ typedef double real64;

#define __le16 u16

typedef unsigned int size_t;

#define LOCAL static

#ifndef NULL
Expand Down
5 changes: 5 additions & 0 deletions tools/sdk/include/eagle_soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@
//RTC reg {{
#define REG_RTC_BASE PERIPHS_RTC_BASEADDR

#define RTC_STORE0 (REG_RTC_BASE + 0x030)
#define RTC_STORE1 (REG_RTC_BASE + 0x034)
#define RTC_STORE2 (REG_RTC_BASE + 0x038)
#define RTC_STORE3 (REG_RTC_BASE + 0x03C)

#define RTC_GPIO_OUT (REG_RTC_BASE + 0x068)
#define RTC_GPIO_ENABLE (REG_RTC_BASE + 0x074)
#define RTC_GPIO_IN_DATA (REG_RTC_BASE + 0x08C)
Expand Down
1 change: 1 addition & 0 deletions tools/sdk/include/espnow.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ enum esp_now_role {
ESP_NOW_ROLE_IDLE = 0,
ESP_NOW_ROLE_CONTROLLER,
ESP_NOW_ROLE_SLAVE,
ESP_NOW_ROLE_COMBO,
ESP_NOW_ROLE_MAX,
};

Expand Down
45 changes: 45 additions & 0 deletions tools/sdk/include/simple_pair.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2015 -2018 Espressif System
*
*/

#ifndef __SIMPLE_PAIR_H__
#define __SIMPLE_PAIR_H__

typedef enum {
SP_ST_STA_FINISH = 0,
SP_ST_AP_FINISH = 0,
SP_ST_AP_RECV_NEG,
SP_ST_STA_AP_REFUSE_NEG,
/* all following is err */
SP_ST_WAIT_TIMEOUT,
SP_ST_SEND_ERROR,
SP_ST_KEY_INSTALL_ERR,
SP_ST_KEY_OVERLAP_ERR, //means the same macaddr has two different keys
SP_ST_OP_ERROR,
SP_ST_UNKNOWN_ERROR,
SP_ST_MAX,
} SP_ST_t;


typedef void (*simple_pair_status_cb_t)(u8 *sa, u8 status);

int register_simple_pair_status_cb(simple_pair_status_cb_t cb);
void unregister_simple_pair_status_cb(void);

int simple_pair_init(void);
void simple_pair_deinit(void);

int simple_pair_state_reset(void);
int simple_pair_ap_enter_announce_mode(void);
int simple_pair_sta_enter_scan_mode(void);

int simple_pair_sta_start_negotiate(void);
int simple_pair_ap_start_negotiate(void);
int simple_pair_ap_refuse_negotiate(void);

int simple_pair_set_peer_ref(u8 *peer_mac, u8 *tmp_key, u8 *ex_key);
int simple_pair_get_peer_ref(u8 *peer_mac, u8 *tmp_key, u8 *ex_key);


#endif /* __SIMPLE_PAIR_H__ */
5 changes: 5 additions & 0 deletions tools/sdk/include/user_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "queue.h"
#include "user_config.h"
#include "spi_flash.h"
#include "gpio.h"

#ifndef MAC2STR
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
Expand Down Expand Up @@ -178,6 +179,7 @@ typedef struct bss_info {
sint16 freq_offset;
sint16 freqcal_val;
uint8 *esp_mesh_ie;
uint8 simple_pair;
} bss_info_t;

typedef struct _scaninfo {
Expand Down Expand Up @@ -605,4 +607,7 @@ bool wifi_set_user_ie(bool enable, uint8 *m_oui, uint8 type, uint8 *user_ie, uin
int wifi_register_user_ie_manufacturer_recv_cb(user_ie_manufacturer_recv_cb_t cb);
void wifi_unregister_user_ie_manufacturer_recv_cb(void);

void wifi_enable_gpio_wakeup(uint32 i, GPIO_INT_TYPE intr_status);
void wifi_disable_gpio_wakeup(void);

#endif
38 changes: 38 additions & 0 deletions tools/sdk/include/wpa2_enterprise.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifndef __WPA2_ENTERPRISE_H__
#define __WPA2_ENTERPRISE_H__

typedef long os_time_t;

struct os_time {
os_time_t sec;
os_time_t usec;
};

typedef int (* get_time_func_t)(struct os_time *t);

int wifi_station_set_wpa2_enterprise_auth(int enable);

int wifi_station_set_enterprise_cert_key(u8 *client_cert, int client_cert_len,
u8 *private_key, int private_key_len,
u8 *private_key_passwd, int private_key_passwd_len);
void wifi_station_clear_enterprise_cert_key(void);

int wifi_station_set_enterprise_ca_cert(u8 *ca_cert, int ca_cert_len);
void wifi_station_clear_enterprise_ca_cert(void);

int wifi_station_set_enterprise_username(u8 *username, int len);
void wifi_station_clear_enterprise_username(void);

int wifi_station_set_enterprise_password(u8 *password, int len);
void wifi_station_clear_enterprise_password(void);

int wifi_station_set_enterprise_new_password(u8 *new_password, int len);
void wifi_station_clear_enterprise_new_password(void);

void wifi_station_set_enterprise_disable_time_check(bool disable);
bool wifi_station_get_enterprise_disable_time_check(void);

void wpa2_enterprise_set_user_get_time(get_time_func_t cb);


#endif /* __WPA2_ENTERPRISE_H__ */
1 change: 1 addition & 0 deletions tools/sdk/ld/eagle.app.v6.common.ld
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ SECTIONS
*libgcc.a:_umoddi3.o(.literal .text)
*libgcc.a:_udivdi3.o(.literal .text)
*libsmartconfig.a:(.literal .text .literal.* .text.*)
*libmbedtls.a:(.literal .text .literal.* .text.*)
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text .irom.text.*)
_irom0_text_end = ABSOLUTE(.);
_flash_code_end = ABSOLUTE(.);
Expand Down
1 change: 1 addition & 0 deletions tools/sdk/ld/eagle.rom.addr.v6.ld
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ PROVIDE ( SPI_read_status = 0x400043c8 );
PROVIDE ( SPI_write_status = 0x40004400 );
PROVIDE ( SPI_write_enable = 0x4000443c );
PROVIDE ( Wait_SPI_Idle = 0x4000448c );
PROVIDE ( Enable_QMode = 0x400044c0 );
PROVIDE ( SPIEraseArea = 0x40004b44 );
PROVIDE ( SPIEraseBlock = 0x400049b4 );
PROVIDE ( SPIEraseChip = 0x40004984 );
Expand Down
Empty file modified tools/sdk/lib/libairkiss.a
100644 → 100755
Empty file.
Binary file modified tools/sdk/lib/libat.a
100644 → 100755
Binary file not shown.
Binary file modified tools/sdk/lib/libcrypto.a
100644 → 100755
Binary file not shown.
Binary file added tools/sdk/lib/libdriver.a
Binary file not shown.
Binary file modified tools/sdk/lib/libespnow.a
100644 → 100755
Binary file not shown.
Binary file added tools/sdk/lib/libgcc.a
Binary file not shown.
Binary file modified tools/sdk/lib/libjson.a
100644 → 100755
Binary file not shown.
Binary file modified tools/sdk/lib/liblwip.a
100644 → 100755
Binary file not shown.
Binary file added tools/sdk/lib/liblwip_536.a
Binary file not shown.
Binary file modified tools/sdk/lib/libmain.a
100644 → 100755
Binary file not shown.
Binary file modified tools/sdk/lib/libmesh.a
100644 → 100755
Binary file not shown.
Binary file modified tools/sdk/lib/libnet80211.a
100644 → 100755
Binary file not shown.
Binary file modified tools/sdk/lib/libphy.a
Binary file not shown.
Binary file modified tools/sdk/lib/libpp.a
100644 → 100755
Binary file not shown.
Binary file modified tools/sdk/lib/libsmartconfig.a
100644 → 100755
Binary file not shown.
Binary file modified tools/sdk/lib/libssl.a
100644 → 100755
Binary file not shown.
Binary file modified tools/sdk/lib/libupgrade.a
100644 → 100755
Binary file not shown.
Binary file modified tools/sdk/lib/libwpa.a
100644 → 100755
Binary file not shown.
Binary file modified tools/sdk/lib/libwpa2.a
100644 → 100755
Binary file not shown.
Binary file modified tools/sdk/lib/libwps.a
100644 → 100755
Binary file not shown.