that's new to me at last, pursued and there is also LINE
but what is #if 1 looking at?
that's new to me at last, pursued and there is also LINE
but what is #if 1 looking at?
there is even PRETTY_FUNCTION is there a list of all these?
What do you mean?
1 is always true (because it is non-zero)
i used #if/#elif/#else instead commenting out multiple lines of code
i added prints to debug, but then needed to remove them to maintain the program byte count comparisons
ok, so you manually set them before compile. I get it. and with
#ifdef DBG, the compiler see no DBG and therefore it is zero.
handy!
Now you've got me confused
without a #define DBG, #ifdef DBG is the same as #if 0
Clever!
Ok, I'll simply answer the question:
Is there some optimazation routine in the compiler causing this?
Yes. The compiler used by Arduino is quite "smart" and does a LOT of optimizations. Normally, you can rearrange code a great deal, and the object code produced will remain essentially the same, which is a good thing when you're trying to make the code easy to read (which you should.) The days when you could make your program run faster by cramming together a bunch of code into a single line and using short variable names and no comments are long over.
The information provided is insufficient to determine exactly what is happening in this case. In particular, what is Ext, Sta, SwPin, and SwBoolOn. I suspect that some of those array accesses evaluate at compile time, and so eliminating them does not reduce code size, but perhaps FlipFlop * 100 causes a multiply function to be pulled in to the code...
I was just thinking of this and yeah, there would be a rollover issue if the prior millis is greater than the current millis. I guess I have to change them all. Either that or set them all to reset after a month.
I had thought of that before but figured it would just catch up on a later read, but not really because on a later read it would still not save the new number.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.