Skip to content

Commit

Permalink
setting MEMLEAK_DEBUG and implementing check_memleak_debug_enable() f…
Browse files Browse the repository at this point in the history
…ixes memory leak when changing wifi op mode with wifi_set_opmode_current()

	have to be researched and possible sent to espresif
  • Loading branch information
st0ff3r committed May 28, 2018
1 parent 79a4771 commit 67b16ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ else
LIBS += lwip
endif
# compiler flags using during compilation of source files
CFLAGS = -Os -Wpointer-arith -Wundef -Wall -Wno-pointer-sign -Wno-comment -Wno-switch -Wno-unknown-pragmas -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH -DVERSION=\"$(GIT_VERSION)\" -DECB=0 -DKEY=$(CUSTOM_KEY) -DAP_PASSWORD=\"$(CUSTOM_AP_PASSWORD)\" -mforce-l32
CFLAGS = -Os -Wpointer-arith -Wundef -Wall -Wno-pointer-sign -Wno-comment -Wno-switch -Wno-unknown-pragmas -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH -DVERSION=\"$(GIT_VERSION)\" -DECB=0 -DKEY=$(CUSTOM_KEY) -DAP_PASSWORD=\"$(CUSTOM_AP_PASSWORD)\" -mforce-l32 -DMEMLEAK_DEBUG
ifeq ($(AP), 1)
CFLAGS += -DLWIP_OPEN_SRC
endif
Expand Down
1 change: 0 additions & 1 deletion user/mqtt_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ void mqtt_rpc_stop_ap(MQTT_Client *client) {
// stop AP
if (wifi_get_opmode() != STATION_MODE) {
wifi_set_opmode_current(STATION_MODE);

// ...and save setting to flash if changed
if (sys_cfg.ap_enabled == true) {
sys_cfg.ap_enabled = false;
Expand Down
7 changes: 7 additions & 0 deletions user/user_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ static os_timer_t impulse_meter_calculate_timer;
uint8_t mesh_ssid[AP_SSID_LENGTH + 1];
#endif

#ifdef MEMLEAK_DEBUG
ICACHE_FLASH_ATTR
bool check_memleak_debug_enable(void) {
return MEMLEAK_DEBUG_ENABLE;
}
#endif

ICACHE_FLASH_ATTR void static sample_mode_timer_func(void *arg) {
unsigned char topic[MQTT_TOPIC_L];
// temp var for serial string
Expand Down

0 comments on commit 67b16ec

Please sign in to comment.