You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Actually ARM assembler isn't that painful. Most of it is done for you already here under 'Accessing IO' and 'Loops', so it's almost copy+paste.

    But yes, you could poke the IO address. However at the moment that's still a function call via the JS interpreter which will take quite a bit of time (it should be faster than digitalWrite though) - If I changed the compiler to handle peek and poke with known values as low-level operations it'd be crazy fast though. It's just finding time ;)

    Another thing to try if you're playing around is bind. You could do:

    var A = digitalWrite.bind(undefined,B2,1);
    var B = digitalWrite.bind(undefined,B2,0);
    // ...
    A();
    B();
    

    or

    var A = B2.set.bind(B2);
    var B = B2.reset.bind(B2);
    // ...
    A();
    B();
    

    I haven't tried, but they could be a smidge faster.

About

Avatar for Gordon @Gordon started