Optimizing Power Consumption in Battery-Powered Devices

Today we have a guest post from Silard Gal, an embedded systems designer. He has worked on many prototypes for companies around the World and his focus now is smart city hardware and software. You can contact him via LinkedIn. Your new IoT device is ready. It’s finally booting, communicating, and reading sensors. You feel awesome! …

Neat trick: Flexible Macro Vs Function Definitions

I was looking over musl's ctype.h header while working on libc earlier today. In the header, I noticed a curious set of definitions: #define isalpha(a) (0 ? isalpha(a) : (((unsigned)(a)|32)-'a') < 26) #define isdigit(a) (0 ? isdigit(a) : ((unsigned)(a)-'0') < 10) #define islower(a) (0 ? islower(a) : ((unsigned)(a)-'a') < 26) #define isupper(a) (0 ? isupper(a) …