Hi, I want to avoid the CALL \ RET overhead of a certain function which is called only once in my program.
I understand the uVision compiler does not support the inline keyword (http://www.keil.com/support/docs/1755.htm), and I should use macros instead. The problem is that uVision cannot step into macros when debugging.
Is there any good solution for this problem?
"I want to avoid the CALL \ RET overhead of a certain function which is called only once"
If it is only called once, is it really that much of an overhead?
IF it is not called from elsewhere, why make it a separate function anyhow?
This will produce function with hundreds of lines, that is obviously not likely.
I want to keep a modular and efficient code, and calling a function takes more than 10 clocks (think of it within a loop), not speaking when it takes a few variables.
"This will produce function with hundreds of lines, that is obviously not likely."
There's nothing "unlikely" about it.
If execution speed is of paramount importance, then you do what is necessary...
You can have it "pretty" or you can have it "fast" - you can't have your cake and eat it!
"I want to keep a modular and efficient code"
Whether you use a macro or write the code verbatim makes no difference to either modularity or efficiency!
"think of it within a loop"
Is it in a loop? You didn't state that!
View all questions in Keil forum