You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • ... 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 :)

About

Avatar for Gordon @Gordon started