I'm working on support for an as un-yet supported board and am making progress. During my unit testing, I am finding that something odd is happening with numbers. For example, I ran the following function:
var x=1; setInterval(function() {x=x+1;}, 1000);
Expecting to find that the function would be called every second. Instead, I seem to find it being called very, very fast. When I run dump(), I find the following:
setInterval(function () {x=x+1;}, 8.855);
which as you can see, the last parameter has been changed. Digging further, I found the function called:
and added a logging statement to print the value of "interval" when it is called. What is logged is:
8.85454559326
I'm not sure where to go next. Apparently something is wrong in my setup. My processor is the xtensa lx106 (ESP8266) which I believe is a 32bit device. I sense I may be mixing 64bit processing and 32bit processing ... but haven't seen where yet.
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.
I'm working on support for an as un-yet supported board and am making progress. During my unit testing, I am finding that something odd is happening with numbers. For example, I ran the following function:
Expecting to find that the function would be called every second. Instead, I seem to find it being called very, very fast. When I run dump(), I find the following:
which as you can see, the last parameter has been changed. Digging further, I found the function called:
and added a logging statement to print the value of "interval" when it is called. What is logged is:
I'm not sure where to go next. Apparently something is wrong in my setup. My processor is the xtensa lx106 (ESP8266) which I believe is a 32bit device. I sense I may be mixing 64bit processing and 32bit processing ... but haven't seen where yet.
Neil