Solution
Use modules
Off load real-time to dedicated µC
Simplify top level programming!
Simplify electronics, too!