Skip to content

Commit 76a22b4

Browse files
author
Espressif Systems
committed
1. memory optimize;
2. support both libminic and libc; 3. fix some fatal exception bugs; 4. remove udhcp related files; 5. sync third_party files; 6. other minor changes;
1 parent 169a436 commit 76a22b4

32 files changed

+108
-678
lines changed

app/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ LINKFLAGS_eagle.app.v6 = \
5656
-u call_user_start \
5757
-Wl,-static \
5858
-Wl,--start-group \
59+
-lminic \
5960
-lgcc \
6061
-lhal \
6162
-lphy \

app/user/user_main.c

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#include "lwip/dns.h"
1818
#include "lwip/netdb.h"
1919

20-
#include "udhcp/dhcpd.h"
21-
2220
#define server_ip "192.168.101.142"
2321
#define server_port 9669
2422

examples/smart_config/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ LINKFLAGS_eagle.app.v6 = \
5656
-u call_user_start \
5757
-Wl,-static \
5858
-Wl,--start-group \
59+
-lminic \
5960
-lgcc \
6061
-lhal \
6162
-lphy \
@@ -65,7 +66,6 @@ LINKFLAGS_eagle.app.v6 = \
6566
-lmain \
6667
-lfreertos \
6768
-llwip \
68-
-ludhcp \
6969
-lsmartconfig \
7070
$(DEP_LIBS_eagle.app.v6) \
7171
-Wl,--end-group

examples/smart_config/user/user_main.c

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#include "lwip/dns.h"
1818
#include "lwip/netdb.h"
1919

20-
#include "udhcp/dhcpd.h"
21-
2220
#define server_ip "192.168.101.142"
2321
#define server_port 9669
2422

include/espressif/esp_softap.h

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#ifndef __ESP_SOFTAP_H__
77
#define __ESP_SOFTAP_H__
88

