Protothreads is a library written by Adam Dunkels to provide "thread-like" operations for embedded systems like bare-metal microcontrollers. In this entry we will be going over the theory of the Protothreads library, and showing some real world examples of how to use it with real results.

Protothreads website:

Protothreads can make complex state machines simpler to code and read, while not adding an entire operating system on top. ...

Sign Up For Full Access
Members gain full access to the Prosource library with dozens of source files for ARM Cortex, ATMega, PIC processors as well as desktop and embedded Linux systems. Solutions for bootloaders, Buildroot and Yocto targets as well as guided articles on embedded development to gain critical knowledge in new systems and speed up development.
Files size: 1.2 KB
RAM usage:2 bytes per thread
Avg Flash:Variable but PT_WAIT macros are very lightweight
Source #1 - Members Only