mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-08-06 15:15:15 +08:00
feat(esp8266): Don't use LOCAL in SDK
This commit is contained in:
@ -248,9 +248,9 @@ typedef struct _sock_mt sock_mt_t;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LOCAL sock_mt_t sockets_mt[NUM_SOCKETS];
|
static sock_mt_t sockets_mt[NUM_SOCKETS];
|
||||||
|
|
||||||
LOCAL int lwip_enter_mt_state(int s, int arg)
|
static int lwip_enter_mt_state(int s, int arg)
|
||||||
{
|
{
|
||||||
if(tryget_socket(s) == NULL ||
|
if(tryget_socket(s) == NULL ||
|
||||||
SOCK_MT_GET_STATE(s) != SOCK_MT_STATE_NONE ||
|
SOCK_MT_GET_STATE(s) != SOCK_MT_STATE_NONE ||
|
||||||
@ -263,7 +263,7 @@ LOCAL int lwip_enter_mt_state(int s, int arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int lwip_enter_mt_recv(int s, int arg)
|
static int lwip_enter_mt_recv(int s, int arg)
|
||||||
{
|
{
|
||||||
if(tryget_socket(s) == NULL ||
|
if(tryget_socket(s) == NULL ||
|
||||||
SOCK_MT_GET_READ_SEL(s))
|
SOCK_MT_GET_READ_SEL(s))
|
||||||
@ -274,7 +274,7 @@ LOCAL int lwip_enter_mt_recv(int s, int arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int lwip_enter_mt_shutdown(int s, int arg)
|
static int lwip_enter_mt_shutdown(int s, int arg)
|
||||||
{
|
{
|
||||||
if(tryget_socket(s) == NULL
|
if(tryget_socket(s) == NULL
|
||||||
|| SOCK_MT_GET_SHUTDOWN(s) != SOCK_MT_SHUTDOWN_NONE)
|
|| SOCK_MT_GET_SHUTDOWN(s) != SOCK_MT_SHUTDOWN_NONE)
|
||||||
@ -285,7 +285,7 @@ LOCAL int lwip_enter_mt_shutdown(int s, int arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int lwip_enter_mt_close(int s, int arg)
|
static int lwip_enter_mt_close(int s, int arg)
|
||||||
{
|
{
|
||||||
if(tryget_socket(s) == NULL)
|
if(tryget_socket(s) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
@ -296,7 +296,7 @@ LOCAL int lwip_enter_mt_close(int s, int arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LOCAL int lwip_enter_mt_select(int s, int arg)
|
static int lwip_enter_mt_select(int s, int arg)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int *fdset = (int *)arg;
|
int *fdset = (int *)arg;
|
||||||
@ -358,7 +358,7 @@ failed1:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int lwip_enter_mt_ioctrl(int s, int arg)
|
static int lwip_enter_mt_ioctrl(int s, int arg)
|
||||||
{
|
{
|
||||||
if(tryget_socket(s) == NULL)
|
if(tryget_socket(s) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
@ -368,7 +368,7 @@ LOCAL int lwip_enter_mt_ioctrl(int s, int arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int lwip_exit_mt_state(int s, int arg)
|
static int lwip_exit_mt_state(int s, int arg)
|
||||||
{
|
{
|
||||||
SOCK_MT_SET_STATE(s, SOCK_MT_STATE_NONE);
|
SOCK_MT_SET_STATE(s, SOCK_MT_STATE_NONE);
|
||||||
SOCK_MT_UNLOCK(s, SOCK_MT_STATE_LOCK);
|
SOCK_MT_UNLOCK(s, SOCK_MT_STATE_LOCK);
|
||||||
@ -380,7 +380,7 @@ LOCAL int lwip_exit_mt_state(int s, int arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int lwip_exit_mt_recv(int s, int arg)
|
static int lwip_exit_mt_recv(int s, int arg)
|
||||||
{
|
{
|
||||||
SOCK_MT_UNLOCK(s, SOCK_MT_RECV_LOCK);
|
SOCK_MT_UNLOCK(s, SOCK_MT_RECV_LOCK);
|
||||||
|
|
||||||
@ -391,18 +391,18 @@ LOCAL int lwip_exit_mt_recv(int s, int arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int lwip_exit_mt_shutdown(int s, int arg)
|
static int lwip_exit_mt_shutdown(int s, int arg)
|
||||||
{
|
{
|
||||||
//SOCK_MT_SET_SHUTDOWN(s, SOCK_MT_STATE_NONE);
|
//SOCK_MT_SET_SHUTDOWN(s, SOCK_MT_STATE_NONE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int lwip_exit_mt_close(int s, int arg)
|
static int lwip_exit_mt_close(int s, int arg)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int lwip_exit_mt_select(int s, int arg)
|
static int lwip_exit_mt_select(int s, int arg)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int *fdset = (int *)arg;
|
int *fdset = (int *)arg;
|
||||||
@ -431,7 +431,7 @@ LOCAL int lwip_exit_mt_select(int s, int arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int lwip_exit_mt_ioctrl(int s, int arg)
|
static int lwip_exit_mt_ioctrl(int s, int arg)
|
||||||
{
|
{
|
||||||
SOCK_MT_UNLOCK(s, SOCK_MT_IOCTRL_LOCK);
|
SOCK_MT_UNLOCK(s, SOCK_MT_IOCTRL_LOCK);
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ LOCAL int lwip_exit_mt_ioctrl(int s, int arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL const lwip_io_mt_fn lwip_enter_mt_table[] = {
|
static const lwip_io_mt_fn lwip_enter_mt_table[] = {
|
||||||
lwip_enter_mt_state,
|
lwip_enter_mt_state,
|
||||||
lwip_enter_mt_recv,
|
lwip_enter_mt_recv,
|
||||||
lwip_enter_mt_ioctrl,
|
lwip_enter_mt_ioctrl,
|
||||||
@ -451,7 +451,7 @@ LOCAL const lwip_io_mt_fn lwip_enter_mt_table[] = {
|
|||||||
lwip_enter_mt_close
|
lwip_enter_mt_close
|
||||||
};
|
};
|
||||||
|
|
||||||
LOCAL const lwip_io_mt_fn lwip_exit_mt_table[] = {
|
static const lwip_io_mt_fn lwip_exit_mt_table[] = {
|
||||||
lwip_exit_mt_state,
|
lwip_exit_mt_state,
|
||||||
lwip_exit_mt_recv,
|
lwip_exit_mt_recv,
|
||||||
lwip_exit_mt_ioctrl,
|
lwip_exit_mt_ioctrl,
|
||||||
@ -460,7 +460,7 @@ LOCAL const lwip_io_mt_fn lwip_exit_mt_table[] = {
|
|||||||
lwip_exit_mt_close
|
lwip_exit_mt_close
|
||||||
};
|
};
|
||||||
|
|
||||||
LOCAL void lwip_do_sync_send(void *arg)
|
static void lwip_do_sync_send(void *arg)
|
||||||
{
|
{
|
||||||
struct netconn *conn = arg;
|
struct netconn *conn = arg;
|
||||||
|
|
||||||
@ -485,7 +485,7 @@ LOCAL void lwip_do_sync_send(void *arg)
|
|||||||
sys_sem_signal(&(conn->ioctrl_completed));
|
sys_sem_signal(&(conn->ioctrl_completed));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL void lwip_do_sync_rst_state(void *arg)
|
static void lwip_do_sync_rst_state(void *arg)
|
||||||
{
|
{
|
||||||
struct netconn *conn = arg;
|
struct netconn *conn = arg;
|
||||||
|
|
||||||
@ -497,7 +497,7 @@ LOCAL void lwip_do_sync_rst_state(void *arg)
|
|||||||
sys_sem_signal(&(conn->ioctrl_completed));
|
sys_sem_signal(&(conn->ioctrl_completed));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL void lwip_sync_state_mt(struct lwip_sock *sock , int state)
|
static void lwip_sync_state_mt(struct lwip_sock *sock , int state)
|
||||||
{
|
{
|
||||||
SOCK_MT_DEBUG(1, "sync state %d\n", state);
|
SOCK_MT_DEBUG(1, "sync state %d\n", state);
|
||||||
|
|
||||||
@ -521,21 +521,21 @@ LOCAL void lwip_sync_state_mt(struct lwip_sock *sock , int state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL void lwip_sync_recv_mt(struct lwip_sock *sock)
|
static void lwip_sync_recv_mt(struct lwip_sock *sock)
|
||||||
{
|
{
|
||||||
SOCK_MT_DEBUG(1, "sync recv %d\n", sock->conn->socket);
|
SOCK_MT_DEBUG(1, "sync recv %d\n", sock->conn->socket);
|
||||||
if (sys_mbox_valid(&sock->conn->recvmbox))
|
if (sys_mbox_valid(&sock->conn->recvmbox))
|
||||||
sys_mbox_trypost(&sock->conn->recvmbox, NULL);
|
sys_mbox_trypost(&sock->conn->recvmbox, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL void lwip_sync_select_mt(struct lwip_sock *sock)
|
static void lwip_sync_select_mt(struct lwip_sock *sock)
|
||||||
{
|
{
|
||||||
SOCK_MT_DEBUG(1, "sync select %d\n", sock->conn->socket);
|
SOCK_MT_DEBUG(1, "sync select %d\n", sock->conn->socket);
|
||||||
event_callback(sock->conn, NETCONN_EVT_ERROR, 0);
|
event_callback(sock->conn, NETCONN_EVT_ERROR, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LOCAL void lwip_sync_mt(int s)
|
static void lwip_sync_mt(int s)
|
||||||
{
|
{
|
||||||
int module = 0;
|
int module = 0;
|
||||||
int ret;
|
int ret;
|
||||||
@ -836,7 +836,7 @@ int lwip_fcntl_mt(int s, int cmd, int val)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int __lwip_shutdown_mt(int s, int how)
|
static int __lwip_shutdown_mt(int s, int how)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#define MQTT_CLIENT_THREAD_STACK_WORDS 2048
|
#define MQTT_CLIENT_THREAD_STACK_WORDS 2048
|
||||||
#define MQTT_CLIENT_THREAD_PRIO 8
|
#define MQTT_CLIENT_THREAD_PRIO 8
|
||||||
|
|
||||||
LOCAL xTaskHandle mqttc_client_handle;
|
static xTaskHandle mqttc_client_handle;
|
||||||
|
|
||||||
static void messageArrived(MessageData* data)
|
static void messageArrived(MessageData* data)
|
||||||
{
|
{
|
||||||
|
@ -52,14 +52,14 @@ Fragment size range 2048~8192
|
|||||||
/* receive length */
|
/* receive length */
|
||||||
#define OPENSSL_CLIENT_RECV_BUF_LEN 1024
|
#define OPENSSL_CLIENT_RECV_BUF_LEN 1024
|
||||||
|
|
||||||
LOCAL xTaskHandle openssl_handle;
|
static xTaskHandle openssl_handle;
|
||||||
|
|
||||||
LOCAL char send_data[] = OPENSSL_CLIENT_REQUEST;
|
static char send_data[] = OPENSSL_CLIENT_REQUEST;
|
||||||
LOCAL int send_bytes = sizeof(send_data);
|
static int send_bytes = sizeof(send_data);
|
||||||
|
|
||||||
LOCAL char recv_buf[OPENSSL_CLIENT_RECV_BUF_LEN];
|
static char recv_buf[OPENSSL_CLIENT_RECV_BUF_LEN];
|
||||||
|
|
||||||
LOCAL void openssl_client_thread(void* p)
|
static void openssl_client_thread(void* p)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -34,14 +34,14 @@
|
|||||||
|
|
||||||
#define OPENSSL_DEMO_RECV_BUF_LEN 1024
|
#define OPENSSL_DEMO_RECV_BUF_LEN 1024
|
||||||
|
|
||||||
LOCAL xTaskHandle openssl_handle;
|
static xTaskHandle openssl_handle;
|
||||||
|
|
||||||
LOCAL char send_data[] = OPENSSL_DEMO_REQUEST;
|
static char send_data[] = OPENSSL_DEMO_REQUEST;
|
||||||
LOCAL int send_bytes = sizeof(send_data);
|
static int send_bytes = sizeof(send_data);
|
||||||
|
|
||||||
LOCAL char recv_buf[OPENSSL_DEMO_RECV_BUF_LEN];
|
static char recv_buf[OPENSSL_DEMO_RECV_BUF_LEN];
|
||||||
|
|
||||||
LOCAL void openssl_demo_thread(void *p)
|
static void openssl_demo_thread(void *p)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -52,14 +52,14 @@ Fragment size range 2048~8192
|
|||||||
/* receive length */
|
/* receive length */
|
||||||
#define OPENSSL_SERVER_RECV_BUF_LEN 1024
|
#define OPENSSL_SERVER_RECV_BUF_LEN 1024
|
||||||
|
|
||||||
LOCAL xTaskHandle openssl_handle;
|
static xTaskHandle openssl_handle;
|
||||||
|
|
||||||
LOCAL char send_data[] = OPENSSL_SERVER_REQUEST;
|
static char send_data[] = OPENSSL_SERVER_REQUEST;
|
||||||
LOCAL int send_bytes = sizeof(send_data);
|
static int send_bytes = sizeof(send_data);
|
||||||
|
|
||||||
LOCAL char recv_buf[OPENSSL_SERVER_RECV_BUF_LEN];
|
static char recv_buf[OPENSSL_SERVER_RECV_BUF_LEN];
|
||||||
|
|
||||||
LOCAL void openssl_server_thread(void* p)
|
static void openssl_server_thread(void* p)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ enum {
|
|||||||
|
|
||||||
#define SSC_CMD_N (CMD_END + 1)
|
#define SSC_CMD_N (CMD_END + 1)
|
||||||
|
|
||||||
LOCAL void spiffs_test_init(void);
|
static void spiffs_test_init(void);
|
||||||
|
|
||||||
LOCAL ssc_cmd_t sscCmdSet[SSC_CMD_N] = {
|
static ssc_cmd_t sscCmdSet[SSC_CMD_N] = {
|
||||||
{"fs", CMD_T_SYNC, CMD_SPIFFS, spiffs_test_init, NULL},
|
{"fs", CMD_T_SYNC, CMD_SPIFFS, spiffs_test_init, NULL},
|
||||||
{"", CMD_T_ASYNC, CMD_END, NULL, NULL}
|
{"", CMD_T_ASYNC, CMD_END, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
@ -27,9 +27,9 @@
|
|||||||
|
|
||||||
#define DEFAULT_LAN_PORT 12476
|
#define DEFAULT_LAN_PORT 12476
|
||||||
|
|
||||||
LOCAL esp_udp ssdp_udp;
|
static esp_udp ssdp_udp;
|
||||||
LOCAL struct espconn pssdpudpconn;
|
static struct espconn pssdpudpconn;
|
||||||
LOCAL os_timer_t ssdp_time_serv;
|
static os_timer_t ssdp_time_serv;
|
||||||
|
|
||||||
uint8 lan_buf[200];
|
uint8 lan_buf[200];
|
||||||
uint16 lan_buf_len;
|
uint16 lan_buf_len;
|
||||||
@ -43,7 +43,7 @@ const airkiss_config_t akconf =
|
|||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
LOCAL void airkiss_wifilan_time_callback(void)
|
static void airkiss_wifilan_time_callback(void)
|
||||||
{
|
{
|
||||||
uint16 i;
|
uint16 i;
|
||||||
airkiss_lan_ret_t ret;
|
airkiss_lan_ret_t ret;
|
||||||
@ -74,7 +74,7 @@ LOCAL void airkiss_wifilan_time_callback(void)
|
|||||||
os_printf("Finish send notify!\n");
|
os_printf("Finish send notify!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL void airkiss_wifilan_recv_callbk(void *arg, char *pdata, unsigned short len)
|
static void airkiss_wifilan_recv_callbk(void *arg, char *pdata, unsigned short len)
|
||||||
{
|
{
|
||||||
uint16 i;
|
uint16 i;
|
||||||
remot_info* pcon_info = NULL;
|
remot_info* pcon_info = NULL;
|
||||||
|
@ -61,7 +61,7 @@ uint32 user_rf_cal_sector_set(void)
|
|||||||
return rf_cal_sec;
|
return rf_cal_sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL void wait_for_connection_ready(uint8 flag)
|
static void wait_for_connection_ready(uint8 flag)
|
||||||
{
|
{
|
||||||
os_timer_disarm(&timer);
|
os_timer_disarm(&timer);
|
||||||
if(wifi_station_connected()){
|
if(wifi_station_connected()){
|
||||||
@ -73,13 +73,13 @@ LOCAL void wait_for_connection_ready(uint8 flag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL void on_wifi_connect(){
|
static void on_wifi_connect(){
|
||||||
os_timer_disarm(&timer);
|
os_timer_disarm(&timer);
|
||||||
os_timer_setfn(&timer, (os_timer_func_t *)wait_for_connection_ready, NULL);
|
os_timer_setfn(&timer, (os_timer_func_t *)wait_for_connection_ready, NULL);
|
||||||
os_timer_arm(&timer, 100, 0);
|
os_timer_arm(&timer, 100, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL void on_wifi_disconnect(uint8_t reason){
|
static void on_wifi_disconnect(uint8_t reason){
|
||||||
os_printf("disconnect %d\n", reason);
|
os_printf("disconnect %d\n", reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "freertos/queue.h"
|
#include "freertos/queue.h"
|
||||||
|
|
||||||
LOCAL void user_wps_status_cb(int status)
|
static void user_wps_status_cb(int status)
|
||||||
{
|
{
|
||||||
printf("scan status %d\n", status);
|
printf("scan status %d\n", status);
|
||||||
switch (status) {
|
switch (status) {
|
||||||
@ -31,7 +31,7 @@ LOCAL void user_wps_status_cb(int status)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL void user_wps_start(void)
|
static void user_wps_start(void)
|
||||||
{
|
{
|
||||||
wifi_wps_disable();
|
wifi_wps_disable();
|
||||||
wifi_wps_enable(WPS_TYPE_PBC);
|
wifi_wps_enable(WPS_TYPE_PBC);
|
||||||
@ -87,7 +87,7 @@ uint32 user_rf_cal_sector_set(void)
|
|||||||
|
|
||||||
return rf_cal_sec;
|
return rf_cal_sec;
|
||||||
}
|
}
|
||||||
LOCAL void wps_task(void *pvParameters)
|
static void wps_task(void *pvParameters)
|
||||||
{
|
{
|
||||||
wifi_set_opmode(STATION_MODE);
|
wifi_set_opmode(STATION_MODE);
|
||||||
user_wps_start();
|
user_wps_start();
|
||||||
|
Reference in New Issue
Block a user