3 ms·
You might want to look into a RTOS. Each task has its own stack, and can communicate with other tasks with mailboxes or shared memory (with a lock). You'd hav
by ipoopatwork 7y ago
You might want to look into a RTOS.
Each task has its own stack, and can communicate with other tasks with mailboxes or shared memory (with a lock).
You'd have a task for each of the things you mention: debouncing a button, drive the display from a buffer, and application logic.
The application logic then doesn't have to worry about bounces, how long it'll take to drive the display, etc.
Modal screens over static screens is orthogonal to this though. You'd need to build a priority scheme, and only pass down events to the current on-screen view.
- odiroot 7y agoThanks, ipoopatwork. I'm using MicroPython and this is what I want to stick with. But I'll research how RTOS is doing things and make an equivalent.