Ok, thanks for giving that a go. It's difficult to track down without having an MPU6050 here (it's a contributed module).
If you uncomment the console.log, how quickly is it being called?
It'd be interesting if you could compare getTime before and after the call in dmpLoop, to see if the function call is actually taking the majority of the time or not.
should be removed, and the check moved into the if statement above.
My hunch is that the interrupt line is maybe getting pulled low for reasons other than the FIFO having data, and that's causing it to enter the getData function and then get stuck polling for more data.
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.
Ok, thanks for giving that a go. It's difficult to track down without having an MPU6050 here (it's a contributed module).
If you uncomment the
console.log
, how quickly is it being called?It'd be interesting if you could compare
getTime
before and after the call indmpLoop
, to see if the function call is actually taking the majority of the time or not.If you're able to change the module yourself, I think the while loop in this line: https://github.com/espruino/EspruinoDocs/blob/master/devices/MPU6050_DMP.js#L121
should be removed, and the check moved into the
if
statement above.My hunch is that the interrupt line is maybe getting pulled low for reasons other than the FIFO having data, and that's causing it to enter the
getData
function and then get stuck polling for more data.