Skip to content

Possible memory leak in touch_pad_isr_de/register #1617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
seaduck13 opened this issue Jul 9, 2018 · 1 comment
Closed

Possible memory leak in touch_pad_isr_de/register #1617

seaduck13 opened this issue Jul 9, 2018 · 1 comment

Comments

@seaduck13
Copy link

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);
}
@me-no-dev
Copy link
Member

this is IDF api, maybe post this there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants