... just had a play at adding that peek/poke fast path. Try this now:
function foo() {
"compiled";
var GPIOB = 0x40020418; // BSRR register
var PIN = 1 << 2;
var cnt = 10000000;
var t = getTime();
for (var i=0;i<cnt;i++) {
poke32(GPIOB, PIN); // on
poke32(GPIOB, PIN<<16); // off
}
console.log((cnt / (1000000*(getTime()-t))) + " Mhz");
}
LED1.set(); // set up as output first
foo();
And for me it reports 7.7Mhz, which is just a bit faster :)
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.
... just had a play at adding that peek/poke fast path. Try this now:
And for me it reports 7.7Mhz, which is just a bit faster :)