Skip to content

Possible memory leak in touch_pad_isr_de/register #1617

Closed
@seaduck13

Description

@seaduck13

Hardware:

Board: ESP32 Dev Wroom32
Core Installation/update date: 9/jul/2018
IDE name: Platform.io Eclipse
Flash Frequency: 40Mhz
Upload Speed: 115200

Description:

There appears to be a leak in the touch_pad_isr_de/register functions. When continually registering and de-registering (don't need it to trigger right after sleep, seen in code below), I seem to be losing 32 bytes of memory each cycle.

This is just a small portion of code within a task called mode_task

Sketch:

if(cur_mode != MODE::SLEEP){
	ESP_LOGD(TAG, "Switching to SLEEP mode");
        touch_pad_isr_deregister(touch_ISR, NULL);
	for(int i = 5; i > 0; i--)
	{
		ESP_LOGD(TAG, "Sleeping in %d...", i);
		vTaskDelay(pdMS_TO_TICKS(500));
	}
}
else{
	ESP_LOGD(TAG, "Going back to sleep after infil");
}
esp_light_sleep_start();
touch_pad_read(TOUCH1, &val1);
touch_pad_read(TOUCH2, &val2);
if(val1 < TOUCH1_SENS || val2 < TOUCH2_SENS){
	xQueueOverwrite(mode_queue, &idle_mode);
	vTaskDelay(pdMS_TO_TICKS(1000));
	touch_pad_isr_register(touch_ISR, NULL);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions