• Hi - sorry for the delay, I was off last week.

    Pretty much all pins are inputs by default, but B6/B7 aren't as they're Serial1, which is the default console when USB isn't connected. I think that was probably what got you. digitalWrite/etc set the pin mode automatically, unless you set it explicitly with pinMode - which as @DrAzzy says can be used to get Open Drain.

    My hunch is that setWatch would be fast enough (and there's a 128 event buffer that should handle a few bytes) but the data from the PS2 mouse is just coming in so fast that Espruino can't process it in time.

    As I'd said in the other post, you can now use USART to sample serial data (as of 1v80 or recent GitHub builds) so that should work in this case. I'm hoping that when I sort out some reliability issues you'll also be able to run compiled code from an IRQ, which will hopefully be fast enough to work in these kind of cases.

    ... You can currently run assembly code from an IRQ using setWatch with irq:true, but realistically it's going to be a bit of a nightmare to do much with it.

About

Avatar for Gordon @Gordon started