So you’re getting better at programming microcontrollers and now you want to do several things at once? You know better than that, microcontrollers are only capable of processing one thing at a time.
Working with embedded systems usually involves writing code which will interface with hardware. This often means working on the register level. It doesn’t matter if we’re talking about a UART, an ...
bfix has two routines for insertion(bfi()) and extraction(bfx()) of bit fields in data of arbitrary length. It can be compiled with little/big endian or have run timechecking. It is 32/64 bit safe.