Preprocess all binary SDK symbols to add an sdk_ prefix
* This fixes the problem of axTLS symbols hmac_md5/hmac_sha1 having same name as symbols in libwpa (which have incompatible signatures) * Also allows for easier identification and piece-by-piece removal of binary functions. * Some libc symbols are not renamed, list is in lib/symbols_norename.txt
This commit is contained in:
parent
05019cb0ee
commit
e743d03a78
19 changed files with 220 additions and 103 deletions
33
include/esp8266.h
Normal file
33
include/esp8266.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/* esp8266.h
|
||||
*
|
||||
* ESP-specific SoC-level addresses, macros, etc.
|
||||
* Part of esp-open-rtos
|
||||
*
|
||||
* Copyright (C) 2105 Superhouse Automation Pty Ltd
|
||||
* BSD Licensed as described in the file LICENSE
|
||||
*/
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef _ESP8266_H
|
||||
#define _ESP8266_H
|
||||
|
||||
/* Use this macro to store constant values in IROM flash instead
|
||||
of having them loaded into rodata (which resides in DRAM)
|
||||
|
||||
Unlike the ESP8266 SDK you don't need an attribute like this for
|
||||
standard functions. They're stored in flash by default. But
|
||||
variables need them.
|
||||
|
||||
Important to note: IROM flash can only be accessed via 32-bit word
|
||||
aligned reads. It's up to the user of this attribute to ensure this.
|
||||
*/
|
||||
#define IROM __attribute__((section(".irom0"))) const
|
||||
|
||||
|
||||
/* Register addresses
|
||||
|
||||
ESPTODO: break this out to its own header file and clean it up, add other regs, etc.
|
||||
*/
|
||||
static volatile __attribute__((unused)) uint32_t *ESP_REG_WDT = (uint32_t *)0x60000900;
|
||||
|
||||
#endif
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
#define IPSTR "%d.%d.%d.%d"
|
||||
|
||||
void os_delay_us(uint16_t us);
|
||||
void sdk_os_delay_us(uint16_t us);
|
||||
|
||||
void os_install_putc1(void (*p)(char c));
|
||||
void os_putc(char c);
|
||||
void sdk_os_install_putc1(void (*p)(char c));
|
||||
void sdk_os_putc(char c);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#ifndef __ESP_SOFTAP_H__
|
||||
#define __ESP_SOFTAP_H__
|
||||
|
||||
struct softap_config {
|
||||
struct sdk_softap_config {
|
||||
uint8_t ssid[32];
|
||||
uint8_t password[64];
|
||||
uint8_t ssid_len;
|
||||
|
@ -17,7 +17,7 @@ struct softap_config {
|
|||
uint16_t beacon_interval;
|
||||
};
|
||||
|
||||
bool wifi_softap_get_config(struct softap_config *config);
|
||||
bool wifi_softap_set_config(struct softap_config *config);
|
||||
bool sdk_wifi_softap_get_config(struct sdk_softap_config *config);
|
||||
bool sdk_wifi_softap_set_config(struct sdk_softap_config *config);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/*
|
||||
* Copyright (C) 2013 -2014 Espressif System
|
||||
*
|
||||
*
|
||||
* Adapted from BSD licensed esp_iot_rtos_sdk v0.9.9
|
||||
*/
|
||||
|
||||
#ifndef __ESP_STA_H__
|
||||
|
@ -8,27 +10,27 @@
|
|||
|
||||
#include "queue.h"
|
||||
|
||||
struct station_config {
|
||||
struct sdk_station_config {
|
||||
uint8_t ssid[32];
|
||||
uint8_t password[64];
|
||||
uint8_t bssid_set;
|
||||
uint8_t bssid[6];
|
||||
};
|
||||
|
||||
bool wifi_station_get_config(struct station_config *config);
|
||||
bool wifi_station_set_config(struct station_config *config);
|
||||
bool sdk_wifi_station_get_config(struct sdk_station_config *config);
|
||||
bool sdk_wifi_station_set_config(struct sdk_station_config *config);
|
||||
|
||||
bool wifi_station_connect(void);
|
||||
bool wifi_station_disconnect(void);
|
||||
bool sdk_wifi_station_connect(void);
|
||||
bool sdk_wifi_station_disconnect(void);
|
||||
|
||||
struct scan_config {
|
||||
struct sdk_scan_config {
|
||||
uint8_t *ssid;
|
||||
uint8_t *bssid;
|
||||
uint8_t channel;
|
||||
uint8_t show_hidden;
|
||||
};
|
||||
|
||||
struct bss_info {
|
||||
struct sdk_bss_info {
|
||||
STAILQ_ENTRY(bss_info) next;
|
||||
|
||||
uint8_t bssid[6];
|
||||
|
@ -46,14 +48,14 @@ typedef enum {
|
|||
SCAN_PENDING,
|
||||
SCAN_BUSY,
|
||||
SCAN_CANCEL,
|
||||
} scan_status_t;
|
||||
} sdk_scan_status_t;
|
||||
|
||||
typedef void (* scan_done_cb_t)(void *arg, scan_status_t status);
|
||||
typedef void (* sdk_scan_done_cb_t)(void *arg, sdk_scan_status_t status);
|
||||
|
||||
bool wifi_station_scan(struct scan_config *config, scan_done_cb_t cb);
|
||||
bool sdk_wifi_station_scan(struct sdk_scan_config *config, sdk_scan_done_cb_t cb);
|
||||
|
||||
uint8_t wifi_station_get_auto_connect(void);
|
||||
bool wifi_station_set_auto_connect(uint8_t set);
|
||||
uint8_t sdk_wifi_station_get_auto_connect(void);
|
||||
bool sdk_wifi_station_set_auto_connect(uint8_t set);
|
||||
|
||||
enum {
|
||||
STATION_IDLE = 0,
|
||||
|
@ -64,6 +66,6 @@ enum {
|
|||
STATION_GOT_IP
|
||||
};
|
||||
|
||||
uint8_t wifi_station_get_connect_status(void);
|
||||
uint8_t sdk_wifi_station_get_connect_status(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
#ifndef __ESP_SYSTEM_H__
|
||||
#define __ESP_SYSTEM_H__
|
||||
|
||||
enum rst_reason {
|
||||
enum sdk_rst_reason {
|
||||
DEFAULT_RST = 0,
|
||||
WDT_RST = 1,
|
||||
EXCEPTION_RST = 2,
|
||||
SOFT_RST = 3
|
||||
};
|
||||
|
||||
struct rst_info{
|
||||
struct sdk_rst_info{
|
||||
uint32_t reason;
|
||||
uint32_t exccause;
|
||||
uint32_t epc1;
|
||||
|
@ -24,26 +24,26 @@ struct rst_info{
|
|||
uint32_t rtn_addr;
|
||||
};
|
||||
|
||||
struct rst_info* system_get_rst_info(void);
|
||||
struct rst_info* sdk_system_get_rst_info(void);
|
||||
|
||||
const char* system_get_sdk_version(void);
|
||||
const char* sdk_system_get_sdk_version(void);
|
||||
|
||||
void system_restore(void);
|
||||
void system_restart(void);
|
||||
void system_deep_sleep(uint32_t time_in_us);
|
||||
void sdk_system_restore(void);
|
||||
void sdk_system_restart(void);
|
||||
void sdk_system_deep_sleep(uint32_t time_in_us);
|
||||
|
||||
uint32_t system_get_time(void);
|
||||
uint32_t sdk_system_get_time(void);
|
||||
|
||||
void system_print_meminfo(void);
|
||||
uint32_t system_get_free_heap_size(void);
|
||||
uint32_t system_get_chip_id(void);
|
||||
void sdk_system_print_meminfo(void);
|
||||
uint32_t sdk_system_get_free_heap_size(void);
|
||||
uint32_t sdk_system_get_chip_id(void);
|
||||
|
||||
uint32_t system_rtc_clock_cali_proc(void);
|
||||
uint32_t system_get_rtc_time(void);
|
||||
uint32_t sdk_system_rtc_clock_cali_proc(void);
|
||||
uint32_t sdk_system_get_rtc_time(void);
|
||||
|
||||
bool system_rtc_mem_read(uint8_t src, void *dst, uint16_t n);
|
||||
bool system_rtc_mem_write(uint8_t dst, const void *src, uint16_t n);
|
||||
bool sdk_system_rtc_mem_read(uint8_t src, void *dst, uint16_t n);
|
||||
bool sdk_system_rtc_mem_write(uint8_t dst, const void *src, uint16_t n);
|
||||
|
||||
void system_uart_swap(void);
|
||||
void sdk_system_uart_swap(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -7,16 +7,16 @@
|
|||
#define __ESP_TIMER_H__
|
||||
|
||||
/* timer related */
|
||||
typedef void os_timer_func_t(void *timer_arg);
|
||||
typedef void sdk_os_timer_func_t(void *timer_arg);
|
||||
|
||||
typedef struct _os_timer_t {
|
||||
struct _os_timer_t *timer_next;
|
||||
void *freerots_handle;
|
||||
uint32_t timer_expire;
|
||||
uint32_t timer_period;
|
||||
os_timer_func_t *timer_func;
|
||||
sdk_os_timer_func_t *timer_func;
|
||||
bool timer_repeat_flag;
|
||||
void *timer_arg;
|
||||
} os_timer_t;
|
||||
} sdk_os_timer_t;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
* Copyright (C) 2013 -2014 Espressif System
|
||||
*
|
||||
* Adapted from BSD licensed esp_iot_rtos_sdk v0.9.9
|
||||
*
|
||||
* Functions declared in this header are defined in libmain.a
|
||||
*/
|
||||
|
||||
#ifndef __ESP_WIFI_H__
|
||||
|
@ -23,8 +26,8 @@ typedef enum _auth_mode {
|
|||
AUTH_MAX
|
||||
} AUTH_MODE;
|
||||
|
||||
uint8_t wifi_get_opmode(void);
|
||||
bool wifi_set_opmode(uint8_t opmode);
|
||||
uint8_t sdk_wifi_get_opmode(void);
|
||||
bool sdk_wifi_set_opmode(uint8_t opmode);
|
||||
|
||||
enum {
|
||||
STATION_IF = 0,
|
||||
|
@ -38,29 +41,29 @@ struct ip_info {
|
|||
struct ip_addr gw;
|
||||
};
|
||||
|
||||
bool wifi_get_ip_info(uint8_t if_index, struct ip_info *info);
|
||||
bool wifi_set_ip_info(uint8_t if_index, struct ip_info *info);
|
||||
bool wifi_get_macaddr(uint8_t if_index, uint8_t *macaddr);
|
||||
bool wifi_set_macaddr(uint8_t if_index, uint8_t *macaddr);
|
||||
bool sdk_wifi_get_ip_info(uint8_t if_index, struct ip_info *info);
|
||||
bool sdk_wifi_set_ip_info(uint8_t if_index, struct ip_info *info);
|
||||
bool sdk_wifi_get_macaddr(uint8_t if_index, uint8_t *macaddr);
|
||||
bool sdk_wifi_set_macaddr(uint8_t if_index, uint8_t *macaddr);
|
||||
|
||||
uint8_t wifi_get_channel(void);
|
||||
bool wifi_set_channel(uint8_t channel);
|
||||
uint8_t sdk_wifi_get_channel(void);
|
||||
bool sdk_wifi_set_channel(uint8_t channel);
|
||||
|
||||
void wifi_status_led_install(uint8_t gpio_id, uint32_t gpio_name, uint8_t gpio_func);
|
||||
void sdk_wifi_status_led_install(uint8_t gpio_id, uint32_t gpio_name, uint8_t gpio_func);
|
||||
|
||||
void wifi_promiscuous_enable(uint8_t promiscuous);
|
||||
void sdk_wifi_promiscuous_enable(uint8_t promiscuous);
|
||||
|
||||
typedef void (* wifi_promiscuous_cb_t)(uint8_t *buf, uint16_t len);
|
||||
typedef void (* sdk_wifi_promiscuous_cb_t)(uint8_t *buf, uint16_t len);
|
||||
|
||||
void wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb);
|
||||
void sdk_wifi_set_promiscuous_rx_cb(sdk_wifi_promiscuous_cb_t cb);
|
||||
|
||||
enum phy_mode {
|
||||
enum sdk_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);
|
||||
enum phy_mode sdk_wifi_get_phy_mode(void);
|
||||
bool sdk_wifi_set_phy_mode(enum sdk_phy_mode mode);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/* This source file contains function prototypes for functions defined
|
||||
/* sdk_prototypes.h
|
||||
|
||||
This source file contains function prototypes for functions defined
|
||||
in the remaining "binary blob" ESP IoT RTOS SDK libraries. Sorted
|
||||
by which library they appear in.
|
||||
|
||||
Function names here have the 'sdk_' prefix that is put on all binary library functions
|
||||
by the Open RTOS SDK.
|
||||
*/
|
||||
#ifndef SDK_PROTOTYPES_H
|
||||
#define SDK_PROTOTYPES_H
|
||||
|
@ -18,18 +23,28 @@ struct ip_addr;
|
|||
uart_no = 0 or 1 for which UART
|
||||
new_divisor = Calculated in the form UART_CLK_FREQ / BAUD
|
||||
*/
|
||||
void uart_div_modify(uint32_t uart_no, uint32_t new_divisor);
|
||||
void sdk_uart_div_modify(uint32_t uart_no, uint32_t new_divisor);
|
||||
|
||||
/* Read a single character from the UART.
|
||||
*/
|
||||
char sdk_uart_rx_one_char(void);
|
||||
|
||||
/* Write a single character to the UART.
|
||||
*/
|
||||
void sdk_os_putc(char c);
|
||||
|
||||
/* Called when an IP gets set on the "station" (client) interface.
|
||||
*/
|
||||
void system_station_got_ip_set(struct ip_addr *ip_addr, struct ip_addr *sn_mask, struct ip_addr *gw_addr);
|
||||
void sdk_system_station_got_ip_set(struct ip_addr *ip_addr, struct ip_addr *sn_mask, struct ip_addr *gw_addr);
|
||||
|
||||
/* This is a no-op wrapper around ppRecycleRxPkt, which is defined in libpp.a
|
||||
|
||||
It's called when a pbuf is freed, and allows pp to reuse the 'eb' pointer to ESP-specific
|
||||
pbuf data. (See esp-lwip pbuf.h)
|
||||
*/
|
||||
void system_pp_recycle_rx_pkt(void *eb);
|
||||
void sdk_system_pp_recycle_rx_pkt(void *eb);
|
||||
|
||||
const char* sdk_system_get_sdk_version(void);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -10,15 +10,15 @@ typedef enum {
|
|||
SPI_FLASH_RESULT_OK,
|
||||
SPI_FLASH_RESULT_ERR,
|
||||
SPI_FLASH_RESULT_TIMEOUT
|
||||
} SpiFlashOpResult;
|
||||
} sdk_SpiFlashOpResult;
|
||||
|
||||
#define SPI_FLASH_SEC_SIZE 4096
|
||||
|
||||
uint32_t spi_flash_get_id(void);
|
||||
SpiFlashOpResult spi_flash_read_status(uint32_t *status);
|
||||
SpiFlashOpResult spi_flash_write_status(uint32_t status_value);
|
||||
SpiFlashOpResult spi_flash_erase_sector(uint16_t sec);
|
||||
SpiFlashOpResult spi_flash_write(uint32_t des_addr, uint32_t *src_addr, uint32_t size);
|
||||
SpiFlashOpResult spi_flash_read(uint32_t src_addr, uint32_t *des_addr, uint32_t size);
|
||||
uint32_t sdk_spi_flash_get_id(void);
|
||||
sdk_SpiFlashOpResult sdk_spi_flash_read_status(uint32_t *status);
|
||||
sdk_SpiFlashOpResult sdk_spi_flash_write_status(uint32_t status_value);
|
||||
sdk_SpiFlashOpResult sdk_spi_flash_erase_sector(uint16_t sec);
|
||||
sdk_SpiFlashOpResult sdk_spi_flash_write(uint32_t des_addr, uint32_t *src_addr, uint32_t size);
|
||||
sdk_SpiFlashOpResult sdk_spi_flash_read(uint32_t src_addr, uint32_t *des_addr, uint32_t size);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue