It's an odd one - on 'official' boards digitalPulse queues events into a hardware timer and is effectively asynchronous, plus execution speed seems about fast enough that your code should be ok.
On ESP8266 digitalPulse is synchronous so you have to use arrays, but there was some work done a few months ago to make it async on ESP32 as well - so as you say it probably just comes down to execution speed on ESP32 not being quite fast enough.
Even if you don't want to pack into an array, it's possible that changing:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
It's an odd one - on 'official' boards
digitalPulse
queues events into a hardware timer and is effectively asynchronous, plus execution speed seems about fast enough that your code should be ok.On ESP8266 digitalPulse is synchronous so you have to use arrays, but there was some work done a few months ago to make it async on ESP32 as well - so as you say it probably just comes down to execution speed on ESP32 not being quite fast enough.
Even if you don't want to pack into an array, it's possible that changing:
to
and so on would reduce the overhead enough that it'd work.