Reading through @Gordon's comments and suggestions, some of the history, and now the number of ports you serve, could it be that JS just does not get quickly enough its cpu cycles? - ...adding setSleepIndicator(pin) / setBusyIndicator(pin) to your code could provide this information. If you have streaks of long JS - with some 'weird' code - worst case looping until a pin status kicks in - interrupt serving in the JS layer is delayed... and refilling the buffers as well...
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.
Reading through @Gordon's comments and suggestions, some of the history, and now the number of ports you serve, could it be that JS just does not get quickly enough its cpu cycles? - ...adding setSleepIndicator(pin) / setBusyIndicator(pin) to your code could provide this information. If you have streaks of long JS - with some 'weird' code - worst case looping until a pin status kicks in - interrupt serving in the JS layer is delayed... and refilling the buffers as well...