Hacker News new | ask | show | jobs
by blt 716 days ago
no hardware interrupts? that seems like a big limitation for a microcontroller environment.
2 comments

MicroPython supports interrupts. But on some platform, like ESP32, the callback is scheduled. Preemption is still used, but it adds some microseconds and the delay is a bit variable. So it will work for some things, like reacting to a interrupt from an I2C sensor etc, or button push. But probably not good enough for a high speed protocol (so better use peripherals for that, like RMT in ESP32).
It only supports hardware interrupts on some platforms, with some pretty hefty limitations (not being able to allocate memory means that a lot of Python stuff is unavailable). I timed the "soft interrupts", those triggered within 80 or so microseconds IIRC.