The comparation of common design pattern in firmware design, RTOS and infinite loop. The advantages and disadvantages of each design will help you choose the best solution for your project.