9+
#include "queue.h"
10+
911
struct softap_config {
1012
uint8 ssid[32];
1113
uint8 password[64];
@@ -17,6 +19,13 @@ struct softap_config {
1719
uint16 beacon_interval;
1820
};
1921

22+
struct station_info {
23+
STAILQ_ENTRY(station_info) next;
24+
25+
u8 bssid[6];
26+
struct ip_addr ip;
27+
};
28+
2029
bool wifi_softap_get_config(struct softap_config *config);
2130
bool wifi_softap_get_config_default(struct softap_config *config);
2231
bool wifi_softap_set_config(struct softap_config *config);

include/freertos/FreeRTOSConfig.h

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696

9797
#define configCHECK_FOR_STACK_OVERFLOW 2
9898
#define configUSE_MUTEXES 1
99+
#define configUSE_RECURSIVE_MUTEXES 1
99100
#define configUSE_TIMERS 1
100101

101102
#if configUSE_TIMERS

include/freertos/StackMacros.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134

135135
#define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \
136136
{ \
137-
static const unsigned char ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
137+
static const unsigned char ucExpectedStackBytes[] ICACHE_RODATA_ATTR = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
138138
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
139139
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
140140
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \

include/freertos/portmacro.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,15 @@ void _xt_isr_mask (uint32 mask);
178178
uint32 _xt_read_ints (void);
179179
void _xt_clear_ints(uint32 mask);
180180

181-
182181
/* interrupt related */
183-
typedef void (* _xt_isr)(void);
184-
185-
void _xt_isr_attach (uint8 i, _xt_isr func);
182+
typedef void (* _xt_isr)(void *arg);
186183

184+
void _xt_isr_attach (uint8 i, _xt_isr func, void *arg);
187185

186+
typedef struct _xt_isr_entry_ {
187+
_xt_isr handler;
188+
void * arg;
189+
} _xt_isr_entry;
188190

189191
#ifdef __cplusplus
190192
}

include/lwip/lwip/err.h

+17-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@ typedef s8_t err_t;
5858
#define ERR_VAL -6 /* Illegal value. */
5959
#define ERR_WOULDBLOCK -7 /* Operation would block. */
6060
#define ERR_USE -8 /* Address in use. */
61+
62+
#ifdef LWIP_ESP8266
63+
#define ERR_ALREADY -9 /* Already connected. */
64+
#define ERR_ISCONN -10 /* Conn already established.*/
65+
66+
#define ERR_IS_FATAL(e) ((e) < ERR_ISCONN)
67+
68+
#define ERR_ABRT -11 /* Connection aborted. */
69+
#define ERR_RST -12 /* Connection reset. */
70+
#define ERR_CLSD -13 /* Connection closed. */
71+
#define ERR_CONN -14 /* Not connected. */
72+
73+
#define ERR_ARG -15 /* Illegal argument. */
74+
75+
#define ERR_IF -16 /* Low-level netif error */
76+
#else
6177
#define ERR_ISCONN -9 /* Already connected. */
6278

6379
#define ERR_IS_FATAL(e) ((e) < ERR_ISCONN)
@@ -70,7 +86,7 @@ typedef s8_t err_t;
7086
#define ERR_ARG -14 /* Illegal argument. */
7187

7288
#define ERR_IF -15 /* Low-level netif error */
73-
89+
#endif
7490

7591
#ifdef LWIP_DEBUG
7692
extern const char *lwip_strerr(err_t err);

include/lwip/lwip/opt.h

+1
Original file line numberDiff line numberDiff line change
@@ -1649,6 +1649,7 @@
16491649
#else
16501650

16511651
#define LINK_STATS 0
1652+
#define ETHARP_STATS 0
16521653
#define IP_STATS 0
16531654
#define IPFRAG_STATS 0
16541655
#define ICMP_STATS 0

include/lwip/lwipopts.h

+21-3
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@
4949
* MEMCPY: override this if you have a faster implementation at hand than the
5050
* one included in your C library
5151
*/
52-
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
52+
#define MEMCPY(dst,src,len) ets_memcpy(dst,src,len)
5353

5454
/**
5555
* SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a
5656
* call to memcpy() if the length is known at compile time and is small.
5757
*/
58-
#define SMEMCPY(dst,src,len) memcpy(dst,src,len)
58+
#define SMEMCPY(dst,src,len) ets_memcpy(dst,src,len)
5959

6060
/*
6161
------------------------------------
@@ -135,7 +135,7 @@
135135
* that this option does not affect incoming packet sizes, which can be
136136
* controlled via IP_REASSEMBLY.
137137
*/
138-
#define IP_FRAG 1
138+
#define IP_FRAG 0
139139

140140
/**
141141
* IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)
@@ -278,6 +278,13 @@
278278
---------- Thread options ----------
279279
------------------------------------
280280
*/
281+
/**
282+
* TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
283+
*/
284+
#ifndef TCPIP_THREAD_NAME
285+
#define TCPIP_THREAD_NAME "tiT"
286+
#endif
287+
281288
/**
282289
* TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
283290
* The stack size value itself is platform-dependent, but is passed to
@@ -325,6 +332,11 @@
325332
---------- Sequential layer options ----------
326333
----------------------------------------------
327334
*/
335+
/**
336+
* LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!)
337+
* Don't use it if you're not an active lwIP project member
338+
*/
339+
#define LWIP_TCPIP_CORE_LOCKING 1
328340

329341
/*
330342
------------------------------------
@@ -365,6 +377,12 @@
365377
---------- Statistics options ----------
366378
----------------------------------------
367379
*/
380+
/**
381+
* LWIP_STATS==1: Enable statistics collection in lwip_stats.
382+
*/
383+
#ifndef LWIP_STATS
384+
#define LWIP_STATS 0
385+
#endif
368386

369387
/*
370388
---------------------------------

0 commit comments

Comments
 (0)