lucadentella / esp32-tutorial

563 stars 233 forks source link

Add a delay to the http_server task #2

Closed tonyp7 closed 7 years ago

tonyp7 commented 7 years ago

If you never give freeRTOS the time to run system tasks, you will see that the heap memory available will slowly go down over time until the program crashes. Simply adding a tiny delay allows the task to yield. The dramatic impact of this tiny change is easy to check if you create a 2nd task that does printf("free heap: %d\n",esp_get_free_heap_size()); Every 5s or so.