- add missing header string.h for memset()
- enhance code readabilityn especially for formulas
- convert C++ comment style to C comment style
- set the device name in a #define instead