The solution to that is to add some Blynk.run() commands within your function, to allow the Blynk library to grab a bit of processor time and do its background housekeeping.
If you add these at the points where you are currently triggering the timers to call the next block of code then it should be fine.
If you’re doing a large block of virtualWrites then scatter a few Blynk.run() command into these blocks to allow Blynk to come up for air.
Blynk.run()
This function should be called frequently to process incoming commands and perform housekeeping of Blynk connection. It is usually called in
void loop() {}
.This command can be initiated it in other places of your code unless you run out of heap memory (in the cascaded functions with local memory).
For example, it is not recommended to call
Blynk.run()
inside of theBLYNK_READ
andBLYNK_WRITE
functions on low-RAM devices.
https://docs.blynk.cc/#blynk-firmware-connection-management-blynkrun
Pete.