Cute Creator

For a long time I’ve been looking for a good cross platform development environment that would allow fast exploration and navigation of C/C++ source code, not just editing of individual files. For a while I though that Eclipse will fit the bill, but as I wrote previously, the CDT (C/C++ Development Tooling) was really disappointing for […]

Read More

PIC stack overflow

For regular readers of this blog I apologize for turning once again to the topic of my Nom de Guerre. If you really don’t want to read about stack overflow again, then just skip to the second section of this posting where I address the far more interesting topic of why anyone uses an 8-bit […]

Read More

Unused interrupt vectors

With the exception of low end PIC microcontrollers, most microcontrollers have anywhere from quite a few to an enormous number of interrupt vectors. It’s a rare application that uses every single interrupt vector, and so the question arises as to what, if anything, should one do with unused interrupt vectors? I have seen two approaches […]

Read More

Effective C Tip #3 – Exiting an intentional trap

This is the third in a series of tips on writing what I call effective C. Today I’d like to give you a useful hint concerning traps. What exactly do I mean by a trap? Well while C++ has a ‘built in’ exception handler (try searching for ‘catch’ or ‘throw’), C does not (thanks to Uhmmmm for […]

Read More

On the use of correct grammar in code comments

Back when I was in college the engineering students were fond of dismissing the liberal arts majors by doing such witty things as writing next to the toilet paper dispenser “Liberal Arts degree – please take one”. One of the better retaliatory pieces of graffito that I really liked was: “Four years ago I couldn’t […]

Read More

Embedded Systems Conference Wrap-Up

I spent last week in San Jose, at the Embedded Systems Conference (ESC). As I have come to expect (this was my twelfth consecutive year as a speaker), the event remains the place for embedded systems developers to be. There is no other similar event for learning about the latest processors, middleware and programming techniques; running […]

Read More

Coding Standard Rule #9: Don’t Create Function-Like Macros

Rule: Parameterized macros shall not be used if an inline function can be written to accomplish the same task. Example: #define MAX(A, B) ((A) > (B) ? (A) : (B)) // Don’t do this …inline int max(int a, int b) // … if you can do this instead. Reasoning: There are a lot of risks associated with […]

Read More

Commuting is crazy!

A few posts back I suggested that (American) employers would benefit from giving their engineers a lot more time off. In the comments section, Brad opined that he would very much like to work four 10-hour days. One of the reasons he gave was to avoid the stress and hassle of his daily commute. I agree completely […]

Read More

Coding Standard Rule #8: Don’t Mix Signed and Unsigned Data

Rule: Signed integers shall not be combined with unsigned integers in comparisons or expressions. In support of this, decimal constants meant to be unsigned should be declared with a ‘u’ at the end. Example (don’t): uint8_t a = 6u;int8_t b = -9; if (a + b < 4){// This correct path should be executed// if […]

Read More