Quantcast
Channel: Comments on: Effective C Tip #3 – Exiting an intentional trap
Browsing all 10 articles
Browse latest View live

By: Uhmmmm

When did C get exception handling? Last I heard, that was C++, not C.

View Article



By: GregK

What I am doing when only have uart in device:void SystemErrorHandler(const char * const File, const int Line){disable_interrupts();reset_uart(); /* clear pending characters, reset uart, bring back...

View Article

By: Nigel Jones

“When did C get exception handling? Last I heard, that was C++, not C.”Sigh. The perils of working in two (similar) languages. Apologies on this folks. I’ll correct the posting.GregK – what you have...

View Article

By: GregK

Compilation date is just in case if you made change, but forgot change version of software, so __DATE__ and __TIME__ is your friend.

View Article

By: Greg Nelson

In my own code, I use something along the lines of:void trap(void) { breakpointable_function();}where breakpointable_function() is something that returns without any bad side effects. This could be an...

View Article


By: Gauthier

Any good reason for not having Exit_trap as an auto variable inside the function? Even if it compiles to a register, you should be able to modify it, shouldn’t you?

View Article

By: Nigel Jones

There is a reason – though I’ll let you judge if it’s good or not. Most debuggers differentiate between auto variables and non-auto variables by placing them in different ‘watch’ windows. I find that I...

View Article

By: Gauthier

Odd. The “auto” watch window in my environment (IAR Embedded Workbench for msp430) is not related to the variable’s storage class, it’s just that IAR is trying to automatically find for you the...

View Article


By: Nigel Jones

That’s good to know. I recollect using IDE’s where that is not the case – so perhaps that’s where I got in the habit. It also occurred to me that there’s another reason why I do it this way – and...

View Article


By: Frank

I do something similar, except I add an explicit breakpoint. For example, in my current ARM project, I have the following: #define _BKPT __ASM(“bkpt 0″) I put _BKPT before the infinite loop. I use this...

View Article
Browsing all 10 articles
Browse latest View live




Latest Images