Skip to content

Commit

Permalink
reduce memory consumption
Browse files Browse the repository at this point in the history
  • Loading branch information
tve committed Jun 5, 2015
1 parent c7c1d51 commit 88dc167
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ LIBS = c gcc hal phy pp net80211 wpa main lwip

# compiler flags using during compilation of source files
CFLAGS = -Os -ggdb -std=c99 -Werror -Wpointer-arith -Wundef -Wall -Wl,-EL -fno-inline-functions \
-nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH -D_STDINT_H \
-Wno-address -DFIRMWARE_SIZE=$(ESP_FLASH_MAX) \
-nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections \
-D__ets__ -DICACHE_FLASH -D_STDINT_H -Wno-address -DFIRMWARE_SIZE=$(ESP_FLASH_MAX) \
-DMCU_RESET_PIN=$(MCU_RESET_PIN) -DMCU_ISP_PIN=$(MCU_ISP_PIN) \
-DLED_CONN_PIN=$(LED_CONN_PIN) -DLED_SERIAL_PIN=$(LED_SERIAL_PIN) \
"-DVERSION=$(VERSION)"

# linker flags used to generate the main object file
LDFLAGS = -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static
LDFLAGS = -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--gc-sections

# linker script used for the above linker step
LD_SCRIPT := build/eagle.esphttpd.v6.ld
Expand Down
3 changes: 2 additions & 1 deletion httpd/httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Esp8266 http server - core routines
//Max length of request head
#define MAX_HEAD_LEN 1024
//Max amount of connections
#define MAX_CONN 8
#define MAX_CONN 4
//Max post buffer len
#define MAX_POST 1024
//Max send buffer len
Expand Down Expand Up @@ -543,4 +543,5 @@ void ICACHE_FLASH_ATTR httpdInit(HttpdBuiltInUrl *fixedUrls, int port) {
os_printf("Httpd init, conn=%p\n", &httpdConn);
espconn_regist_connectcb(&httpdConn, httpdConnectCb);
espconn_accept(&httpdConn);
espconn_tcp_set_max_con_allow(&httpdConn, MAX_CONN);
}
3 changes: 3 additions & 0 deletions serial/serbridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ static void ICACHE_FLASH_ATTR serbridgeConnectCb(void *arg) {
espconn_regist_reconcb(conn, serbridgeReconCb);
espconn_regist_disconcb(conn, serbridgeDisconCb);
espconn_regist_sentcb(conn, serbridgeSentCb);

espconn_set_opt(conn, ESPCONN_REUSEADDR|ESPCONN_NODELAY);
}

// callback with a buffer of characters that have arrived on the uart
Expand Down Expand Up @@ -320,5 +322,6 @@ void ICACHE_FLASH_ATTR serbridgeInit(int port, uint8_t reset_pin, uint8_t isp_pi

espconn_regist_connectcb(&serbridgeConn, serbridgeConnectCb);
espconn_accept(&serbridgeConn);
espconn_tcp_set_max_con_allow(&serbridgeConn, MAX_CONN);
espconn_regist_time(&serbridgeConn, SER_BRIDGE_TIMEOUT, 0);
}
2 changes: 1 addition & 1 deletion serial/serbridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <c_types.h>
#include <espconn.h>

#define MAX_CONN 5
#define MAX_CONN 4
#define SER_BRIDGE_TIMEOUT 28799

//Max send buffer len
Expand Down

0 comments on commit 88dc167

Please sign in to comment.