We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have two different programs lets call A and B. I have a function in A called A1 which has local variables. this Calls a function in B named B1 which calls a different function in A called A2 which also has local variables. Both A1 and A2 use the same Xdata space but do not call each other. when A2 executes it ovrewrites A1's local variables. When A2 returns to B1 which then returns to A1 the local variables in A1 now have the same values as A2's local variables. Is there any way in uVision 6.10 that I can use to let these two functions know about each others local variables, or is there some other answer.
Unless explicitly initialised, the values of local variables are "indeterminate" on entry to a function. If two functions have similar sets of local variables, it may well be that the "indeterminate" initial values just happen to be the values left by the previous function; but any changes to the size, number, order, etc of the variables, or adding/removing other functions, or changes to the order of calling functions, or even Keil version changes could alter this effect. If you really want functions to share data, you should make that data global or, preferably, provide some more "object-oriented" means of access to it.