~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Firmware Update
- March 22, 2011
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
in this issue
-- Do Inline Function Bodies Belong in C Header Files?
-- What Else Belongs in C Header Files?
-- Save Big on Embedded Systems Conference Registration
-- What NHTSA/NASA Didn't Consider re: Toyota's Firmware
-- Industry News You Can Use

Firmware Update is a free newsletter by embedded software expert Michael Barr. It is Copyright 2011 by Netrino, LLC, but may be reprinted for non-commercial purposes. Please forward it to colleagues who may benefit from the information.


Do Inline Function Bodies Belong in C Header Files?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I recently received the following question by e-mail: "I am trying to conform to the rules in your Embedded C Coding Standard book and I just ran into what may be a problem with Rule 6.3.a. Instead of using function-like macros, I'm using inline functions, as you recommend. However, my compiler gives an error when I declare a function to be inline at both header and source file. If I put both the inline declaration and function body inside the header file it works fine. This fixes my compiler problem, but isn't it a bad practice to place code inside the header file?"

This is a good question, as it seems to be about a conflict between the Embedded C Coding Standard and what I refer to as "Generally Accepted Programming Principles". It's also approaching a frequently asked question, so I've made my thoughts on the subject public, in my blog.

Read the answer...


What Else Belongs in C Header Files?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I frequently get questions from embedded C programmers about what sorts of things should and shouldn't be in a header file and when to create a new one. So I've put together a helpful list of do's and don'ts. For example:

DON'T expose any variable in a header file, as is too often done by way of the 'extern' keyword. Proper encapsulation of a module requires hiding any and all internal state data in private variables inside the .c source code files. Whenever possible these variables should also be declared with keyword 'static' to enlist the linker's help in hiding them.

See the whole list...


Save Big on Embedded Systems Conference Registration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The big Embedded Systems Conference 2011 Silicon Valley show opens in less than six weeks. Judging from the speaker and course lineups, it looks like it's going to be a really great ESC conference again this year. I strongly encourage you to go if you can.

There are five great reasons to register for the conference this week, including a special promo code worth an additional 20% off any registration fee and a chance to win a free seat at a future Embedded Software Boot Camp.

Find out more...


What NHTSA/NASA Didn't Consider re: Toyota's Firmware
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The previous Firmware Update newsletter led with my thoughts on the NHTSA/NASA report regarding Toyota's firmware (Unintended Acceleration and Other Embedded Software Bugs). My overall point was that it is hard to judge the quality of the analysis (and thereby the overall conclusion that the software isn't to blame for unintended accelerations) given the large number of redactions.

Upon reflection, I have a few other thoughts and observations worth writing down. First, that some of the explanations offered by Toyota are insufficient proofs. Second, that NASA's team might have undertaken a number of analyses that it apparently did not. So I wrote a followup.

Read on...


Industry News You Can Use
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Help VDC with their annual embedded developer survey for a chance to win an iPad 2 or Amazon.com gift certificate. Start here: http://bit.ly/g6ESan

The final launch of space shuttle Discovery as seen from an airplane. Awesome video: http://bit.ly/hrDDuz

Google's Android faces a serious Linux copyright issue. Analysis: http://bit.ly/h1wOAe

How to get the most out of a single timer on an MCU. Article: http://bit.ly/dVpgUL

Programmers missed a bug in the Boeing 777 autopilot. Fortunately, passengers on Flight 124 survived the roller coaster ride. Factlet: http://factlets.info/Bug

Xilinx pulls the wraps off of Zynq, a new kind of CPU-FPGA hybrid that aims to replace expensive ASICs. Perspective: http://bit.ly/gX2qfj

IAR Systems announces integration of its popular compiler and debugger with the open source Eclipse IDE. Yay: http://bit.ly/ib7QSZ

More like this...


Quick Links
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • Embedded C Coding Standard
  • Embedded Software Boot Camp
  • Embedded Systems Glossary
  • Independent Source Code Audits


  • Contact Information
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    phone: 866.78.EMBED
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~