Error checking and reporting?

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Until I started programming microcontrollers, I've always had a habit of checking function arguments and various error conditions and report them somehow. E.g. printf, a popup window, or a file, on PCs or larger computers.

Generally I would convert "void ()" routine calls into functions returning success or error status, so I have error processing along a call chain.

I know it's difficult on a micro. There are space issues for the extra code, and there is often no way to report the error.

Still, I'm curious how you professionals are doing it. For instance, I'd love to take a peek at the structure of the code inside a Honeywell thermostat, Ademco security system, or some washing machine and see if their routines are all void() or if they stash a code somewhere that an installer can access with a special menu and then count LED blinks etc.

Or do people tend to run watchdog timers and try to cover up any odd occurrences with soft resets ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Over the years I have increased my error detection and reporting, so that when ever possible I will look for problems and report them back. When fault finding over the phone or internet it can save a few tears.

Keep it simple it will not bite as hard