Xavier wrote:So if I understand I should return to Main after each time my program has run through it's timer's and after each timer call a macro to do the LCD update? I
Yes That is indeed the case. Just allow the timer macro to exit out the bottom of the interrupt macro.
What I do is place a variable called update within my interrupt macro.
Then in Main I have a Decision branch:
If update then Update = 0 : Call Update LCD Macro
Xavier wrote: I was under the impression that one cannot call a macro from within a macro
Well you can call a macro form another macro so long as
1. Your not calling a macro from an interrupt macro
2, The second macro is allowed to exit at the bottom of the macro.
3. Very important: Number of stacks are not exceeded (You will get a warning about this during compiling. Just remember its not just going into macros that will cause stacks to increase, stack will increase with going to to each component, but will decrease again when back out of the component etc), then you can call even more macros from with in macros, but never call any of the macros that have got you into your current macro if you know what I mean?
E.g
Call LCD update Macro
Then within LCD update Macro you call a Switch detect Macro.
If within the Switch detect macro you again call LCD update Macro, that is where program will fail.
Stack corruption will be on the cards.
When you do compile, it is always advisable to look out for stack corruption warnings.
If any are shown, then you will need to modify flowchart until no more corruption warnings.
Since its not an interrupt macro then you can have LCD routines in both macros, the not the came component only applies to interrupt macros.