When many things have to be handled on a tight schedule, one option is to consider a real time operating system (RTOS). Let us consider an engine controller where timing is essential around many aspects to achieve the best performance while cruising or accelerating.
The project here is based on Maker.io'r Getting started with STM32 - Introduction to FreeRTOS. If you want to learn more, Digi-Key with Shawn Hymel has a whole series on the topic of RTOS.