@Alpine thank you, very clear explanation.
That program has no collections, perhaps dynamic arrays, all objects are created only 1 time in initialization, if I well remember. But I will check better.
About communications with devices, someone has interrupts, but not all. But it should request a more complex hardware wiring. I prefer the simple communication on I2C where master calls, and device answer only when called.