To be honest, I do not completely understand your code but have the following questions.
Are you (shortly) disabling wifi send/receive when reading out current adc value ?
If yes, what effect would that have on web(server) functionality on the esp ?
Would I be able to read adc value around 5-10 times per second ?
In an earlier post in this thread igrr mentions :
'SDK 0.9.3 has a system_adc_read() function that takes care of issues related to WiFi'
How does your implementation compare to the system_adc_read ?
Would I be able to use your implementation using the FREERTOS SDK ?
Kind regards,
Herman