gpio handler works again

remove memory leak in FlowDigit
This commit is contained in:
Zwer2k
2021-07-06 01:25:20 +02:00
parent b205326782
commit 8ca14a434c
18 changed files with 120 additions and 95 deletions

View File

@@ -137,9 +137,7 @@ void task_NoSDBlink(void *pvParameter)
esp_err_t handler_gpio(httpd_req_t *req)
{
printf("freemem -3-: %u\n", esp_get_free_heap_size());
gpio_handler_init();
printf("freemem -4-: %u\n", esp_get_free_heap_size());
char resp_str [30];
sprintf(resp_str, "OK. freemem %u", esp_get_free_heap_size());
@@ -219,7 +217,7 @@ extern "C" void app_main(void)
camuri.user_ctx = (void*)server;
httpd_register_uri_handler(server, &camuri);
gpio_handler_create();
gpio_handler_create(server);
printf("vor reg server main\n");
register_server_main_uri(server, "/sdcard");

View File

@@ -25,9 +25,6 @@ std::string starttime = "";
static const char *TAG_SERVERMAIN = "server-main";
static GpioHandler *gpioHandler = NULL;
/* An HTTP GET handler */
esp_err_t info_get_handler(httpd_req_t *req)
{
@@ -454,35 +451,3 @@ void connect_handler(void* arg, esp_event_base_t event_base,
*server = start_webserver();
}
}
void gpio_handler_create()
{
if (gpioHandler == NULL)
gpioHandler = new GpioHandler(CONFIG_FILE, server);
}
void gpio_handler_init()
{
if (gpioHandler != NULL) {
gpioHandler->init();
}
}
void gpio_handler_deinit() {
if (gpioHandler != NULL) {
gpioHandler->deinit();
}
}
void gpio_handler_destroy()
{
if (gpioHandler != NULL) {
delete gpioHandler;
gpioHandler = NULL;
}
}
GpioHandler* gpio_handler_get()
{
return gpioHandler;
}

View File

@@ -16,12 +16,6 @@
extern httpd_handle_t server;
void gpio_handler_create();
void gpio_handler_init();
void gpio_handler_deinit();
void gpio_handler_destroy();
GpioHandler* gpio_handler_get();
httpd_handle_t start_webserver(void);
void register_server_main_uri(httpd_handle_t server, const char *base_path);

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="7b8f10a";
const char* GIT_REV="b205326";
const char* GIT_TAG="";
const char* GIT_BRANCH="gpio-handler";
const char* BUILD_TIME="2021-07-03 00:47";
const char* BUILD_TIME="2021-07-05 23:02";